From edf84c7baeded5cc139c94a3c067988d52071f5a Mon Sep 17 00:00:00 2001 From: Ma Tianqi Date: Wed, 17 Nov 2021 00:55:25 +0800 Subject: [PATCH 1/4] chore(farrow): update esbuild --- packages/farrow/package.json | 2 +- pnpm-lock.yaml | 171 ++++++++++++++++++++++++++++++++++- 2 files changed, 167 insertions(+), 6 deletions(-) diff --git a/packages/farrow/package.json b/packages/farrow/package.json index 7bd7288d..162c5f46 100644 --- a/packages/farrow/package.json +++ b/packages/farrow/package.json @@ -46,7 +46,7 @@ "chokidar": "^3.4.1", "cosmiconfig": "^7.0.0", "cross-spawn": "^7.0.3", - "esbuild": "^0.12.12", + "esbuild": "0.13.14", "esbuild-node-externals": "^1.3.0", "execa": "^5.0.0", "farrow-api": "^1.10.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 81d11e80..16a76eca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -261,7 +261,7 @@ importers: chokidar: ^3.4.1 cosmiconfig: ^7.0.0 cross-spawn: ^7.0.3 - esbuild: ^0.12.12 + esbuild: 0.13.14 esbuild-node-externals: ^1.3.0 execa: ^5.0.0 farrow-api: ^1.10.9 @@ -284,8 +284,8 @@ importers: chokidar: 3.5.2 cosmiconfig: 7.0.1 cross-spawn: 7.0.3 - esbuild: 0.12.29 - esbuild-node-externals: 1.3.0_esbuild@0.12.29 + esbuild: 0.13.14 + esbuild-node-externals: 1.3.0_esbuild@0.13.14 execa: 5.1.1 farrow-api: link:../farrow-api farrow-schema: link:../farrow-schema @@ -3539,20 +3539,181 @@ packages: /es6-object-assign/1.1.0: resolution: {integrity: sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=} - /esbuild-node-externals/1.3.0_esbuild@0.12.29: + /esbuild-android-arm64/0.13.14: + resolution: {integrity: sha512-Q+Xhfp827r+ma8/DJgpMRUbDZfefsk13oePFEXEIJ4gxFbNv5+vyiYXYuKm43/+++EJXpnaYmEnu4hAKbAWYbA==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /esbuild-darwin-64/0.13.14: + resolution: {integrity: sha512-YmOhRns6QBNSjpVdTahi/yZ8dscx9ai7a6OY6z5ACgOuQuaQ2Qk2qgJ0/siZ6LgD0gJFMV8UINFV5oky5TFNQQ==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /esbuild-darwin-arm64/0.13.14: + resolution: {integrity: sha512-Lp00VTli2jqZghSa68fx3fEFCPsO1hK59RMo1PRap5RUjhf55OmaZTZYnCDI0FVlCtt+gBwX5qwFt4lc6tI1xg==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /esbuild-freebsd-64/0.13.14: + resolution: {integrity: sha512-BKosI3jtvTfnmsCW37B1TyxMUjkRWKqopR0CE9AF2ratdpkxdR24Vpe3gLKNyWiZ7BE96/SO5/YfhbPUzY8wKw==} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /esbuild-freebsd-arm64/0.13.14: + resolution: {integrity: sha512-yd2uh0yf+fWv5114+SYTl4/1oDWtr4nN5Op+PGxAkMqHfYfLjFKpcxwCo/QOS/0NWqPVE8O41IYZlFhbEN2B8Q==} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /esbuild-linux-32/0.13.14: + resolution: {integrity: sha512-a8rOnS1oWSfkkYWXoD2yXNV4BdbDKA7PNVQ1klqkY9SoSApL7io66w5H44mTLsfyw7G6Z2vLlaLI2nz9MMAowA==} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /esbuild-linux-64/0.13.14: + resolution: {integrity: sha512-yPZSoMs9W2MC3Dw+6kflKt5FfQm6Dicex9dGIr1OlHRsn3Hm7yGMUTctlkW53KknnZdOdcdd5upxvbxqymczVQ==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /esbuild-linux-arm/0.13.14: + resolution: {integrity: sha512-8chZE4pkKRvJ/M/iwsNQ1KqsRg2RyU5eT/x2flNt/f8F2TVrDreR7I0HEeCR50wLla3B1C3wTIOzQBmjuc6uWg==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /esbuild-linux-arm64/0.13.14: + resolution: {integrity: sha512-Lvo391ln9PzC334e+jJ2S0Rt0cxP47eoH5gFyv/E8HhOnEJTvm7A+RRnMjjHnejELacTTfYgFGQYPjLsi/jObQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /esbuild-linux-mips64le/0.13.14: + resolution: {integrity: sha512-MZhgxbmrWbpY3TOE029O6l5tokG9+Yoj2hW7vdit/d/VnmneqeGrSHADuDL6qXM8L5jaCiaivb4VhsyVCpdAbQ==} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /esbuild-linux-ppc64le/0.13.14: + resolution: {integrity: sha512-un7KMwS7fX1Un6BjfSZxTT8L5cV/8Uf4SAhM7WYy2XF8o8TI+uRxxD03svZnRNIPsN2J5cl6qV4n7Iwz+yhhVw==} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /esbuild-netbsd-64/0.13.14: + resolution: {integrity: sha512-5ekKx/YbOmmlTeNxBjh38Uh5TGn5C4uyqN17i67k18pS3J+U2hTVD7rCxcFcRS1AjNWumkVL3jWqYXadFwMS0Q==} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: false + optional: true + + /esbuild-node-externals/1.3.0_esbuild@0.13.14: resolution: {integrity: sha512-6N1IW4D1aTV/rNSL5CoDNmyr6KqFLkFNTnQlsmdG4QvizLly1itaTLpU7Cz68Gh1z87BM+k64/CM5PbyDZBhxQ==} peerDependencies: esbuild: ^0.12.0 dependencies: - esbuild: 0.12.29 + esbuild: 0.13.14 find-up: 5.0.0 tslib: 2.1.0 dev: false + /esbuild-openbsd-64/0.13.14: + resolution: {integrity: sha512-9bzvwewHjct2Cv5XcVoE1yW5YTW12Sk838EYfA46abgnhxGoFSD1mFcaztp5HHC43AsF+hQxbSFG/RilONARUA==} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: false + optional: true + + /esbuild-sunos-64/0.13.14: + resolution: {integrity: sha512-mjMrZB76M6FmoiTvj/RGWilrioR7gVwtFBRVugr9qLarXMIU1W/pQx+ieEOtflrW61xo8w1fcxyHsVVGRvoQ0w==} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: false + optional: true + + /esbuild-windows-32/0.13.14: + resolution: {integrity: sha512-GZa6mrx2rgfbH/5uHg0Rdw50TuOKbdoKCpEBitzmG5tsXBdce+cOL+iFO5joZc6fDVCLW3Y6tjxmSXRk/v20Hg==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /esbuild-windows-64/0.13.14: + resolution: {integrity: sha512-Lsgqah24bT7ClHjLp/Pj3A9wxjhIAJyWQcrOV4jqXAFikmrp2CspA8IkJgw7HFjx6QrJuhpcKVbCAe/xw0i2yw==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /esbuild-windows-arm64/0.13.14: + resolution: {integrity: sha512-KP8FHVlWGhM7nzYtURsGnskXb/cBCPTfj0gOKfjKq2tHtYnhDZywsUG57nk7TKhhK0fL11LcejHG3LRW9RF/9A==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + /esbuild/0.12.29: resolution: {integrity: sha512-w/XuoBCSwepyiZtIRsKsetiLDUVGPVw1E/R3VTFSecIy8UR7Cq3SOtwKHJMFoVqqVG36aGkzh4e8BvpO1Fdc7g==} hasBin: true requiresBuild: true + dev: true + + /esbuild/0.13.14: + resolution: {integrity: sha512-xu4D+1ji9x53ocuomcY+KOrwAnWzhBu/wTEjpdgZ8I1c8i5vboYIeigMdzgY1UowYBKa2vZgVgUB32bu7gkxeg==} + hasBin: true + requiresBuild: true + optionalDependencies: + esbuild-android-arm64: 0.13.14 + esbuild-darwin-64: 0.13.14 + esbuild-darwin-arm64: 0.13.14 + esbuild-freebsd-64: 0.13.14 + esbuild-freebsd-arm64: 0.13.14 + esbuild-linux-32: 0.13.14 + esbuild-linux-64: 0.13.14 + esbuild-linux-arm: 0.13.14 + esbuild-linux-arm64: 0.13.14 + esbuild-linux-mips64le: 0.13.14 + esbuild-linux-ppc64le: 0.13.14 + esbuild-netbsd-64: 0.13.14 + esbuild-openbsd-64: 0.13.14 + esbuild-sunos-64: 0.13.14 + esbuild-windows-32: 0.13.14 + esbuild-windows-64: 0.13.14 + esbuild-windows-arm64: 0.13.14 + dev: false /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} From 199dce3d95f387b5919651bcf3529325d9be74db Mon Sep 17 00:00:00 2001 From: Ma Tianqi Date: Thu, 18 Nov 2021 00:13:17 +0800 Subject: [PATCH 2/4] chore: support esm and commonjs --- packages/farrow-api-client/package.json | 5 +++ packages/farrow-api-server/package.json | 5 +++ packages/farrow-api-server/tsconfig.esm.json | 23 ++++++++++ packages/farrow-api/package.json | 5 +++ packages/farrow-api/tsconfig.esm.json | 17 ++++++++ packages/farrow-cors/package.json | 5 +++ packages/farrow-cors/tsconfig.esm.json | 17 ++++++++ packages/farrow-deno-api/package.json | 5 +++ packages/farrow-deno-api/tsconfig.esm.json | 23 ++++++++++ packages/farrow-express/package.json | 5 +++ packages/farrow-express/tsconfig.esm.json | 17 ++++++++ packages/farrow-federation/package.json | 5 +++ packages/farrow-federation/tsconfig.esm.json | 23 ++++++++++ packages/farrow-http/package.json | 5 +++ packages/farrow-http/tsconfig.esm.json | 17 ++++++++ packages/farrow-json-schema/package.json | 5 +++ packages/farrow-json-schema/tsconfig.esm.json | 2 +- packages/farrow-koa/package.json | 5 +++ packages/farrow-koa/tsconfig.esm.json | 17 ++++++++ packages/farrow-module/package.json | 5 +++ packages/farrow-next-server/package.json | 5 +++ packages/farrow-next-server/tsconfig.esm.json | 20 +++++++++ packages/farrow-next/package.json | 5 +++ packages/farrow-pipeline/package.json | 5 +++ packages/farrow-react/package.json | 5 +++ packages/farrow-react/tsconfig.esm.json | 14 +++++++ packages/farrow-schema/package.json | 5 +++ packages/farrow-vite/package.json | 5 +++ packages/farrow-vite/tsconfig.esm.json | 14 +++++++ packages/farrow/package.json | 5 +++ packages/farrow/tsconfig.esm.json | 26 ++++++++++++ tsconfig.esm.json | 42 +++++++++++++++++-- 32 files changed, 358 insertions(+), 4 deletions(-) create mode 100644 packages/farrow-api-server/tsconfig.esm.json create mode 100644 packages/farrow-api/tsconfig.esm.json create mode 100644 packages/farrow-cors/tsconfig.esm.json create mode 100644 packages/farrow-deno-api/tsconfig.esm.json create mode 100644 packages/farrow-express/tsconfig.esm.json create mode 100644 packages/farrow-federation/tsconfig.esm.json create mode 100644 packages/farrow-http/tsconfig.esm.json create mode 100644 packages/farrow-koa/tsconfig.esm.json create mode 100644 packages/farrow-next-server/tsconfig.esm.json create mode 100644 packages/farrow-react/tsconfig.esm.json create mode 100644 packages/farrow-vite/tsconfig.esm.json create mode 100644 packages/farrow/tsconfig.esm.json diff --git a/packages/farrow-api-client/package.json b/packages/farrow-api-client/package.json index e0cfc8e0..c0810ce4 100644 --- a/packages/farrow-api-client/package.json +++ b/packages/farrow-api-client/package.json @@ -3,6 +3,11 @@ "version": "1.10.11", "description": "A type-friendly BFF framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "scripts": { "build": "tsc -b", "test": "jest", diff --git a/packages/farrow-api-server/package.json b/packages/farrow-api-server/package.json index 3ec4aabb..a349e79a 100644 --- a/packages/farrow-api-server/package.json +++ b/packages/farrow-api-server/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "A type-friendly BFF framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "scripts": { "build": "tsc -b", "test": "jest", diff --git a/packages/farrow-api-server/tsconfig.esm.json b/packages/farrow-api-server/tsconfig.esm.json new file mode 100644 index 00000000..a9cb4eea --- /dev/null +++ b/packages/farrow-api-server/tsconfig.esm.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-schema/tsconfig.json" + }, + { + "path": "../farrow-api/tsconfig.json" + }, + { + "path": "../farrow-http/tsconfig.json" + }, + { + "path": "../farrow-pipeline/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-api/package.json b/packages/farrow-api/package.json index d024c924..9f53d45b 100644 --- a/packages/farrow-api/package.json +++ b/packages/farrow-api/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "A type-friendly BFF framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "scripts": { "build": "tsc -b", "test": "jest", diff --git a/packages/farrow-api/tsconfig.esm.json b/packages/farrow-api/tsconfig.esm.json new file mode 100644 index 00000000..b4dfbe25 --- /dev/null +++ b/packages/farrow-api/tsconfig.esm.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-schema/tsconfig.json" + }, + { + "path": "../farrow-pipeline/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-cors/package.json b/packages/farrow-cors/package.json index 583ab7b8..a8eadee2 100644 --- a/packages/farrow-cors/package.json +++ b/packages/farrow-cors/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "Cross-Origin Resource Sharing(CORS) for farrow-http", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-cors/tsconfig.esm.json b/packages/farrow-cors/tsconfig.esm.json new file mode 100644 index 00000000..81e5b2ce --- /dev/null +++ b/packages/farrow-cors/tsconfig.esm.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-http/tsconfig.json" + }, + { + "path": "../farrow-pipeline/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-deno-api/package.json b/packages/farrow-deno-api/package.json index 13e141ee..66ffd38c 100644 --- a/packages/farrow-deno-api/package.json +++ b/packages/farrow-deno-api/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "A Type-Friendly Web Framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-deno-api/tsconfig.esm.json b/packages/farrow-deno-api/tsconfig.esm.json new file mode 100644 index 00000000..9e7ef7e0 --- /dev/null +++ b/packages/farrow-deno-api/tsconfig.esm.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-api/tsconfig.json" + }, + { + "path": "../farrow-schema/tsconfig.json" + }, + { + "path": "../farrow-http/tsconfig.json" + }, + { + "path": "../farrow-api-server/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-express/package.json b/packages/farrow-express/package.json index 00d563cd..20ca4a01 100644 --- a/packages/farrow-express/package.json +++ b/packages/farrow-express/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "A Type-Friendly Web Framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-express/tsconfig.esm.json b/packages/farrow-express/tsconfig.esm.json new file mode 100644 index 00000000..60695933 --- /dev/null +++ b/packages/farrow-express/tsconfig.esm.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-pipeline/tsconfig.json" + }, + { + "path": "../farrow-http/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-federation/package.json b/packages/farrow-federation/package.json index d57720d2..ea70928a 100644 --- a/packages/farrow-federation/package.json +++ b/packages/farrow-federation/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "A Type-Friendly Web Framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-federation/tsconfig.esm.json b/packages/farrow-federation/tsconfig.esm.json new file mode 100644 index 00000000..9e7ef7e0 --- /dev/null +++ b/packages/farrow-federation/tsconfig.esm.json @@ -0,0 +1,23 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-api/tsconfig.json" + }, + { + "path": "../farrow-schema/tsconfig.json" + }, + { + "path": "../farrow-http/tsconfig.json" + }, + { + "path": "../farrow-api-server/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-http/package.json b/packages/farrow-http/package.json index 9f979df7..c0056a83 100644 --- a/packages/farrow-http/package.json +++ b/packages/farrow-http/package.json @@ -3,6 +3,11 @@ "version": "1.10.10", "description": "A Type-Friendly Web Framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-http/tsconfig.esm.json b/packages/farrow-http/tsconfig.esm.json new file mode 100644 index 00000000..faf1acdb --- /dev/null +++ b/packages/farrow-http/tsconfig.esm.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-pipeline/tsconfig.json" + }, + { + "path": "../farrow-schema/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-json-schema/package.json b/packages/farrow-json-schema/package.json index 2317c634..481b330a 100644 --- a/packages/farrow-json-schema/package.json +++ b/packages/farrow-json-schema/package.json @@ -3,6 +3,11 @@ "version": "1.10.10", "description": "A type-friendly BFF framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "scripts": { "build": "pnpm run build:dist && pnpm run build:esm", "build:dist": "tsc -b ./tsconfig.json", diff --git a/packages/farrow-json-schema/tsconfig.esm.json b/packages/farrow-json-schema/tsconfig.esm.json index 157f1073..91073a0c 100644 --- a/packages/farrow-json-schema/tsconfig.esm.json +++ b/packages/farrow-json-schema/tsconfig.esm.json @@ -7,7 +7,7 @@ }, "references": [ { - "path": "../farrow-api-server/tsconfig.json" + "path": "../farrow-schema/tsconfig.json" } ], "include": ["src"] diff --git a/packages/farrow-koa/package.json b/packages/farrow-koa/package.json index 7acac261..242a0502 100644 --- a/packages/farrow-koa/package.json +++ b/packages/farrow-koa/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "A Type-Friendly Web Framework", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-koa/tsconfig.esm.json b/packages/farrow-koa/tsconfig.esm.json new file mode 100644 index 00000000..60695933 --- /dev/null +++ b/packages/farrow-koa/tsconfig.esm.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-pipeline/tsconfig.json" + }, + { + "path": "../farrow-http/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-module/package.json b/packages/farrow-module/package.json index ad5cb057..22904afc 100644 --- a/packages/farrow-module/package.json +++ b/packages/farrow-module/package.json @@ -3,6 +3,11 @@ "version": "1.10.7", "description": "A module abstraction providing dependencies management", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-next-server/package.json b/packages/farrow-next-server/package.json index 58649640..febeb883 100644 --- a/packages/farrow-next-server/package.json +++ b/packages/farrow-next-server/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "A next.js adapter for farrow-http", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "src", "dist" diff --git a/packages/farrow-next-server/tsconfig.esm.json b/packages/farrow-next-server/tsconfig.esm.json new file mode 100644 index 00000000..8e604df3 --- /dev/null +++ b/packages/farrow-next-server/tsconfig.esm.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-http/tsconfig.json" + }, + { + "path": "../farrow-pipeline/tsconfig.json" + }, + { + "path": "../farrow-schema/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-next/package.json b/packages/farrow-next/package.json index b8f4d8be..4dc6700f 100644 --- a/packages/farrow-next/package.json +++ b/packages/farrow-next/package.json @@ -3,6 +3,11 @@ "version": "1.10.8", "description": "A framework runs on Next.js", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-pipeline/package.json b/packages/farrow-pipeline/package.json index c5fe48ff..9e655f24 100644 --- a/packages/farrow-pipeline/package.json +++ b/packages/farrow-pipeline/package.json @@ -3,6 +3,11 @@ "version": "1.10.7", "description": "Type-Friendly middleware library", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-react/package.json b/packages/farrow-react/package.json index ef66672d..eb1fca41 100644 --- a/packages/farrow-react/package.json +++ b/packages/farrow-react/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "React bindings for farrow-http", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-react/tsconfig.esm.json b/packages/farrow-react/tsconfig.esm.json new file mode 100644 index 00000000..e310ed1a --- /dev/null +++ b/packages/farrow-react/tsconfig.esm.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-http/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow-schema/package.json b/packages/farrow-schema/package.json index 20cb7123..dde65c31 100644 --- a/packages/farrow-schema/package.json +++ b/packages/farrow-schema/package.json @@ -3,6 +3,11 @@ "version": "1.10.8", "description": "A powerful and extensible schema builder", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-vite/package.json b/packages/farrow-vite/package.json index e3047aee..3255b422 100644 --- a/packages/farrow-vite/package.json +++ b/packages/farrow-vite/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "Vite adapter for farrow", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "files": [ "src", "dist" diff --git a/packages/farrow-vite/tsconfig.esm.json b/packages/farrow-vite/tsconfig.esm.json new file mode 100644 index 00000000..e310ed1a --- /dev/null +++ b/packages/farrow-vite/tsconfig.esm.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-http/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/packages/farrow/package.json b/packages/farrow/package.json index 162c5f46..574cda70 100644 --- a/packages/farrow/package.json +++ b/packages/farrow/package.json @@ -3,6 +3,11 @@ "version": "1.10.9", "description": "Useful modules for developing Farrow App", "main": "dist/index.js", + "exports": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "type": "module", "bin": { "farrow": "./bin/scripts.js" }, diff --git a/packages/farrow/tsconfig.esm.json b/packages/farrow/tsconfig.esm.json new file mode 100644 index 00000000..844f7ce3 --- /dev/null +++ b/packages/farrow/tsconfig.esm.json @@ -0,0 +1,26 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ES2020", + "target": "ES2018", + "outDir": "./esm" + }, + "references": [ + { + "path": "../farrow-http/tsconfig.json" + }, + { + "path": "../farrow-pipeline/tsconfig.json" + }, + { + "path": "../farrow-api/tsconfig.json" + }, + { + "path": "../farrow-api-server/tsconfig.json" + }, + { + "path": "../farrow-schema/tsconfig.json" + } + ], + "include": ["src"] +} diff --git a/tsconfig.esm.json b/tsconfig.esm.json index f84bce84..64d904ed 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -5,22 +5,58 @@ }, "references": [ { - "path": "./packages/farrow-api-client/tsconfig.esm.json" + "path": "./packages/farrow-pipeline/tsconfig.esm.json" }, { - "path": "./packages/farrow-pipeline/tsconfig.esm.json" + "path": "./packages/farrow-module/tsconfig.esm.json" }, { "path": "./packages/farrow-schema/tsconfig.esm.json" }, + { + "path": "./packages/farrow-http/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-react/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-cors/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-api/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-api-server/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-api-client/tsconfig.esm.json" + }, { "path": "./packages/farrow-json-schema/tsconfig.esm.json" }, { - "path": "./packages/farrow-module/tsconfig.esm.json" + "path": "./packages/farrow-express/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-koa/tsconfig.esm.json" + }, + { + "path": "./packages/farrow/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-vite/tsconfig.esm.json" }, { "path": "./packages/farrow-next/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-next-server/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-deno-api/tsconfig.esm.json" + }, + { + "path": "./packages/farrow-federation/tsconfig.esm.json" } ], "exclude": ["./packages/create-farrow-app/templates"] From 9eeb1205d92e46b555e9a4e1b6957c2404005ce0 Mon Sep 17 00:00:00 2001 From: Ma Tianqi Date: Thu, 18 Nov 2021 00:18:40 +0800 Subject: [PATCH 3/4] chore: remove type: module --- packages/farrow-api-client/package.json | 1 - packages/farrow-api-server/package.json | 1 - packages/farrow-api/package.json | 1 - packages/farrow-cors/package.json | 1 - packages/farrow-deno-api/package.json | 1 - packages/farrow-express/package.json | 1 - packages/farrow-federation/package.json | 1 - packages/farrow-http/package.json | 1 - packages/farrow-json-schema/package.json | 1 - packages/farrow-koa/package.json | 1 - packages/farrow-module/package.json | 1 - packages/farrow-next-server/package.json | 1 - packages/farrow-next/package.json | 1 - packages/farrow-pipeline/package.json | 1 - packages/farrow-react/package.json | 1 - packages/farrow-schema/package.json | 1 - packages/farrow-vite/package.json | 1 - packages/farrow/package.json | 1 - 18 files changed, 18 deletions(-) diff --git a/packages/farrow-api-client/package.json b/packages/farrow-api-client/package.json index c0810ce4..e15b803f 100644 --- a/packages/farrow-api-client/package.json +++ b/packages/farrow-api-client/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "scripts": { "build": "tsc -b", "test": "jest", diff --git a/packages/farrow-api-server/package.json b/packages/farrow-api-server/package.json index a349e79a..df99e115 100644 --- a/packages/farrow-api-server/package.json +++ b/packages/farrow-api-server/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "scripts": { "build": "tsc -b", "test": "jest", diff --git a/packages/farrow-api/package.json b/packages/farrow-api/package.json index 9f53d45b..c71bf09a 100644 --- a/packages/farrow-api/package.json +++ b/packages/farrow-api/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "scripts": { "build": "tsc -b", "test": "jest", diff --git a/packages/farrow-cors/package.json b/packages/farrow-cors/package.json index a8eadee2..e3e18c3c 100644 --- a/packages/farrow-cors/package.json +++ b/packages/farrow-cors/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-deno-api/package.json b/packages/farrow-deno-api/package.json index 66ffd38c..32165ea9 100644 --- a/packages/farrow-deno-api/package.json +++ b/packages/farrow-deno-api/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-express/package.json b/packages/farrow-express/package.json index 20ca4a01..4f505568 100644 --- a/packages/farrow-express/package.json +++ b/packages/farrow-express/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-federation/package.json b/packages/farrow-federation/package.json index ea70928a..ffc926d2 100644 --- a/packages/farrow-federation/package.json +++ b/packages/farrow-federation/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-http/package.json b/packages/farrow-http/package.json index c0056a83..aca596ea 100644 --- a/packages/farrow-http/package.json +++ b/packages/farrow-http/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-json-schema/package.json b/packages/farrow-json-schema/package.json index 481b330a..4294e91c 100644 --- a/packages/farrow-json-schema/package.json +++ b/packages/farrow-json-schema/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "scripts": { "build": "pnpm run build:dist && pnpm run build:esm", "build:dist": "tsc -b ./tsconfig.json", diff --git a/packages/farrow-koa/package.json b/packages/farrow-koa/package.json index 242a0502..610aec5e 100644 --- a/packages/farrow-koa/package.json +++ b/packages/farrow-koa/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "dist", "src" diff --git a/packages/farrow-module/package.json b/packages/farrow-module/package.json index 22904afc..9c3e6afd 100644 --- a/packages/farrow-module/package.json +++ b/packages/farrow-module/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-next-server/package.json b/packages/farrow-next-server/package.json index febeb883..1f728fe9 100644 --- a/packages/farrow-next-server/package.json +++ b/packages/farrow-next-server/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "src", "dist" diff --git a/packages/farrow-next/package.json b/packages/farrow-next/package.json index 4dc6700f..36ef63c0 100644 --- a/packages/farrow-next/package.json +++ b/packages/farrow-next/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-pipeline/package.json b/packages/farrow-pipeline/package.json index 9e655f24..d1600726 100644 --- a/packages/farrow-pipeline/package.json +++ b/packages/farrow-pipeline/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-react/package.json b/packages/farrow-react/package.json index eb1fca41..908c9685 100644 --- a/packages/farrow-react/package.json +++ b/packages/farrow-react/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-schema/package.json b/packages/farrow-schema/package.json index dde65c31..b06749b3 100644 --- a/packages/farrow-schema/package.json +++ b/packages/farrow-schema/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "src", "dist", diff --git a/packages/farrow-vite/package.json b/packages/farrow-vite/package.json index 3255b422..57d3e1a9 100644 --- a/packages/farrow-vite/package.json +++ b/packages/farrow-vite/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "files": [ "src", "dist" diff --git a/packages/farrow/package.json b/packages/farrow/package.json index 574cda70..cd536e38 100644 --- a/packages/farrow/package.json +++ b/packages/farrow/package.json @@ -7,7 +7,6 @@ "import": "./esm/index.js", "require": "./dist/index.js" }, - "type": "module", "bin": { "farrow": "./bin/scripts.js" }, From 25539544583636bea88e15ce58cb236d8043fbee Mon Sep 17 00:00:00 2001 From: Ma Tianqi Date: Thu, 18 Nov 2021 00:52:25 +0800 Subject: [PATCH 4/4] fix: module exports --- packages/farrow-api-client/package.json | 8 ++++++-- packages/farrow-api-server/package.json | 8 ++++++-- packages/farrow-api/package.json | 8 ++++++-- packages/farrow-cors/package.json | 8 ++++++-- packages/farrow-deno-api/package.json | 8 ++++++-- packages/farrow-express/package.json | 8 ++++++-- packages/farrow-federation/package.json | 8 ++++++-- packages/farrow-http/package.json | 8 ++++++-- packages/farrow-json-schema/package.json | 8 ++++++-- packages/farrow-koa/package.json | 8 ++++++-- packages/farrow-module/package.json | 8 ++++++-- packages/farrow-next-server/package.json | 8 ++++++-- packages/farrow-next/package.json | 8 ++++++-- packages/farrow-pipeline/package.json | 12 +++++++++-- packages/farrow-react/package.json | 20 +++++++++++++++++-- packages/farrow-schema/package.json | 16 +++++++++++++-- packages/farrow-vite/package.json | 8 ++++++-- .../farrow/__tests__/farrow-server.test.ts | 2 +- packages/farrow/package.json | 8 ++++++-- 19 files changed, 133 insertions(+), 37 deletions(-) diff --git a/packages/farrow-api-client/package.json b/packages/farrow-api-client/package.json index e15b803f..2aa97124 100644 --- a/packages/farrow-api-client/package.json +++ b/packages/farrow-api-client/package.json @@ -4,8 +4,12 @@ "description": "A type-friendly BFF framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "scripts": { "build": "tsc -b", diff --git a/packages/farrow-api-server/package.json b/packages/farrow-api-server/package.json index df99e115..5f5350f1 100644 --- a/packages/farrow-api-server/package.json +++ b/packages/farrow-api-server/package.json @@ -4,8 +4,12 @@ "description": "A type-friendly BFF framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "scripts": { "build": "tsc -b", diff --git a/packages/farrow-api/package.json b/packages/farrow-api/package.json index c71bf09a..57838823 100644 --- a/packages/farrow-api/package.json +++ b/packages/farrow-api/package.json @@ -4,8 +4,12 @@ "description": "A type-friendly BFF framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "scripts": { "build": "tsc -b", diff --git a/packages/farrow-cors/package.json b/packages/farrow-cors/package.json index e3e18c3c..d3500f8e 100644 --- a/packages/farrow-cors/package.json +++ b/packages/farrow-cors/package.json @@ -4,8 +4,12 @@ "description": "Cross-Origin Resource Sharing(CORS) for farrow-http", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "dist", diff --git a/packages/farrow-deno-api/package.json b/packages/farrow-deno-api/package.json index 32165ea9..f48cc2dc 100644 --- a/packages/farrow-deno-api/package.json +++ b/packages/farrow-deno-api/package.json @@ -4,8 +4,12 @@ "description": "A Type-Friendly Web Framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "dist", diff --git a/packages/farrow-express/package.json b/packages/farrow-express/package.json index 4f505568..f92cf711 100644 --- a/packages/farrow-express/package.json +++ b/packages/farrow-express/package.json @@ -4,8 +4,12 @@ "description": "A Type-Friendly Web Framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "dist", diff --git a/packages/farrow-federation/package.json b/packages/farrow-federation/package.json index ffc926d2..edb07f60 100644 --- a/packages/farrow-federation/package.json +++ b/packages/farrow-federation/package.json @@ -4,8 +4,12 @@ "description": "A Type-Friendly Web Framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "dist", diff --git a/packages/farrow-http/package.json b/packages/farrow-http/package.json index aca596ea..d834f3f1 100644 --- a/packages/farrow-http/package.json +++ b/packages/farrow-http/package.json @@ -4,8 +4,12 @@ "description": "A Type-Friendly Web Framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "dist", diff --git a/packages/farrow-json-schema/package.json b/packages/farrow-json-schema/package.json index 4294e91c..c48b29ab 100644 --- a/packages/farrow-json-schema/package.json +++ b/packages/farrow-json-schema/package.json @@ -4,8 +4,12 @@ "description": "A type-friendly BFF framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "scripts": { "build": "pnpm run build:dist && pnpm run build:esm", diff --git a/packages/farrow-koa/package.json b/packages/farrow-koa/package.json index 610aec5e..5a353fac 100644 --- a/packages/farrow-koa/package.json +++ b/packages/farrow-koa/package.json @@ -4,8 +4,12 @@ "description": "A Type-Friendly Web Framework", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "dist", diff --git a/packages/farrow-module/package.json b/packages/farrow-module/package.json index 9c3e6afd..4e30d375 100644 --- a/packages/farrow-module/package.json +++ b/packages/farrow-module/package.json @@ -4,8 +4,12 @@ "description": "A module abstraction providing dependencies management", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "src", diff --git a/packages/farrow-next-server/package.json b/packages/farrow-next-server/package.json index 1f728fe9..98ee705a 100644 --- a/packages/farrow-next-server/package.json +++ b/packages/farrow-next-server/package.json @@ -4,8 +4,12 @@ "description": "A next.js adapter for farrow-http", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "src", diff --git a/packages/farrow-next/package.json b/packages/farrow-next/package.json index 36ef63c0..f76ab14e 100644 --- a/packages/farrow-next/package.json +++ b/packages/farrow-next/package.json @@ -4,8 +4,12 @@ "description": "A framework runs on Next.js", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "src", diff --git a/packages/farrow-pipeline/package.json b/packages/farrow-pipeline/package.json index d1600726..6f9e1f4e 100644 --- a/packages/farrow-pipeline/package.json +++ b/packages/farrow-pipeline/package.json @@ -4,8 +4,16 @@ "description": "Type-Friendly middleware library", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./asyncHooks.node": { + "import": "./esm/asyncHooksImpl/node.js", + "require": "./dist/asyncHooksImpl/node.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "src", diff --git a/packages/farrow-react/package.json b/packages/farrow-react/package.json index 908c9685..7e4d16b4 100644 --- a/packages/farrow-react/package.json +++ b/packages/farrow-react/package.json @@ -4,8 +4,24 @@ "description": "React bindings for farrow-http", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./Context": { + "import": "./esm/Context.js", + "require": "./dist/Context.js" + }, + "./hook": { + "import": "./esm/hook.js", + "require": "./dist/hook.js" + }, + "./Link": { + "import": "./esm/Link.js", + "require": "./dist/Link.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "src", diff --git a/packages/farrow-schema/package.json b/packages/farrow-schema/package.json index b06749b3..71d7e9f6 100644 --- a/packages/farrow-schema/package.json +++ b/packages/farrow-schema/package.json @@ -4,8 +4,20 @@ "description": "A powerful and extensible schema builder", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./formatter": { + "import": "./esm/formatter.js", + "require": "./dist/formatter.js" + }, + "./validator": { + "import": "./esm/validator.js", + "require": "./dist/validator.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "src", diff --git a/packages/farrow-vite/package.json b/packages/farrow-vite/package.json index 57d3e1a9..74608b03 100644 --- a/packages/farrow-vite/package.json +++ b/packages/farrow-vite/package.json @@ -4,8 +4,12 @@ "description": "Vite adapter for farrow", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "files": [ "src", diff --git a/packages/farrow/__tests__/farrow-server.test.ts b/packages/farrow/__tests__/farrow-server.test.ts index 2a90998d..cea664ff 100644 --- a/packages/farrow/__tests__/farrow-server.test.ts +++ b/packages/farrow/__tests__/farrow-server.test.ts @@ -40,7 +40,7 @@ describe('Farrow', () => { expect(shell.test('-d', distPath)).toBe(false) - const result = await exec(`npm run build`) + const result = await exec(`pnpm run build`) console.log('result.stderr', { stderr: result.stderr, diff --git a/packages/farrow/package.json b/packages/farrow/package.json index cd536e38..578367b6 100644 --- a/packages/farrow/package.json +++ b/packages/farrow/package.json @@ -4,8 +4,12 @@ "description": "Useful modules for developing Farrow App", "main": "dist/index.js", "exports": { - "import": "./esm/index.js", - "require": "./dist/index.js" + ".": { + "import": "./esm/index.js", + "require": "./dist/index.js" + }, + "./dist/*": "./dist/*.js", + "./esm/*": "./dist/*.js" }, "bin": { "farrow": "./bin/scripts.js"