From 3d3ed170b5c45ea6586d25921e538010fa474934 Mon Sep 17 00:00:00 2001 From: Dominic Saadi Date: Wed, 27 Dec 2023 21:06:13 -0800 Subject: [PATCH] chore(framework-tools): add tarsync --- nx.json | 13 +- package.json | 9 +- packages/api-server/package.json | 1 + packages/api/package.json | 1 + .../auth-providers/auth0/api/package.json | 1 + .../auth-providers/auth0/setup/package.json | 1 + .../auth-providers/auth0/web/package.json | 1 + .../azureActiveDirectory/api/package.json | 1 + .../azureActiveDirectory/setup/package.json | 1 + .../azureActiveDirectory/web/package.json | 1 + .../auth-providers/clerk/api/package.json | 1 + .../auth-providers/clerk/setup/package.json | 1 + .../auth-providers/clerk/web/package.json | 1 + .../auth-providers/custom/setup/package.json | 1 + .../auth-providers/dbAuth/api/package.json | 1 + .../auth-providers/dbAuth/setup/package.json | 1 + .../auth-providers/dbAuth/web/package.json | 1 + .../auth-providers/firebase/api/package.json | 1 + .../firebase/setup/package.json | 1 + .../auth-providers/firebase/web/package.json | 1 + .../auth-providers/netlify/api/package.json | 1 + .../auth-providers/netlify/setup/package.json | 1 + .../auth-providers/netlify/web/package.json | 1 + .../auth-providers/supabase/api/package.json | 1 + .../supabase/setup/package.json | 1 + .../auth-providers/supabase/web/package.json | 1 + .../supertokens/api/package.json | 1 + .../supertokens/setup/package.json | 1 + .../supertokens/web/package.json | 1 + packages/auth/package.json | 1 + packages/babel-config/package.json | 1 + packages/cli-helpers/package.json | 1 + .../cli-packages/dataMigrate/package.json | 9 +- packages/cli-packages/storybook/package.json | 1 + packages/cli/package.json | 1 + packages/codemods/package.json | 1 + packages/context/package.json | 1 + packages/core/package.json | 1 + packages/create-redwood-app/package.json | 1 + packages/eslint-config/package.json | 3 +- packages/eslint-plugin/package.json | 1 + packages/fastify/package.json | 1 + packages/forms/package.json | 1 + packages/graphql-server/package.json | 1 + packages/internal/package.json | 1 + packages/mailer/core/package.json | 1 + .../mailer/handlers/in-memory/package.json | 1 + .../mailer/handlers/nodemailer/package.json | 1 + packages/mailer/handlers/resend/package.json | 1 + packages/mailer/handlers/studio/package.json | 1 + .../mailer/renderers/mjml-react/package.json | 1 + .../mailer/renderers/react-email/package.json | 1 + packages/prerender/package.json | 1 + packages/project-config/package.json | 1 + packages/realtime/package.json | 1 + packages/record/package.json | 1 + packages/router/package.json | 1 + packages/structure/package.json | 1 + packages/studio/package.json | 7 +- packages/telemetry/package.json | 1 + packages/testing/package.json | 1 + packages/tui/package.json | 5 +- packages/vite/package.json | 9 +- packages/web-server/package.json | 1 + packages/web/package.json | 1 + tasks/framework-tools/tarsync.mjs | 175 ++++++++++++++++++ 66 files changed, 268 insertions(+), 20 deletions(-) create mode 100644 tasks/framework-tools/tarsync.mjs diff --git a/nx.json b/nx.json index 6da728d84f94..207455780f38 100644 --- a/nx.json +++ b/nx.json @@ -30,15 +30,24 @@ ], "cache": true }, + "test": { "inputs": [ "default", "^prod" ], "cache": true + }, + + "build:pack": { + "dependsOn": ["build"], + "outputs": [ + "{projectRoot}/*.tgz" + ], + "cache": true } + }, - "nxCloudAccessToken": "ODMxYWQ1ZjgtMTJhNi00M2Q1LTg1YTAtNTk3NjFkNzNmZjk0fHJlYWQ=", - "parallel": 5 + "nxCloudAccessToken": "ODMxYWQ1ZjgtMTJhNi00M2Q1LTg1YTAtNTk3NjFkNzNmZjk0fHJlYWQ=" } diff --git a/package.json b/package.json index 2faba54d48b1..5a5ffdd5b298 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "packages/studio/web" ], "scripts": { - "build": "lerna run build", + "build": "nx run-many -t build", "build:clean": "node ./tasks/clean.mjs", "build:clean:super": "git clean -fdx && yarn && yarn build", - "build:link": "node ./tasks/build-and-copy", + "build:pack": "nx run-many -t build:pack", "build:test-project": "node ./tasks/test-project/test-project", "build:watch": "lerna run build:watch --parallel; tsc --build", "check": "node ./tasks/check/check.mjs", @@ -26,14 +26,15 @@ "project:copy": "node ./tasks/framework-tools/frameworkFilesToProject.mjs", "project:deps": "node ./tasks/framework-tools/frameworkDepsToProject.mjs", "project:sync": "node ./tasks/framework-tools/frameworkSyncToProject.mjs", + "project:tarsync": "node ./tasks/framework-tools/tarsync.mjs", "rebuild-test-project-fixture": "node ./tasks/test-project/rebuild-test-project-fixture.js", "release": "node ./tasks/release/release.mjs", "release:compare": "node ./tasks/release/compare/compare.mjs", "release:notes": "node ./tasks/release/generateReleaseNotes.mjs", "release:triage": "node ./tasks/release/triage/triage.mjs", "smoke-tests": "node ./tasks/smoke-tests/smoke-tests.mjs", - "test": "lerna run test --concurrency 2 -- --colors --maxWorkers=4", - "test-ci": "lerna run test --concurrency 2 -- --colors --maxWorkers", + "test": "nx run-many -t test -- --colors --maxWorkers=4", + "test-ci": "nx run-many -t test -- --colors --maxWorkers", "test:k6": "tsx ./tasks/k6-test/run-k6-tests.mts", "test:types": "tstyche" }, diff --git a/packages/api-server/package.json b/packages/api-server/package.json index 0fb6bb2bc870..51a199b4da1b 100644 --- a/packages/api-server/package.json +++ b/packages/api-server/package.json @@ -20,6 +20,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-api-server.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build && yarn fix:permissions\"", "fix:permissions": "chmod +x dist/index.js; chmod +x dist/watch.js", diff --git a/packages/api/package.json b/packages/api/package.json index 7572e80032d3..c6f7d5ec55fb 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -24,6 +24,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/auth0/api/package.json b/packages/auth-providers/auth0/api/package.json index 3977fc985cbc..01aad3357389 100644 --- a/packages/auth-providers/auth0/api/package.json +++ b/packages/auth-providers/auth0/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-auth0-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/auth0/setup/package.json b/packages/auth-providers/auth0/setup/package.json index 3cb539fed5b7..9902868d89ca 100644 --- a/packages/auth-providers/auth0/setup/package.json +++ b/packages/auth-providers/auth0/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-auth0-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/auth0/web/package.json b/packages/auth-providers/auth0/web/package.json index b4a82997b3a5..834e79ded6e2 100644 --- a/packages/auth-providers/auth0/web/package.json +++ b/packages/auth-providers/auth0/web/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-auth0-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/azureActiveDirectory/api/package.json b/packages/auth-providers/azureActiveDirectory/api/package.json index 7a39ab9505ab..ec16c01ba49f 100644 --- a/packages/auth-providers/azureActiveDirectory/api/package.json +++ b/packages/auth-providers/azureActiveDirectory/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-azure-active-directory-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/azureActiveDirectory/setup/package.json b/packages/auth-providers/azureActiveDirectory/setup/package.json index ea219efb9cc5..b642e6ab6ea1 100644 --- a/packages/auth-providers/azureActiveDirectory/setup/package.json +++ b/packages/auth-providers/azureActiveDirectory/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-azure-active-directory-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/azureActiveDirectory/web/package.json b/packages/auth-providers/azureActiveDirectory/web/package.json index aa266eede2e7..6fe008d43522 100644 --- a/packages/auth-providers/azureActiveDirectory/web/package.json +++ b/packages/auth-providers/azureActiveDirectory/web/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-azure-active-directory-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/clerk/api/package.json b/packages/auth-providers/clerk/api/package.json index 4edc3a188230..1cd8f651f5e4 100644 --- a/packages/auth-providers/clerk/api/package.json +++ b/packages/auth-providers/clerk/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-clerk-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/clerk/setup/package.json b/packages/auth-providers/clerk/setup/package.json index f90dc0ba596e..b6747fe513eb 100644 --- a/packages/auth-providers/clerk/setup/package.json +++ b/packages/auth-providers/clerk/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-clerk-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/clerk/web/package.json b/packages/auth-providers/clerk/web/package.json index 61545a11ba96..bdf2ae2e5c88 100644 --- a/packages/auth-providers/clerk/web/package.json +++ b/packages/auth-providers/clerk/web/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-clerk-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/custom/setup/package.json b/packages/auth-providers/custom/setup/package.json index c8a8b4355607..ebc3c711846a 100644 --- a/packages/auth-providers/custom/setup/package.json +++ b/packages/auth-providers/custom/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-custom-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/dbAuth/api/package.json b/packages/auth-providers/dbAuth/api/package.json index fca6ae6e73ac..61ed80ea4628 100644 --- a/packages/auth-providers/dbAuth/api/package.json +++ b/packages/auth-providers/dbAuth/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-dbauth-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/dbAuth/setup/package.json b/packages/auth-providers/dbAuth/setup/package.json index 2d9679fc8f4a..a12106f6d30c 100644 --- a/packages/auth-providers/dbAuth/setup/package.json +++ b/packages/auth-providers/dbAuth/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-dbauth-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/dbAuth/web/package.json b/packages/auth-providers/dbAuth/web/package.json index 8e84d6804803..d2493028c31c 100644 --- a/packages/auth-providers/dbAuth/web/package.json +++ b/packages/auth-providers/dbAuth/web/package.json @@ -16,6 +16,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-dbauth-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/firebase/api/package.json b/packages/auth-providers/firebase/api/package.json index 32166dd06ef0..e90b4cb93bb4 100644 --- a/packages/auth-providers/firebase/api/package.json +++ b/packages/auth-providers/firebase/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-firebase-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/firebase/setup/package.json b/packages/auth-providers/firebase/setup/package.json index 7249e131cb6d..7b341fe7a0ff 100644 --- a/packages/auth-providers/firebase/setup/package.json +++ b/packages/auth-providers/firebase/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-firebase-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/firebase/web/package.json b/packages/auth-providers/firebase/web/package.json index 722cde65b5ad..c26828614b43 100644 --- a/packages/auth-providers/firebase/web/package.json +++ b/packages/auth-providers/firebase/web/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-firebase-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/netlify/api/package.json b/packages/auth-providers/netlify/api/package.json index 1c2a519c0fe8..80246e749102 100644 --- a/packages/auth-providers/netlify/api/package.json +++ b/packages/auth-providers/netlify/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-netlify-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/netlify/setup/package.json b/packages/auth-providers/netlify/setup/package.json index cb97f572f656..39ba5ebc3504 100644 --- a/packages/auth-providers/netlify/setup/package.json +++ b/packages/auth-providers/netlify/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-netlify-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/netlify/web/package.json b/packages/auth-providers/netlify/web/package.json index 1267e54b42bb..3b48f28847e7 100644 --- a/packages/auth-providers/netlify/web/package.json +++ b/packages/auth-providers/netlify/web/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-netlify-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/supabase/api/package.json b/packages/auth-providers/supabase/api/package.json index 32ea4aa1eece..6dffb7b0842f 100644 --- a/packages/auth-providers/supabase/api/package.json +++ b/packages/auth-providers/supabase/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-supabase-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/supabase/setup/package.json b/packages/auth-providers/supabase/setup/package.json index f2e719a99668..1a699a6d47ef 100644 --- a/packages/auth-providers/supabase/setup/package.json +++ b/packages/auth-providers/supabase/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-supabase-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/supabase/web/package.json b/packages/auth-providers/supabase/web/package.json index 6d57ce6e4260..f0e9076d49c0 100644 --- a/packages/auth-providers/supabase/web/package.json +++ b/packages/auth-providers/supabase/web/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-supabase-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/supertokens/api/package.json b/packages/auth-providers/supertokens/api/package.json index c9004101d086..6a3ebd3dadd9 100644 --- a/packages/auth-providers/supertokens/api/package.json +++ b/packages/auth-providers/supertokens/api/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-supertokens-api.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/supertokens/setup/package.json b/packages/auth-providers/supertokens/setup/package.json index 8518a9ef7cfe..c44702cc29c1 100644 --- a/packages/auth-providers/supertokens/setup/package.json +++ b/packages/auth-providers/supertokens/setup/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-supertokens-setup.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth-providers/supertokens/web/package.json b/packages/auth-providers/supertokens/web/package.json index c157378f9f64..423f4ff54c7c 100644 --- a/packages/auth-providers/supertokens/web/package.json +++ b/packages/auth-providers/supertokens/web/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored", + "build:pack": "yarn pack -o redwoodjs-auth-supertokens-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/auth/package.json b/packages/auth/package.json index 0d0e31118523..d0032ebbe9a7 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-auth.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/babel-config/package.json b/packages/babel-config/package.json index 3f80b5376868..11bca75dfbe5 100644 --- a/packages/babel-config/package.json +++ b/packages/babel-config/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && run build:types", + "build:pack": "yarn pack -o redwoodjs-babel-config.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/cli-helpers/package.json b/packages/cli-helpers/package.json index 117a16719b81..8bdc55d1ef3e 100644 --- a/packages/cli-helpers/package.json +++ b/packages/cli-helpers/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-cli-helpers.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/cli-packages/dataMigrate/package.json b/packages/cli-packages/dataMigrate/package.json index 11f631d3edfd..8011d75494c2 100644 --- a/packages/cli-packages/dataMigrate/package.json +++ b/packages/cli-packages/dataMigrate/package.json @@ -7,21 +7,22 @@ "directory": "packages/cli-packages/storybook" }, "license": "MIT", + "exports": "./dist/index.js", + "types": "./dist/index.d.ts", "bin": { "up": "./dist/bin.js" }, - "exports": "./dist/index.js", - "types": "./dist/index.d.ts", "files": [ "dist" ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-cli-data-migrate.tgz", "build:types": "tsc --build --verbose", "prepublishOnly": "NODE_ENV=production yarn build", "test": "yarn test:unit && yarn test:dist", - "test:unit": "yarn jest src", - "test:dist": "yarn jest ./dist.test.ts" + "test:dist": "yarn jest ./dist.test.ts", + "test:unit": "yarn jest src" }, "dependencies": { "@redwoodjs/babel-config": "6.0.7", diff --git a/packages/cli-packages/storybook/package.json b/packages/cli-packages/storybook/package.json index 42bdb0b98acf..577fa3f4458d 100644 --- a/packages/cli-packages/storybook/package.json +++ b/packages/cli-packages/storybook/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-cli-storybook.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/cli/package.json b/packages/cli/package.json index b309dc09267c..938e808b46ed 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -20,6 +20,7 @@ "build": "yarn build:js", "build:clean-dist": "rimraf 'dist/**/*/__tests__' --glob", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored && yarn build:clean-dist", + "build:pack": "yarn pack -o redwoodjs-cli.tgz", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build && yarn fix:permissions\"", "dev": "RWJS_CWD=../../__fixtures__/example-todo-main node dist/index.js", "fix:permissions": "chmod +x dist/index.js dist/rwfw.js", diff --git a/packages/codemods/package.json b/packages/codemods/package.json index d94d7c3dfb50..79e9c3400b49 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js", "build:js": "babel src -d dist --extensions \".js,.ts\" --ignore \"src/**/__tests__/**\" --ignore \"src/**/__testfixtures__/**\"", + "build:pack": "yarn pack -o redwoodjs-codemods.tgz", "build:watch": "nodemon --watch src --ignore dist --exec \"yarn build\"", "generate:codemod": "yarn node ./tasks/generateCodemod/generateCodemod.mjs", "prepublishOnly": "yarn build", diff --git a/packages/context/package.json b/packages/context/package.json index 3328ad93507c..7eaba9167f9a 100644 --- a/packages/context/package.json +++ b/packages/context/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-context.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/core/package.json b/packages/core/package.json index 4e52fe2fd7dd..e934e04b80dc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -32,6 +32,7 @@ "scripts": { "build": "yarn build:js", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-core.tgz", "prepublishOnly": "NODE_ENV=production yarn build", "test": "jest", "test:watch": "yarn test --watch" diff --git a/packages/create-redwood-app/package.json b/packages/create-redwood-app/package.json index 5c3375c08f77..69d2e838eb40 100644 --- a/packages/create-redwood-app/package.json +++ b/packages/create-redwood-app/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs", + "build:pack": "yarn pack -o create-redwood-app.tgz", "build:watch": "nodemon --watch src --ignore dist,template --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", "test": "yarn run jest tests", diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index fc771efb7c76..936db6f9480d 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -9,7 +9,8 @@ "license": "MIT", "main": "index.js", "scripts": { - "build": "echo 'Nothing to build..'" + "build": "echo 'Nothing to build..'", + "build:pack": "yarn pack -o redwoodjs-eslint-config.tgz" }, "dependencies": { "@babel/core": "^7.22.20", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 5467a1a279ef..9e1d5075d155 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-eslint-plugin.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/fastify/package.json b/packages/fastify/package.json index 9f04d9579768..302c70c73ef2 100644 --- a/packages/fastify/package.json +++ b/packages/fastify/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-fastify.tgz", "build:types": "tsc --build --verbose", "prepublishOnly": "NODE_ENV=production yarn build" }, diff --git a/packages/forms/package.json b/packages/forms/package.json index ee69351d1c07..edffb7f1c4d7 100644 --- a/packages/forms/package.json +++ b/packages/forms/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-forms.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/graphql-server/package.json b/packages/graphql-server/package.json index e2739e6e9aa7..39bdf08d83c1 100644 --- a/packages/graphql-server/package.json +++ b/packages/graphql-server/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-graphql-server.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/internal/package.json b/packages/internal/package.json index 1abfd2258554..8cdbf07fcb60 100644 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -20,6 +20,7 @@ "build": "yarn build:js && yarn build:types", "build:clean-dist": "rimraf 'dist/**/*/__tests__' --glob", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\" --copy-files --no-copy-ignored && yarn build:clean-dist", + "build:pack": "yarn pack -o redwoodjs-internal.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "fix:permissions": "chmod +x dist/generate/generate.js dist/generate/watch.js", diff --git a/packages/mailer/core/package.json b/packages/mailer/core/package.json index 5ca950ea1eb0..26916160a468 100644 --- a/packages/mailer/core/package.json +++ b/packages/mailer/core/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-mailer-core.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/mailer/handlers/in-memory/package.json b/packages/mailer/handlers/in-memory/package.json index ce18a57b5063..a43f2f6e16c4 100644 --- a/packages/mailer/handlers/in-memory/package.json +++ b/packages/mailer/handlers/in-memory/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-mailer-handler-in-memory.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/mailer/handlers/nodemailer/package.json b/packages/mailer/handlers/nodemailer/package.json index 83803899b340..fb8e6ef0fd04 100644 --- a/packages/mailer/handlers/nodemailer/package.json +++ b/packages/mailer/handlers/nodemailer/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-mailer-handler-nodemailer.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/mailer/handlers/resend/package.json b/packages/mailer/handlers/resend/package.json index 07640efa17d6..7102aa3c8fc9 100644 --- a/packages/mailer/handlers/resend/package.json +++ b/packages/mailer/handlers/resend/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-mailer-handler-resend.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/mailer/handlers/studio/package.json b/packages/mailer/handlers/studio/package.json index fd455ed98e8a..5054b248e467 100644 --- a/packages/mailer/handlers/studio/package.json +++ b/packages/mailer/handlers/studio/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-mailer-handler-studio.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/mailer/renderers/mjml-react/package.json b/packages/mailer/renderers/mjml-react/package.json index 1e925ee87827..00c28ffd4f87 100644 --- a/packages/mailer/renderers/mjml-react/package.json +++ b/packages/mailer/renderers/mjml-react/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-mailer-renderer-mjml-react.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/mailer/renderers/react-email/package.json b/packages/mailer/renderers/react-email/package.json index 7de498d4ec82..a5a07b4f68cd 100644 --- a/packages/mailer/renderers/react-email/package.json +++ b/packages/mailer/renderers/react-email/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-mailer-renderer-react-email.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build" diff --git a/packages/prerender/package.json b/packages/prerender/package.json index fde818c5b00c..167d8d09b6c4 100644 --- a/packages/prerender/package.json +++ b/packages/prerender/package.json @@ -17,6 +17,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx,.jsx\"", + "build:pack": "yarn pack -o redwoodjs-prerender.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "yarn build", diff --git a/packages/project-config/package.json b/packages/project-config/package.json index 65856bc1630d..20060378e6ce 100644 --- a/packages/project-config/package.json +++ b/packages/project-config/package.json @@ -16,6 +16,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && run build:types", + "build:pack": "yarn pack -o redwoodjs-project-config.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/realtime/package.json b/packages/realtime/package.json index dc009ecbcfc2..00995a680e3f 100644 --- a/packages/realtime/package.json +++ b/packages/realtime/package.json @@ -16,6 +16,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && run build:types", + "build:pack": "yarn pack -o redwoodjs-realtime.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/record/package.json b/packages/record/package.json index 201ab472c9d8..efcc0d5db75e 100644 --- a/packages/record/package.json +++ b/packages/record/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-record.tgz", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "datamodel:parse": "node src/scripts/parse.js", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/router/package.json b/packages/router/package.json index 4775d98a80c9..126c9942b2c3 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-router.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/structure/package.json b/packages/structure/package.json index 58b442055cf4..71a0fc937236 100644 --- a/packages/structure/package.json +++ b/packages/structure/package.json @@ -16,6 +16,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-structure.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/studio/package.json b/packages/studio/package.json index f2da43f9c167..214990568dce 100644 --- a/packages/studio/package.json +++ b/packages/studio/package.json @@ -15,9 +15,10 @@ "scripts": { "build": "yarn build:api && yarn build:web", "build:api": "yarn node ./build.mjs && yarn build:types", - "build:web": "cd web && vite build", + "build:pack": "yarn pack -o redwoodjs-studio.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch api --ext \"js,ts,tsx\" --ignore dist/api --exec \"yarn build\"", + "build:web": "cd web && vite build", "prepublishOnly": "NODE_ENV=production yarn build" }, "dependencies": { @@ -98,7 +99,6 @@ "use-url-search-params": "2.5.1", "vite": "4.5.1" }, - "gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1", "optionalDependencies": { "@swc/core-darwin-arm64": "1.3.60", "@swc/core-darwin-x64": "1.3.60", @@ -110,5 +110,6 @@ "@swc/core-win32-arm64-msvc": "1.3.60", "@swc/core-win32-ia32-msvc": "1.3.60", "@swc/core-win32-x64-msvc": "1.3.60" - } + }, + "gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1" } diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index 8c544ca87134..1a9f3f6fff21 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -15,6 +15,7 @@ "scripts": { "build": "yarn build:js", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-telemetry.tgz", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", "test": "jest src", diff --git a/packages/testing/package.json b/packages/testing/package.json index aa375801cd13..92285d2c7684 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -20,6 +20,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-testing.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext 'js,jsx,ts,tsx' --ignore dist --exec 'yarn build'", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/packages/tui/package.json b/packages/tui/package.json index 5cd2a1ac49d1..315ab8c63da3 100644 --- a/packages/tui/package.json +++ b/packages/tui/package.json @@ -14,6 +14,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-tui.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", @@ -25,7 +26,6 @@ "/dist/" ] }, - "gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1", "dependencies": { "boxen": "5.1.2", "chalk": "4.1.2", @@ -36,5 +36,6 @@ "esbuild": "0.19.9", "jest": "29.7.0", "typescript": "5.3.3" - } + }, + "gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1" } diff --git a/packages/vite/package.json b/packages/vite/package.json index 7ea7b0706361..299200be1d5c 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -8,10 +8,6 @@ "directory": "packages/vite" }, "license": "MIT", - "files": [ - "dist", - "inject" - ], "exports": { "./package.json": "./package.json", ".": { @@ -55,9 +51,14 @@ "rw-vite-dev": "./bins/rw-vite-dev.mjs", "vite": "./bins/vite.mjs" }, + "files": [ + "dist", + "inject" + ], "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-vite.tgz", "build:types": "tsc --build --verbose", "test": "yarn test:node && echo", "test:node": "glob './src/**/__tests__/*.test.mts' --cmd='tsx --no-warnings --test'", diff --git a/packages/web-server/package.json b/packages/web-server/package.json index 94cee769bf84..152c3a59401c 100644 --- a/packages/web-server/package.json +++ b/packages/web-server/package.json @@ -17,6 +17,7 @@ ], "scripts": { "build": "yarn node ./build.mjs && yarn build:types", + "build:pack": "yarn pack -o redwoodjs-web-server.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build && yarn fix:permissions\"", "fix:permissions": "chmod +x dist/index.js; chmod +x dist/watch.js", diff --git a/packages/web/package.json b/packages/web/package.json index d30f782c2a08..a460790bbe9b 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -28,6 +28,7 @@ "scripts": { "build": "yarn build:js && yarn build:types", "build:js": "babel src -d dist --extensions \".js,.jsx,.ts,.tsx\"", + "build:pack": "yarn pack -o redwoodjs-web.tgz", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"", "prepublishOnly": "NODE_ENV=production yarn build", diff --git a/tasks/framework-tools/tarsync.mjs b/tasks/framework-tools/tarsync.mjs new file mode 100644 index 000000000000..c7c76df9c060 --- /dev/null +++ b/tasks/framework-tools/tarsync.mjs @@ -0,0 +1,175 @@ +#!/usr/bin/env node +/* eslint-env node */ + +import { performance } from 'node:perf_hooks' +import { fileURLToPath } from 'node:url' +import { parseArgs as nodeUtilParseArgs } from 'node:util' + +import ora from 'ora' +import { cd, chalk, fs, glob, path, within, $ } from 'zx' + +const mockSpinner = { + text: '', + succeed: () => {}, +} + +async function main() { + let options + + try { + options = await parseArgs() + } catch (e) { + console.error(e.message) + process.exitCode = 1 + return + } + + const { projectPath, verbose } = options + + $.verbose = verbose + + // Closing over `verbose` here. + function getProjectSpinner({ text }) { + return verbose + ? mockSpinner + : ora({ prefixText: `${chalk.green('[ project ]')}`, text }).start() + } + + function getFrameworkSpinner({ text }) { + return verbose + ? mockSpinner + : ora({ prefixText: `${chalk.cyan('[framework]')}`, text }).start() + } + + const frameworkPath = fileURLToPath(new URL('../../', import.meta.url)) + cd(frameworkPath) + performance.mark('startFramework') + + const spinner = getFrameworkSpinner({ text: 'building and packing packages' }) + + await $`yarn nx run-many -t build:pack` + + spinner.text = 'moving tarballs' + + const tarballDestDirname = 'tarballs' + const tarballDest = path.join(projectPath, tarballDestDirname) + await fs.ensureDir(tarballDest) + + const tarballs = await glob(['./packages/**/*.tgz']) + + await Promise.all( + tarballs.map((tarball) => + fs.move(tarball, path.join(tarballDest, path.basename(tarball)), { + overwrite: true, + }) + ) + ) + + spinner.text = 'updating resolutions' + + const resolutions = (await $`yarn workspaces list --json`).stdout + .trim() + .split('\n') + .map(JSON.parse) + // Filter out the root workspace. + .filter(({ name }) => name) + .reduce((resolutions, { name }) => { + return { + ...resolutions, + // Turn a Redwood package name like `@redwoodjs/project-config` into `redwoodjs-project-config.tgz`. + [name]: `./${tarballDestDirname}/${ + name.replace('@', '').replaceAll('/', '-') + '.tgz' + }`, + } + }, {}) + + const projectPackageJsonPath = path.join(projectPath, 'package.json') + const projectPackageJson = await fs.readJSON(projectPackageJsonPath) + + await fs.writeJSON( + projectPackageJsonPath, + { + ...projectPackageJson, + resolutions, + }, + { + spaces: 2, + } + ) + + performance.mark('endFramework') + performance.measure('framework', 'startFramework', 'endFramework') + + const [entry] = performance.getEntriesByName('framework') + + spinner.succeed(`finished in ${(entry.duration / 1000).toFixed(2)} seconds`) + + await within(async () => { + cd(projectPath) + performance.mark('startProject') + + const spinner = getProjectSpinner({ text: 'yarn install' }) + + await $`yarn install` + + performance.mark('endProject') + performance.measure('project', 'startProject', 'endProject') + + const [entry] = performance.getEntriesByName('project') + + spinner.succeed(`finished in ${(entry.duration / 1000).toFixed(2)} seconds`) + }) + + const entries = performance.getEntriesByType('measure').map((entry) => { + return `• ${entry.name} => ${(entry.duration / 1000).toFixed(2)} seconds` + }) + + for (const entry of entries) { + verbose && console.log(entry) + } +} + +main() + +async function parseArgs() { + const { positionals, values } = nodeUtilParseArgs({ + allowPositionals: true, + + options: { + verbose: { + type: 'boolean', + default: false, + short: 'v', + }, + }, + }) + + const [projectPath] = positionals + + const options = { + verbose: values.verbose, + } + + options.projectPath = projectPath ? projectPath : process.env.RWJS_CWD + + if (!options.projectPath) { + throw new Error( + [ + 'Error: You have to provide the path to a Redwood project as', + '', + ' 1. the first positional argument', + '', + chalk.gray(' yarn project:tarsync /path/to/redwood/project'), + '', + ' 2. the `RWJS_CWD` env var', + '', + chalk.gray(' RWJS_CWD=/path/to/redwood/project yarn project:tarsync'), + ].join('\n') + ) + } + + // This makes `projectPath` an absolute path and throws if it doesn't exist. + options.projectPath = await fs.realpath(options.projectPath) + + return options +}