diff --git a/.gitignore b/.gitignore index 1d5bc735..540b37e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .*.swp +/deleteme /old /*.tap /dist diff --git a/fixup.sh b/fixup.sh index 34d813fa..76baa020 100644 --- a/fixup.sh +++ b/fixup.sh @@ -1,17 +1,19 @@ #!/usr/bin/env bash -cat >dist/cjs/package.json <dist-tmp/cjs/package.json <dist/mjs/package.json <dist-tmp/mjs/package.json <=8" } }, + "node_modules/sync-content": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/sync-content/-/sync-content-1.0.2.tgz", + "integrity": "sha512-znd3rYiiSxU3WteWyS9a6FXkTA/Wjk8WQsOyzHbineeL837dLn3DA4MRhsIX3qGcxDMH6+uuFV4axztssk7wEQ==", + "dev": true, + "dependencies": { + "glob": "^10.2.6", + "mkdirp": "^3.0.1", + "path-scurry": "^1.9.2", + "rimraf": "^5.0.1" + }, + "bin": { + "sync-content": "dist/mjs/bin.mjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sync-content/node_modules/glob": { + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", + "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sync-content/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sync-content/node_modules/rimraf": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.1.tgz", + "integrity": "sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg==", + "dev": true, + "dependencies": { + "glob": "^10.2.5" + }, + "bin": { + "rimraf": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/tap": { "version": "16.3.7", "resolved": "https://registry.npmjs.org/tap/-/tap-16.3.7.tgz", diff --git a/package.json b/package.json index 2d25985d..fd9c108c 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,7 @@ "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "preprepare": "rm -rf dist", - "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash fixup.sh", + "prepare": "tsc -p tsconfig/cjs.json && tsc -p tsconfig/esm.json && bash fixup.sh", "pretest": "npm run prepare", "presnap": "npm run prepare", "test": "c8 tap", @@ -73,6 +72,7 @@ "mkdirp": "^2.1.4", "prettier": "^2.8.3", "rimraf": "^4.1.3", + "sync-content": "^1.0.2", "tap": "^16.3.4", "ts-node": "^10.9.1", "typedoc": "^0.23.24", diff --git a/tsconfig-base.json b/tsconfig-base.json deleted file mode 100644 index 17e4b173..00000000 --- a/tsconfig-base.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "exclude": ["./test", "./tap-snapshots"], - "include": ["src/**/*.ts"], - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "declaration": true, - "declarationMap": true, - "inlineSources": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node", - "resolveJsonModule": true, - "sourceMap": true, - "strict": true, - "target": "es2022" - } -} diff --git a/tsconfig-esm.json b/tsconfig-esm.json deleted file mode 100644 index f3570ff0..00000000 --- a/tsconfig-esm.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig-base.json", - "exclude": ["./test", "./tap-snapshots", "./src/bin.ts"], - "compilerOptions": { - "module": "esnext", - "outDir": "dist/mjs" - } -} diff --git a/tsconfig.json b/tsconfig.json index 13690021..930a9788 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,16 @@ { - "extends": "./tsconfig-base.json", "compilerOptions": { + "allowSyntheticDefaultImports": true, + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "resolveJsonModule": true, "module": "commonjs", - "outDir": "dist/cjs", - "moduleResolution": "Node" + "sourceMap": true, + "strict": true, + "target": "es2022", + "outDir": "deleteme" } } diff --git a/tsconfig/build.json b/tsconfig/build.json new file mode 100644 index 00000000..dd9c9a2e --- /dev/null +++ b/tsconfig/build.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.json", + "exclude": ["../test", "../tap-snapshots"], + "include": ["../src/**/*.ts"] +} diff --git a/tsconfig/cjs.json b/tsconfig/cjs.json new file mode 100644 index 00000000..f0c02d59 --- /dev/null +++ b/tsconfig/cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./build.json", + "compilerOptions": { + "outDir": "../dist-tmp/cjs" + } +} diff --git a/tsconfig/esm.json b/tsconfig/esm.json new file mode 100644 index 00000000..6cdf074e --- /dev/null +++ b/tsconfig/esm.json @@ -0,0 +1,8 @@ +{ + "extends": "./build.json", + "exclude": ["../test", "../tap-snapshots", "../src/bin.ts"], + "compilerOptions": { + "module": "esnext", + "outDir": "../dist-tmp/mjs" + } +}