fix module imports

This commit is contained in:
Dinhero21 2024-09-12 23:51:00 -03:00
parent c7fa5a4b1d
commit 5dcf920197
5 changed files with 21 additions and 1 deletions

View file

@ -7,6 +7,8 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build": "scripty", "build": "scripty",
"watch:build": "scripty", "watch:build": "scripty",
"copy": "scripty",
"watch:copy": "scripty",
"lint": "scripty", "lint": "scripty",
"run": "scripty", "run": "scripty",
"watch:run": "scripty", "watch:run": "scripty",

View file

@ -1,4 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# --delete-dir-on-start breaks nodemon # --delete-dir-on-start breaks nodemon
swc src -d dist --strip-leading-paths $@ swc \
src --strip-leading-paths -d dist \
$@

11
script/copy.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# hopefully excluding all ts files
# instead of including all node_modules
# doesn't come to bite me in the ass
# later
rsync \
--verbose \
-a --del src/ dist \
--exclude "*.ts" \
$@

3
script/watch/copy.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
nodemon --watch src --exec "./script/copy.sh $@"

View file

@ -196,6 +196,8 @@ async function init(options: InitOptions): Promise<void> {
task.output = 'validating schema...'; task.output = 'validating schema...';
const safe = PackageJsonSchema.parse(unsafe); const safe = PackageJsonSchema.parse(unsafe);
delete safe.index;
safe.type = 'module';
safe.name = options.name; safe.name = options.name;
safe.author = options.author; safe.author = options.author;
safe.license = options.license; safe.license = options.license;