From b3da87f3a2a9cb34c20cd711bbcaa93512922a70 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 31 Aug 2024 01:24:35 -0700 Subject: [PATCH] fix: add module type package.json for modern --- dist/modern/package.json | 1 + package.json | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 dist/modern/package.json diff --git a/dist/modern/package.json b/dist/modern/package.json new file mode 100644 index 00000000..6990891f --- /dev/null +++ b/dist/modern/package.json @@ -0,0 +1 @@ +{"type": "module"} diff --git a/package.json b/package.json index e58aba03..f670f75e 100644 --- a/package.json +++ b/package.json @@ -27,13 +27,14 @@ "tsconfig.json" ], "scripts": { - "build": "turbo build && run-p copy.matchers lint.root.tsc build.parcel && run-p build.babel.actions build.babel.legacy", + "build": "turbo build && run-p copy.matchers lint.root.tsc build.parcel && run-p build.babel.actions build.babel.legacy build.package.modern", "build.parcel": "cross-env NODE_ENV=production parcel build", "build.babel.actions": "babel ./dist/actions --out-dir ./dist/actions --plugins @upleveled/babel-plugin-remove-node-prefix --plugins @babel/plugin-transform-private-methods --compact --no-babelrc --source-maps true", "build.babel.legacy": "babel ./dist/legacy --out-dir ./dist/legacy --plugins @upleveled/babel-plugin-remove-node-prefix --plugins @babel/plugin-transform-private-methods --compact --no-babelrc --source-maps true", + "build.package.modern": "echo '{\"type\": \"module\"}' > ./dist/modern/package.json", "bump": "ncu -u -x numerous,execa,prettier,@types/node,eslint,@types/eslint && pnpm update && pnpx typesync && pnpm run clean", "clean": "shx rm -rf ./dist ./packages/*/dist ./exe ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ", - "copy.matchers": "shx cp ./src/*/*_matcher.json ./dist/legacy/ && shx cp ./src/*/*_matcher.json ./dist/actions/ && shx cp ./src/*/*_matcher.json ./dist/modern/", + "copy.matchers": "shx mkdir -p ./dist/legacy/ ./dist/actions/ ./dist/modern/ && shx cp ./src/*/*_matcher.json ./dist/legacy/ && shx cp ./src/*/*_matcher.json ./dist/actions/ && shx cp ./src/*/*_matcher.json ./dist/modern/", "dev.parcel": "cross-env NODE_ENV=development parcel watch", "dev.packages": "turbo dev", "dev": "run-p dev.packages dev.parcel",