@@ -22,7 +22,7 @@ test-node-watch:
22
22
npx firebase emulators:exec --only firestore " npx jest --env node --watch"
23
23
24
24
test-browser :
25
- npx firebase emulators:exec --only firestore " npx karma start karma.conf.cjs --single-run"
25
+ npx firebase emulators:exec --only firestore " npx karma start --single-run"
26
26
27
27
test-browser-watch :
28
28
npx firebase emulators:exec --only firestore " npx karma start"
@@ -36,32 +36,50 @@ test-system-node-watch:
36
36
npx jest --env node --watch
37
37
38
38
test-system-browser :
39
- npx karma start karma.conf.cjs --single-run
39
+ npx karma start --single-run
40
40
41
41
test-system-browser-watch :
42
42
npx karma start
43
43
44
+ test-types : install-attw build
45
+ @cd lib && attw --pack
46
+
44
47
build :
45
48
@rm -rf lib
49
+ @npx tsc -p tsconfig.lib.json
46
50
@env BABEL_ENV=esm npx babel src --config-file ./babel.config.lib.json --source-root src --out-dir lib --extensions .mjs,.ts --out-file-extension .mjs --quiet
47
51
@env BABEL_ENV=cjs npx babel src --config-file ./babel.config.lib.json --source-root src --out-dir lib --extensions .mjs,.ts --out-file-extension .js --quiet
48
- @npx tsc -p tsconfig.lib.json
49
- # @env npx babel src --config-file ./babel.config.lib.json --source-root src --out-dir lib --extensions .mjs,.ts,.js --out-file-extension .js --ignore "src/**/tests.ts" --ignore "src/tests/**/*" --ignore "src/**/tysts.ts" --ignore "src/tysts/**/*" --ignore "src/**/*.d.ts" --quiet
50
- # @npx prettier "lib/**/*.[jt]s" --write --loglevel silent
51
- # @cp package.json lib
52
- # @cp *.md lib
53
- # @rsync --archive --prune-empty-dirs --exclude '*.ts' --relative src/./ lib
54
- # @npx tsc --project tsconfig.lib.json --outDir lib/esm --module es2020 --target es2019
55
- # @cp src/adapter/package.esm.json lib/esm/adapter/package.json
56
- @rsync --archive --prune-empty-dirs --include='*.d.ts' --include='*.json' -f 'hide,! */' --relative src/./ lib
52
+ @make sync-files
53
+ @make build-mts
57
54
@cp package.json lib
55
+ @cp * .md lib
56
+
57
+ copy-mjs :
58
+ @find src -name ' *.d.ts' | while read file; do \
59
+ new_file=$$ {file%.d.ts}.d.mts; \
60
+ cp $$ file $$ new_file; \
61
+ done
62
+
63
+ sync-files :
64
+ @find src \( -name ' *.d.ts' -o -name ' *.json' \) -print0 | while IFS= read -r -d ' ' file; do \
65
+ dest=` echo " $$ file" | sed ' s|^src/|lib/|' ` ; \
66
+ mkdir -p ` dirname " $$ dest" ` ; \
67
+ rsync -av " $$ file" " $$ dest" ; \
68
+ done
69
+
70
+ build-mts :
71
+ @find lib -name ' *.d.ts' | while read file; do \
72
+ new_file=$$ {file%.d.ts}.d.mts; \
73
+ cp $$ file $$ new_file; \
74
+ done
58
75
59
76
publish : build
60
77
cd lib && npm publish --access public
61
78
62
79
publish-next : build
63
80
cd lib && npm publish --access public --tag next
64
81
65
- docs :
66
- @npx typedoc --theme minimal --name Typesaurus
67
- .PHONY : docs
82
+ install-attw :
83
+ @if ! command -v attw > /dev/null 2>&1 ; then \
84
+ npm i -g @arethetypeswrong/cli; \
85
+ fi
0 commit comments