From f63a13e9306d1e892951d88eace057764541bbfd Mon Sep 17 00:00:00 2001 From: LFades Date: Wed, 12 Jan 2022 01:11:03 -0500 Subject: [PATCH] It's actually working --- packages/commerce/package.json | 5 ++++- packages/commerce/tsconfig.json | 2 +- packages/local/package.json | 13 ++++++++----- packages/local/tsconfig.json | 2 +- site/commerce-config.js | 4 +--- site/tsconfig.json | 4 ++-- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/commerce/package.json b/packages/commerce/package.json index b5134b23c..b6c09efe6 100644 --- a/packages/commerce/package.json +++ b/packages/commerce/package.json @@ -10,7 +10,10 @@ "type": "module", "exports": { ".": "./dist/index.js", - "./*": "./dist/*.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], "./config": "./dist/config.cjs" }, "typesVersions": { diff --git a/packages/commerce/tsconfig.json b/packages/commerce/tsconfig.json index d5394d519..81ac7f650 100644 --- a/packages/commerce/tsconfig.json +++ b/packages/commerce/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "esnext", - "module": "NodeNext", + "module": "esnext", "outDir": "dist", "baseUrl": "src", "lib": ["dom", "dom.iterable", "esnext"], diff --git a/packages/local/package.json b/packages/local/package.json index 9193aabcc..70d2b113f 100644 --- a/packages/local/package.json +++ b/packages/local/package.json @@ -10,14 +10,17 @@ "type": "module", "exports": { ".": "./dist/index.js", - "./*": "./dist/*.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], "./next.config": "./dist/next.config.cjs" }, "typesVersions": { "*": { "*": [ - "src/*", - "src/*/index" + "dist/*", + "dist/*/index" ], "next.config": [ "dist/next.config.d.cts" @@ -31,8 +34,8 @@ "typesVersions": { "*": { "*": [ - "dist/*.d.ts", - "dist/*/index.d.ts" + "src/*.d.ts", + "src/*/index.d.ts" ], "next.config": [ "dist/next.config.d.cts" diff --git a/packages/local/tsconfig.json b/packages/local/tsconfig.json index d5394d519..81ac7f650 100644 --- a/packages/local/tsconfig.json +++ b/packages/local/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "esnext", - "module": "NodeNext", + "module": "esnext", "outDir": "dist", "baseUrl": "src", "lib": ["dom", "dom.iterable", "esnext"], diff --git a/site/commerce-config.js b/site/commerce-config.js index fe2189978..96b939c00 100644 --- a/site/commerce-config.js +++ b/site/commerce-config.js @@ -69,9 +69,7 @@ function withCommerceConfig(nextConfig = {}) { // -> packages/[name]/dist/index.js const relativePath = path.relative(process.cwd(), absolutePath) // -> /packages/[name]/src - const modulePath = path.join(relativePath, '../../dist') - - console.log('PATH', modulePath) + const modulePath = path.join(relativePath, '../../src') tsconfig.compilerOptions.paths['@framework'] = [`${modulePath}`] tsconfig.compilerOptions.paths['@framework/*'] = [`${modulePath}/*`] diff --git a/site/tsconfig.json b/site/tsconfig.json index cbefb0678..d80d4bdbc 100644 --- a/site/tsconfig.json +++ b/site/tsconfig.json @@ -23,8 +23,8 @@ "@components/*": ["components/*"], "@commerce": ["framework/commerce"], "@commerce/*": ["framework/commerce/*"], - "@framework": ["../packages/local/dist"], - "@framework/*": ["../packages/local/dist/*"] + "@framework": ["../packages/local/src"], + "@framework/*": ["../packages/local/src/*"] } }, "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],