From 6f6f7ca48847731e753085c0a447408127532124 Mon Sep 17 00:00:00 2001 From: Dominic Saadi <32992335+jtoar@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:23:59 -0800 Subject: [PATCH] Move framework-tools deps to root package.json (#3908) Co-authored-by: Daniel Choudhury --- package.json | 11 +- packages/cli/src/rwfw.js | 5 +- .../{src => }/frameworkDepsToProject.mjs | 3 +- .../{src => }/frameworkFilesToProject.mjs | 1 + .../{src => }/frameworkSyncToProject.mjs | 9 +- .../{src => }/lib/framework.mjs | 21 +- .../framework-tools/{src => }/lib/project.mjs | 11 +- tasks/framework-tools/package.json | 20 - tasks/framework-tools/yarn.lock | 612 ------------------ tasks/run-e2e | 4 +- tasks/test-project/frameworkLinking.js | 4 +- tasks/test-project/util.js | 15 +- yarn.lock | 6 +- 13 files changed, 47 insertions(+), 675 deletions(-) rename tasks/framework-tools/{src => }/frameworkDepsToProject.mjs (95%) rename tasks/framework-tools/{src => }/frameworkFilesToProject.mjs (99%) rename tasks/framework-tools/{src => }/frameworkSyncToProject.mjs (97%) rename tasks/framework-tools/{src => }/lib/framework.mjs (91%) rename tasks/framework-tools/{src => }/lib/project.mjs (95%) delete mode 100644 tasks/framework-tools/package.json delete mode 100644 tasks/framework-tools/yarn.lock diff --git a/package.json b/package.json index e4a0dd9cfd01..405c072cbea2 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,13 @@ "@types/jscodeshift": "0.11.2", "@types/lodash.template": "4", "all-contributors-cli": "6.20.0", + "ansi-colors": "4.1.1", "babel-jest": "27.3.1", "babel-plugin-auto-import": "1.1.0", "babel-plugin-remove-code": "0.0.6", "core-js": "3.20.0", "eslint": "8.4.1", + "fast-glob": "3.2.7", "jest": "27.3.1", "jscodeshift": "0.13.0", "lerna": "4.0.0", @@ -35,7 +37,9 @@ "nodemon": "2.0.15", "npm-packlist": "3.0.0", "octokit": "1.7.1", + "ora": "5.4.1", "rimraf": "3.0.2", + "terminal-link": "2.1.1", "typescript": "4.5.2", "typescript-transform-paths": "3.3.1" }, @@ -51,7 +55,6 @@ "vscode-languageserver-textdocument": "1.0.3" }, "scripts": { - "framework": "yarn ./tasks/framework-tools", "build": "yarn build:js && yarn build:types", "build:js": "lerna run build:js", "build:types": "tsc --build --verbose", @@ -62,11 +65,13 @@ "clean:prisma": "rimraf node_modules/.prisma/client && node node_modules/@prisma/client/scripts/postinstall.js", "lint": "RWJS_CWD=packages/create-redwood-app/template eslint --config .eslintrc.js packages", "lint:fix": "yarn lint --fix", - "postinstall": "yarn framework install", "build:link": "node ./tasks/build-and-copy", "build:test-project": "node ./tasks/test-project/test-project", "release-notes": "node ./tasks/release-notes/release-notes.mjs", - "publish:canary": "lerna publish --force-publish --canary --include-merged-tags --preid canary --dist-tag canary --yes --loglevel verbose" + "publish:canary": "lerna publish --force-publish --canary --include-merged-tags --preid canary --dist-tag canary --yes --loglevel verbose", + "project:deps": "node ./tasks/framework-tools/frameworkDepsToProject.mjs", + "project:copy": "node ./tasks/framework-tools/frameworkFilesToProject.mjs", + "project:sync": "node ./tasks/framework-tools/frameworkSyncToProject.mjs" }, "packageManager": "yarn@3.0.2" } diff --git a/packages/cli/src/rwfw.js b/packages/cli/src/rwfw.js index 616dec5dd269..8ea88fe32e73 100644 --- a/packages/cli/src/rwfw.js +++ b/packages/cli/src/rwfw.js @@ -35,10 +35,9 @@ config.set('RWFW_PATH', absRwFwPath) const projectPath = path.dirname( getConfigPath(process.env.RWJS_CWD ?? process.cwd()) ) -const fwToolsPath = path.join(absRwFwPath, 'tasks/framework-tools') console.log( 'Redwood Framework Tools Path:', - TerminalLink(fwToolsPath, fwToolsPath) + TerminalLink(absRwFwPath, absRwFwPath) ) let command = process.argv.slice(2) @@ -48,7 +47,7 @@ if (!command.length || command.some((cmd) => helpCommands.includes(cmd))) { } try { - execa.sync('yarn', ['--cwd', fwToolsPath, ...command], { + execa.sync('yarn', ['--cwd', absRwFwPath, ...command], { stdio: 'inherit', shell: true, env: { diff --git a/tasks/framework-tools/src/frameworkDepsToProject.mjs b/tasks/framework-tools/frameworkDepsToProject.mjs similarity index 95% rename from tasks/framework-tools/src/frameworkDepsToProject.mjs rename to tasks/framework-tools/frameworkDepsToProject.mjs index 27a0450afcd6..fa399ca324c1 100755 --- a/tasks/framework-tools/src/frameworkDepsToProject.mjs +++ b/tasks/framework-tools/frameworkDepsToProject.mjs @@ -1,11 +1,12 @@ #!/usr/bin/env node /* eslint-env node */ -import path from 'path' +import path from 'node:path' import { addDependenciesToPackageJson } from './lib/project.mjs' const projectPath = process.argv?.[2] ?? process.env.RWJS_CWD + if (!projectPath) { console.log('Error: Please specify the path to your Redwood Project') console.log(`Usage: ${process.argv?.[1]} /path/to/rwjs/proect`) diff --git a/tasks/framework-tools/src/frameworkFilesToProject.mjs b/tasks/framework-tools/frameworkFilesToProject.mjs similarity index 99% rename from tasks/framework-tools/src/frameworkFilesToProject.mjs rename to tasks/framework-tools/frameworkFilesToProject.mjs index fac12264b6ec..a1cd238101c5 100755 --- a/tasks/framework-tools/src/frameworkFilesToProject.mjs +++ b/tasks/framework-tools/frameworkFilesToProject.mjs @@ -4,6 +4,7 @@ import { copyFrameworkFilesToProject } from './lib/project.mjs' const projectPath = process.argv?.[2] ?? process.env.RWJS_CWD + if (!projectPath) { console.log('Error: Please specify the path to your Redwood Project') console.log(`Usage: ${process.argv?.[1]} /path/to/rwjs/proect`) diff --git a/tasks/framework-tools/src/frameworkSyncToProject.mjs b/tasks/framework-tools/frameworkSyncToProject.mjs similarity index 97% rename from tasks/framework-tools/src/frameworkSyncToProject.mjs rename to tasks/framework-tools/frameworkSyncToProject.mjs index e50c5c343473..37cbeb77e833 100644 --- a/tasks/framework-tools/src/frameworkSyncToProject.mjs +++ b/tasks/framework-tools/frameworkSyncToProject.mjs @@ -1,11 +1,10 @@ #!/usr/bin/env node /* eslint-env node */ -import fs from 'fs' -import path from 'path' - import c from 'ansi-colors' import chokidar from 'chokidar' +import fs from 'node:fs' +import path from 'node:path' import { REDWOOD_PACKAGES_PATH, @@ -21,6 +20,7 @@ import { } from './lib/project.mjs' const projectPath = process.argv?.[2] ?? process.env.RWJS_CWD + if (!projectPath) { console.log('Error: Please specify the path to your Redwood Project') console.log(`Usage: ${process.argv?.[1]} /path/to/rwjs/project`) @@ -29,6 +29,7 @@ if (!projectPath) { // Cache the original package.json and restore it when this process exits. const projectPackageJsonPath = path.join(projectPath, 'package.json') + const projectPackageJson = fs.readFileSync(projectPackageJsonPath, 'utf-8') process.on('SIGINT', () => { console.log() @@ -62,7 +63,7 @@ chokidar ['.DS_Store'].some((ext) => file.endsWith(ext)), }) .on('ready', async () => { - logStatus('Building Framework...') + logStatus('Cleaning Framework...') cleanPackages() logStatus('Building Framework...') diff --git a/tasks/framework-tools/src/lib/framework.mjs b/tasks/framework-tools/lib/framework.mjs similarity index 91% rename from tasks/framework-tools/src/lib/framework.mjs rename to tasks/framework-tools/lib/framework.mjs index 05f66def94b7..78e814642c6d 100644 --- a/tasks/framework-tools/src/lib/framework.mjs +++ b/tasks/framework-tools/lib/framework.mjs @@ -1,19 +1,18 @@ /* eslint-env node */ -import fs from 'fs' -import path from 'path' -import { dirname } from 'path' -import { fileURLToPath } from 'url' - import c from 'ansi-colors' import execa from 'execa' import fg from 'fast-glob' +import fs from 'node:fs' +import path from 'node:path' +import url from 'node:url' import packlist from 'npm-packlist' -const __dirname = dirname(fileURLToPath(import.meta.url)) +const __dirname = path.dirname(url.fileURLToPath(import.meta.url)) + export const REDWOOD_PACKAGES_PATH = path.resolve( __dirname, - '../../../../packages' + '../../../packages' ) /** @@ -34,7 +33,7 @@ export function frameworkPkgJsonFiles() { } /** - * The dependencenies used by `@redwoodjs` packages. + * The dependencies used by `@redwoodjs` packages. */ export function frameworkDependencies(packages = frameworkPkgJsonFiles()) { const dependencies = {} @@ -152,7 +151,7 @@ export function cleanPackages(packages = frameworkPkgJsonFiles()) { { shell: true, stdio: 'inherit', - cwd: path.resolve(__dirname, '../../../../'), + cwd: path.resolve(__dirname, '../../../'), } ) } @@ -170,7 +169,7 @@ export function buildPackages(packages = frameworkPkgJsonFiles()) { { shell: true, stdio: 'inherit', - cwd: path.resolve(__dirname, '../../../../'), + cwd: path.resolve(__dirname, '../../../'), } ) @@ -178,7 +177,7 @@ export function buildPackages(packages = frameworkPkgJsonFiles()) { execa.sync('yarn build:types', undefined, { shell: true, stdio: 'inherit', - cwd: path.resolve(__dirname, '../../../../'), + cwd: path.resolve(__dirname, '../../../'), }) } diff --git a/tasks/framework-tools/src/lib/project.mjs b/tasks/framework-tools/lib/project.mjs similarity index 95% rename from tasks/framework-tools/src/lib/project.mjs rename to tasks/framework-tools/lib/project.mjs index c0104b193da0..7d3e596f702e 100644 --- a/tasks/framework-tools/src/lib/project.mjs +++ b/tasks/framework-tools/lib/project.mjs @@ -1,9 +1,8 @@ /* eslint-env node */ -import fs from 'fs' -import path from 'path' - import execa from 'execa' +import fs from 'node:fs' +import path from 'node:path' import ora from 'ora' import rimraf from 'rimraf' import terminalLink from 'terminal-link' @@ -41,7 +40,7 @@ export function fixProjectBinaries(projectPath) { */ export function addDependenciesToPackageJson( packageJsonPath, - dependencenies = frameworkDependencies() + dependencies = frameworkDependencies() ) { if (!fs.existsSync(packageJsonPath)) { console.log( @@ -55,7 +54,7 @@ export function addDependenciesToPackageJson( 'file://' + packageJsonPath ) - const numOfDeps = Object.keys(dependencenies).length + const numOfDeps = Object.keys(dependencies).length const spinner = ora( `Adding ${numOfDeps} framework dependencies to ${packageJsonLink}...` @@ -64,7 +63,7 @@ export function addDependenciesToPackageJson( const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) packageJson.dependencies = { ...(packageJson.dependencies || {}), - ...dependencenies, + ...dependencies, } fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, undefined, 2)) spinner.succeed( diff --git a/tasks/framework-tools/package.json b/tasks/framework-tools/package.json deleted file mode 100644 index 5b57c0b6a5fd..000000000000 --- a/tasks/framework-tools/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "framework", - "description": "", - "version": "0.0.0", - "private": true, - "type": "module", - "devDependencies": { - "ansi-colors": "4.1.1", - "fast-glob": "3.2.7", - "npm-packlist": "3.0.0", - "ora": "5.4.1", - "rimraf": "3.0.2", - "terminal-link": "2.1.1" - }, - "scripts": { - "project:deps": "node ./src/frameworkDepsToProject.mjs", - "project:copy": "node ./src/frameworkFilesToProject.mjs", - "project:sync": "node ./src/frameworkSyncToProject.mjs" - } -} diff --git a/tasks/framework-tools/yarn.lock b/tasks/framework-tools/yarn.lock deleted file mode 100644 index 3ddc22aabe8d..000000000000 --- a/tasks/framework-tools/yarn.lock +++ /dev/null @@ -1,612 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 4 - cacheKey: 8c0 - -"@nodelib/fs.scandir@npm:2.1.5": - version: 2.1.5 - resolution: "@nodelib/fs.scandir@npm:2.1.5" - dependencies: - "@nodelib/fs.stat": 2.0.5 - run-parallel: ^1.1.9 - checksum: 732c3b6d1b1e967440e65f284bd06e5821fedf10a1bea9ed2bb75956ea1f30e08c44d3def9d6a230666574edbaf136f8cfd319c14fd1f87c66e6a44449afb2eb - languageName: node - linkType: hard - -"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": - version: 2.0.5 - resolution: "@nodelib/fs.stat@npm:2.0.5" - checksum: 88dafe5e3e29a388b07264680dc996c17f4bda48d163a9d4f5c1112979f0ce8ec72aa7116122c350b4e7976bc5566dc3ddb579be1ceaacc727872eb4ed93926d - languageName: node - linkType: hard - -"@nodelib/fs.walk@npm:^1.2.3": - version: 1.2.8 - resolution: "@nodelib/fs.walk@npm:1.2.8" - dependencies: - "@nodelib/fs.scandir": 2.1.5 - fastq: ^1.6.0 - checksum: db9de047c3bb9b51f9335a7bb46f4fcfb6829fb628318c12115fbaf7d369bfce71c15b103d1fc3b464812d936220ee9bc1c8f762d032c9f6be9acc99249095b1 - languageName: node - linkType: hard - -"ansi-colors@npm:4.1.1": - version: 4.1.1 - resolution: "ansi-colors@npm:4.1.1" - checksum: 6086ade4336b4250b6b25e144b83e5623bcaf654d3df0c3546ce09c9c5ff999cb6a6f00c87e802d05cf98aef79d92dc76ade2670a2493b8dcb80220bec457838 - languageName: node - linkType: hard - -"ansi-escapes@npm:^4.2.1": - version: 4.3.2 - resolution: "ansi-escapes@npm:4.3.2" - dependencies: - type-fest: ^0.21.3 - checksum: da917be01871525a3dfcf925ae2977bc59e8c513d4423368645634bf5d4ceba5401574eb705c1e92b79f7292af5a656f78c5725a4b0e1cec97c4b413705c1d50 - languageName: node - linkType: hard - -"ansi-regex@npm:^5.0.1": - version: 5.0.1 - resolution: "ansi-regex@npm:5.0.1" - checksum: 9a64bb8627b434ba9327b60c027742e5d17ac69277960d041898596271d992d4d52ba7267a63ca10232e29f6107fc8a835f6ce8d719b88c5f8493f8254813737 - languageName: node - linkType: hard - -"ansi-styles@npm:^4.1.0": - version: 4.3.0 - resolution: "ansi-styles@npm:4.3.0" - dependencies: - color-convert: ^2.0.1 - checksum: 895a23929da416f2bd3de7e9cb4eabd340949328ab85ddd6e484a637d8f6820d485f53933446f5291c3b760cbc488beb8e88573dd0f9c7daf83dccc8fe81b041 - languageName: node - linkType: hard - -"balanced-match@npm:^1.0.0": - version: 1.0.2 - resolution: "balanced-match@npm:1.0.2" - checksum: 9308baf0a7e4838a82bbfd11e01b1cb0f0cf2893bc1676c27c2a8c0e70cbae1c59120c3268517a8ae7fb6376b4639ef81ca22582611dbee4ed28df945134aaee - languageName: node - linkType: hard - -"base64-js@npm:^1.3.1": - version: 1.5.1 - resolution: "base64-js@npm:1.5.1" - checksum: f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf - languageName: node - linkType: hard - -"bl@npm:^4.1.0": - version: 4.1.0 - resolution: "bl@npm:4.1.0" - dependencies: - buffer: ^5.5.0 - inherits: ^2.0.4 - readable-stream: ^3.4.0 - checksum: 02847e1d2cb089c9dc6958add42e3cdeaf07d13f575973963335ac0fdece563a50ac770ac4c8fa06492d2dd276f6cc3b7f08c7cd9c7a7ad0f8d388b2a28def5f - languageName: node - linkType: hard - -"brace-expansion@npm:^1.1.7": - version: 1.1.11 - resolution: "brace-expansion@npm:1.1.11" - dependencies: - balanced-match: ^1.0.0 - concat-map: 0.0.1 - checksum: 695a56cd058096a7cb71fb09d9d6a7070113c7be516699ed361317aca2ec169f618e28b8af352e02ab4233fb54eb0168460a40dc320bab0034b36ab59aaad668 - languageName: node - linkType: hard - -"braces@npm:^3.0.1": - version: 3.0.2 - resolution: "braces@npm:3.0.2" - dependencies: - fill-range: ^7.0.1 - checksum: 321b4d675791479293264019156ca322163f02dc06e3c4cab33bb15cd43d80b51efef69b0930cfde3acd63d126ebca24cd0544fa6f261e093a0fb41ab9dda381 - languageName: node - linkType: hard - -"buffer@npm:^5.5.0": - version: 5.7.1 - resolution: "buffer@npm:5.7.1" - dependencies: - base64-js: ^1.3.1 - ieee754: ^1.1.13 - checksum: 27cac81cff434ed2876058d72e7c4789d11ff1120ef32c9de48f59eab58179b66710c488987d295ae89a228f835fc66d088652dffeb8e3ba8659f80eb091d55e - languageName: node - linkType: hard - -"chalk@npm:^4.1.0": - version: 4.1.2 - resolution: "chalk@npm:4.1.2" - dependencies: - ansi-styles: ^4.1.0 - supports-color: ^7.1.0 - checksum: 4a3fef5cc34975c898ffe77141450f679721df9dde00f6c304353fa9c8b571929123b26a0e4617bde5018977eb655b31970c297b91b63ee83bb82aeb04666880 - languageName: node - linkType: hard - -"cli-cursor@npm:^3.1.0": - version: 3.1.0 - resolution: "cli-cursor@npm:3.1.0" - dependencies: - restore-cursor: ^3.1.0 - checksum: 92a2f98ff9037d09be3dfe1f0d749664797fb674bf388375a2207a1203b69d41847abf16434203e0089212479e47a358b13a0222ab9fccfe8e2644a7ccebd111 - languageName: node - linkType: hard - -"cli-spinners@npm:^2.5.0": - version: 2.6.1 - resolution: "cli-spinners@npm:2.6.1" - checksum: 6abcdfef59aa68e6b51376d87d257f9120a0a7120a39dd21633702d24797decb6dc747dff2217c88732710db892b5053c5c672d221b6c4d13bbcb5372e203596 - languageName: node - linkType: hard - -"clone@npm:^1.0.2": - version: 1.0.4 - resolution: "clone@npm:1.0.4" - checksum: 2176952b3649293473999a95d7bebfc9dc96410f6cbd3d2595cf12fd401f63a4bf41a7adbfd3ab2ff09ed60cb9870c58c6acdd18b87767366fabfc163700f13b - languageName: node - linkType: hard - -"color-convert@npm:^2.0.1": - version: 2.0.1 - resolution: "color-convert@npm:2.0.1" - dependencies: - color-name: ~1.1.4 - checksum: 37e1150172f2e311fe1b2df62c6293a342ee7380da7b9cfdba67ea539909afbd74da27033208d01d6d5cfc65ee7868a22e18d7e7648e004425441c0f8a15a7d7 - languageName: node - linkType: hard - -"color-name@npm:~1.1.4": - version: 1.1.4 - resolution: "color-name@npm:1.1.4" - checksum: a1a3f914156960902f46f7f56bc62effc6c94e84b2cae157a526b1c1f74b677a47ec602bf68a61abfa2b42d15b7c5651c6dbe72a43af720bc588dff885b10f95 - languageName: node - linkType: hard - -"concat-map@npm:0.0.1": - version: 0.0.1 - resolution: "concat-map@npm:0.0.1" - checksum: c996b1cfdf95b6c90fee4dae37e332c8b6eb7d106430c17d538034c0ad9a1630cb194d2ab37293b1bdd4d779494beee7786d586a50bd9376fd6f7bcc2bd4c98f - languageName: node - linkType: hard - -"defaults@npm:^1.0.3": - version: 1.0.3 - resolution: "defaults@npm:1.0.3" - dependencies: - clone: ^1.0.2 - checksum: c9ba6718eb293fa701652e28967b87102fc13d8e33997748191ad8ed3b2235714bd3661e8505bed06994e6b4604a1281c35462ec328c2bbedd79ebbf7e82adb2 - languageName: node - linkType: hard - -"fast-glob@npm:3.2.7": - version: 3.2.7 - resolution: "fast-glob@npm:3.2.7" - dependencies: - "@nodelib/fs.stat": ^2.0.2 - "@nodelib/fs.walk": ^1.2.3 - glob-parent: ^5.1.2 - merge2: ^1.3.0 - micromatch: ^4.0.4 - checksum: cc820a9acbd99c51267d525ed3c0c368b57d273f8d34e2401eef824390ff38ff419af3c0308d4ec1aef3dae0e24d1ac1dfe3156e5c702d63416a4c877ab7e0c4 - languageName: node - linkType: hard - -"fastq@npm:^1.6.0": - version: 1.13.0 - resolution: "fastq@npm:1.13.0" - dependencies: - reusify: ^1.0.4 - checksum: 76c7b5dafb93c7e74359a3e6de834ce7a7c2e3a3184050ed4cb652661de55cf8d4895178d8d3ccd23069395056c7bb15450660d38fb382ca88c142b22694d7c9 - languageName: node - linkType: hard - -"fill-range@npm:^7.0.1": - version: 7.0.1 - resolution: "fill-range@npm:7.0.1" - dependencies: - to-regex-range: ^5.0.1 - checksum: 7cdad7d426ffbaadf45aeb5d15ec675bbd77f7597ad5399e3d2766987ed20bda24d5fac64b3ee79d93276f5865608bb22344a26b9b1ae6c4d00bd94bf611623f - languageName: node - linkType: hard - -"framework@workspace:.": - version: 0.0.0-use.local - resolution: "framework@workspace:." - dependencies: - ansi-colors: 4.1.1 - fast-glob: 3.2.7 - npm-packlist: 3.0.0 - ora: 5.4.1 - rimraf: 3.0.2 - terminal-link: 2.1.1 - languageName: unknown - linkType: soft - -"fs.realpath@npm:^1.0.0": - version: 1.0.0 - resolution: "fs.realpath@npm:1.0.0" - checksum: 444cf1291d997165dfd4c0d58b69f0e4782bfd9149fd72faa4fe299e68e0e93d6db941660b37dd29153bf7186672ececa3b50b7e7249477b03fdf850f287c948 - languageName: node - linkType: hard - -"glob-parent@npm:^5.1.2": - version: 5.1.2 - resolution: "glob-parent@npm:5.1.2" - dependencies: - is-glob: ^4.0.1 - checksum: cab87638e2112bee3f839ef5f6e0765057163d39c66be8ec1602f3823da4692297ad4e972de876ea17c44d652978638d2fd583c6713d0eb6591706825020c9ee - languageName: node - linkType: hard - -"glob@npm:^7.1.3, glob@npm:^7.1.6": - version: 7.2.0 - resolution: "glob@npm:7.2.0" - dependencies: - fs.realpath: ^1.0.0 - inflight: ^1.0.4 - inherits: 2 - minimatch: ^3.0.4 - once: ^1.3.0 - path-is-absolute: ^1.0.0 - checksum: 478b40e38be5a3d514e64950e1e07e0ac120585add6a37c98d0ed24d72d9127d734d2a125786073c8deb687096e84ae82b641c441a869ada3a9cc91b68978632 - languageName: node - linkType: hard - -"has-flag@npm:^4.0.0": - version: 4.0.0 - resolution: "has-flag@npm:4.0.0" - checksum: 2e789c61b7888d66993e14e8331449e525ef42aac53c627cc53d1c3334e768bcb6abdc4f5f0de1478a25beec6f0bd62c7549058b7ac53e924040d4f301f02fd1 - languageName: node - linkType: hard - -"ieee754@npm:^1.1.13": - version: 1.2.1 - resolution: "ieee754@npm:1.2.1" - checksum: b0782ef5e0935b9f12883a2e2aa37baa75da6e66ce6515c168697b42160807d9330de9a32ec1ed73149aea02e0d822e572bca6f1e22bdcbd2149e13b050b17bb - languageName: node - linkType: hard - -"ignore-walk@npm:^4.0.1": - version: 4.0.1 - resolution: "ignore-walk@npm:4.0.1" - dependencies: - minimatch: ^3.0.4 - checksum: bda7e6a8fd6eeab83e41bff9e9582f30225bff64e1a58063888f24c8e788d599d937be688afa0190665b9ffb33c071163d622fe4a2798d82dcb388e1de59889c - languageName: node - linkType: hard - -"inflight@npm:^1.0.4": - version: 1.0.6 - resolution: "inflight@npm:1.0.6" - dependencies: - once: ^1.3.0 - wrappy: 1 - checksum: 7faca22584600a9dc5b9fca2cd5feb7135ac8c935449837b315676b4c90aa4f391ec4f42240178244b5a34e8bede1948627fda392ca3191522fc46b34e985ab2 - languageName: node - linkType: hard - -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4": - version: 2.0.4 - resolution: "inherits@npm:2.0.4" - checksum: 4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 - languageName: node - linkType: hard - -"is-extglob@npm:^2.1.1": - version: 2.1.1 - resolution: "is-extglob@npm:2.1.1" - checksum: 5487da35691fbc339700bbb2730430b07777a3c21b9ebaecb3072512dfd7b4ba78ac2381a87e8d78d20ea08affb3f1971b4af629173a6bf435ff8a4c47747912 - languageName: node - linkType: hard - -"is-glob@npm:^4.0.1": - version: 4.0.3 - resolution: "is-glob@npm:4.0.3" - dependencies: - is-extglob: ^2.1.1 - checksum: 17fb4014e22be3bbecea9b2e3a76e9e34ff645466be702f1693e8f1ee1adac84710d0be0bd9f967d6354036fd51ab7c2741d954d6e91dae6bb69714de92c197a - languageName: node - linkType: hard - -"is-interactive@npm:^1.0.0": - version: 1.0.0 - resolution: "is-interactive@npm:1.0.0" - checksum: dd47904dbf286cd20aa58c5192161be1a67138485b9836d5a70433b21a45442e9611b8498b8ab1f839fc962c7620667a50535fdfb4a6bc7989b8858645c06b4d - languageName: node - linkType: hard - -"is-number@npm:^7.0.0": - version: 7.0.0 - resolution: "is-number@npm:7.0.0" - checksum: b4686d0d3053146095ccd45346461bc8e53b80aeb7671cc52a4de02dbbf7dc0d1d2a986e2fe4ae206984b4d34ef37e8b795ebc4f4295c978373e6575e295d811 - languageName: node - linkType: hard - -"is-unicode-supported@npm:^0.1.0": - version: 0.1.0 - resolution: "is-unicode-supported@npm:0.1.0" - checksum: 00cbe3455c3756be68d2542c416cab888aebd5012781d6819749fefb15162ff23e38501fe681b3d751c73e8ff561ac09a5293eba6f58fdf0178462ce6dcb3453 - languageName: node - linkType: hard - -"log-symbols@npm:^4.1.0": - version: 4.1.0 - resolution: "log-symbols@npm:4.1.0" - dependencies: - chalk: ^4.1.0 - is-unicode-supported: ^0.1.0 - checksum: 67f445a9ffa76db1989d0fa98586e5bc2fd5247260dafb8ad93d9f0ccd5896d53fb830b0e54dade5ad838b9de2006c826831a3c528913093af20dff8bd24aca6 - languageName: node - linkType: hard - -"merge2@npm:^1.3.0": - version: 1.4.1 - resolution: "merge2@npm:1.4.1" - checksum: 254a8a4605b58f450308fc474c82ac9a094848081bf4c06778200207820e5193726dc563a0d2c16468810516a5c97d9d3ea0ca6585d23c58ccfff2403e8dbbeb - languageName: node - linkType: hard - -"micromatch@npm:^4.0.4": - version: 4.0.4 - resolution: "micromatch@npm:4.0.4" - dependencies: - braces: ^3.0.1 - picomatch: ^2.2.3 - checksum: 87bc95e3e52ebe413dbadd43c96e797c736bf238f154e3b546859493e83781b6f7fa4dfa54e423034fb9aeea65259ee6480551581271c348d8e19214910a5a64 - languageName: node - linkType: hard - -"mimic-fn@npm:^2.1.0": - version: 2.1.0 - resolution: "mimic-fn@npm:2.1.0" - checksum: b26f5479d7ec6cc2bce275a08f146cf78f5e7b661b18114e2506dd91ec7ec47e7a25bf4360e5438094db0560bcc868079fb3b1fb3892b833c1ecbf63f80c95a4 - languageName: node - linkType: hard - -"minimatch@npm:^3.0.4": - version: 3.0.4 - resolution: "minimatch@npm:3.0.4" - dependencies: - brace-expansion: ^1.1.7 - checksum: d0a2bcd93ebec08a9eef3ca83ba33c9fb6feb93932e0b4dc6aa46c5f37a9404bea7ad9ff7cafe23ce6634f1fe3b206f5315ecbb05812da6e692c21d8ecfd3dae - languageName: node - linkType: hard - -"npm-bundled@npm:^1.1.1": - version: 1.1.2 - resolution: "npm-bundled@npm:1.1.2" - dependencies: - npm-normalize-package-bin: ^1.0.1 - checksum: 3f2337789afc8cb608a0dd71cefe459531053d48a5497db14b07b985c4cab15afcae88600db9f92eae072c89b982eeeec8e4463e1d77bc03a7e90f5dacf29769 - languageName: node - linkType: hard - -"npm-normalize-package-bin@npm:^1.0.1": - version: 1.0.1 - resolution: "npm-normalize-package-bin@npm:1.0.1" - checksum: b0c8c05fe419a122e0ff970ccbe7874ae24b4b4b08941a24d18097fe6e1f4b93e3f6abfb5512f9c5488827a5592f2fb3ce2431c41d338802aed24b9a0c160551 - languageName: node - linkType: hard - -"npm-packlist@npm:3.0.0": - version: 3.0.0 - resolution: "npm-packlist@npm:3.0.0" - dependencies: - glob: ^7.1.6 - ignore-walk: ^4.0.1 - npm-bundled: ^1.1.1 - npm-normalize-package-bin: ^1.0.1 - bin: - npm-packlist: bin/index.js - checksum: 88d6c56beee05d0541314813959ea52250f5e9d44cc79854a066d955b204a2c838c66f39f0819f60dd233f8ecb8f10d59ca6bf39464c2f02ecba9de9af128099 - languageName: node - linkType: hard - -"once@npm:^1.3.0": - version: 1.4.0 - resolution: "once@npm:1.4.0" - dependencies: - wrappy: 1 - checksum: 5d48aca287dfefabd756621c5dfce5c91a549a93e9fdb7b8246bc4c4790aa2ec17b34a260530474635147aeb631a2dcc8b32c613df0675f96041cbb8244517d0 - languageName: node - linkType: hard - -"onetime@npm:^5.1.0": - version: 5.1.2 - resolution: "onetime@npm:5.1.2" - dependencies: - mimic-fn: ^2.1.0 - checksum: ffcef6fbb2692c3c40749f31ea2e22677a876daea92959b8a80b521d95cca7a668c884d8b2045d1d8ee7d56796aa405c405462af112a1477594cc63531baeb8f - languageName: node - linkType: hard - -"ora@npm:5.4.1": - version: 5.4.1 - resolution: "ora@npm:5.4.1" - dependencies: - bl: ^4.1.0 - chalk: ^4.1.0 - cli-cursor: ^3.1.0 - cli-spinners: ^2.5.0 - is-interactive: ^1.0.0 - is-unicode-supported: ^0.1.0 - log-symbols: ^4.1.0 - strip-ansi: ^6.0.0 - wcwidth: ^1.0.1 - checksum: 10ff14aace236d0e2f044193362b22edce4784add08b779eccc8f8ef97195cae1248db8ec1ec5f5ff076f91acbe573f5f42a98c19b78dba8c54eefff983cae85 - languageName: node - linkType: hard - -"path-is-absolute@npm:^1.0.0": - version: 1.0.1 - resolution: "path-is-absolute@npm:1.0.1" - checksum: 127da03c82172a2a50099cddbf02510c1791fc2cc5f7713ddb613a56838db1e8168b121a920079d052e0936c23005562059756d653b7c544c53185efe53be078 - languageName: node - linkType: hard - -"picomatch@npm:^2.2.3": - version: 2.3.0 - resolution: "picomatch@npm:2.3.0" - checksum: a65bde78212368e16afb82429a0ea033d20a836270446acb53ec6e31d939bccf1213f788bc49361f7aff47b67c1fb74d898f99964f67f26ca07a3cd815ddbcbb - languageName: node - linkType: hard - -"queue-microtask@npm:^1.2.2": - version: 1.2.3 - resolution: "queue-microtask@npm:1.2.3" - checksum: 900a93d3cdae3acd7d16f642c29a642aea32c2026446151f0778c62ac089d4b8e6c986811076e1ae180a694cedf077d453a11b58ff0a865629a4f82ab558e102 - languageName: node - linkType: hard - -"readable-stream@npm:^3.4.0": - version: 3.6.0 - resolution: "readable-stream@npm:3.6.0" - dependencies: - inherits: ^2.0.3 - string_decoder: ^1.1.1 - util-deprecate: ^1.0.1 - checksum: 937bedd29ac8a68331666291922bea892fa2be1a33269e582de9f844a2002f146cf831e39cd49fe6a378d3f0c27358f259ed0e20d20f0bdc6a3f8fc21fce42dc - languageName: node - linkType: hard - -"restore-cursor@npm:^3.1.0": - version: 3.1.0 - resolution: "restore-cursor@npm:3.1.0" - dependencies: - onetime: ^5.1.0 - signal-exit: ^3.0.2 - checksum: 8051a371d6aa67ff21625fa94e2357bd81ffdc96267f3fb0fc4aaf4534028343836548ef34c240ffa8c25b280ca35eb36be00b3cb2133fa4f51896d7e73c6b4f - languageName: node - linkType: hard - -"reusify@npm:^1.0.4": - version: 1.0.4 - resolution: "reusify@npm:1.0.4" - checksum: c19ef26e4e188f408922c46f7ff480d38e8dfc55d448310dfb518736b23ed2c4f547fb64a6ed5bdba92cd7e7ddc889d36ff78f794816d5e71498d645ef476107 - languageName: node - linkType: hard - -"rimraf@npm:3.0.2": - version: 3.0.2 - resolution: "rimraf@npm:3.0.2" - dependencies: - glob: ^7.1.3 - bin: - rimraf: bin.js - checksum: 9cb7757acb489bd83757ba1a274ab545eafd75598a9d817e0c3f8b164238dd90eba50d6b848bd4dcc5f3040912e882dc7ba71653e35af660d77b25c381d402e8 - languageName: node - linkType: hard - -"run-parallel@npm:^1.1.9": - version: 1.2.0 - resolution: "run-parallel@npm:1.2.0" - dependencies: - queue-microtask: ^1.2.2 - checksum: 200b5ab25b5b8b7113f9901bfe3afc347e19bb7475b267d55ad0eb86a62a46d77510cb0f232507c9e5d497ebda569a08a9867d0d14f57a82ad5564d991588b39 - languageName: node - linkType: hard - -"safe-buffer@npm:~5.2.0": - version: 5.2.1 - resolution: "safe-buffer@npm:5.2.1" - checksum: 6501914237c0a86e9675d4e51d89ca3c21ffd6a31642efeba25ad65720bce6921c9e7e974e5be91a786b25aa058b5303285d3c15dbabf983a919f5f630d349f3 - languageName: node - linkType: hard - -"signal-exit@npm:^3.0.2": - version: 3.0.5 - resolution: "signal-exit@npm:3.0.5" - checksum: 196edc741ff77e19aa80086b608ef15156ad46c927d4039a6e66d034743ab814f541d125f898861a02cfc028825d5597d5db5c45c57f8a80f3de5d186c5a0d14 - languageName: node - linkType: hard - -"string_decoder@npm:^1.1.1": - version: 1.3.0 - resolution: "string_decoder@npm:1.3.0" - dependencies: - safe-buffer: ~5.2.0 - checksum: 810614ddb030e271cd591935dcd5956b2410dd079d64ff92a1844d6b7588bf992b3e1b69b0f4d34a3e06e0bd73046ac646b5264c1987b20d0601f81ef35d731d - languageName: node - linkType: hard - -"strip-ansi@npm:^6.0.0": - version: 6.0.1 - resolution: "strip-ansi@npm:6.0.1" - dependencies: - ansi-regex: ^5.0.1 - checksum: 1ae5f212a126fe5b167707f716942490e3933085a5ff6c008ab97ab2f272c8025d3aa218b7bd6ab25729ca20cc81cddb252102f8751e13482a5199e873680952 - languageName: node - linkType: hard - -"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": - version: 7.2.0 - resolution: "supports-color@npm:7.2.0" - dependencies: - has-flag: ^4.0.0 - checksum: afb4c88521b8b136b5f5f95160c98dee7243dc79d5432db7efc27efb219385bbc7d9427398e43dd6cc730a0f87d5085ce1652af7efbe391327bc0a7d0f7fc124 - languageName: node - linkType: hard - -"supports-hyperlinks@npm:^2.0.0": - version: 2.2.0 - resolution: "supports-hyperlinks@npm:2.2.0" - dependencies: - has-flag: ^4.0.0 - supports-color: ^7.0.0 - checksum: 022677b8891c75bfdab99cf471248ddc823c666c6d5811fbee1257d502cdfb0047c5a3b3fd34854da7b688716af921470abdeabbe80fb035ae1157f457134b48 - languageName: node - linkType: hard - -"terminal-link@npm:2.1.1": - version: 2.1.1 - resolution: "terminal-link@npm:2.1.1" - dependencies: - ansi-escapes: ^4.2.1 - supports-hyperlinks: ^2.0.0 - checksum: 947458a5cd5408d2ffcdb14aee50bec8fb5022ae683b896b2f08ed6db7b2e7d42780d5c8b51e930e9c322bd7c7a517f4fa7c76983d0873c83245885ac5ee13e3 - languageName: node - linkType: hard - -"to-regex-range@npm:^5.0.1": - version: 5.0.1 - resolution: "to-regex-range@npm:5.0.1" - dependencies: - is-number: ^7.0.0 - checksum: 487988b0a19c654ff3e1961b87f471702e708fa8a8dd02a298ef16da7206692e8552a0250e8b3e8759270f62e9d8314616f6da274734d3b558b1fc7b7724e892 - languageName: node - linkType: hard - -"type-fest@npm:^0.21.3": - version: 0.21.3 - resolution: "type-fest@npm:0.21.3" - checksum: 902bd57bfa30d51d4779b641c2bc403cdf1371fb9c91d3c058b0133694fcfdb817aef07a47f40faf79039eecbaa39ee9d3c532deff244f3a19ce68cea71a61e8 - languageName: node - linkType: hard - -"util-deprecate@npm:^1.0.1": - version: 1.0.2 - resolution: "util-deprecate@npm:1.0.2" - checksum: 41a5bdd214df2f6c3ecf8622745e4a366c4adced864bc3c833739791aeeeb1838119af7daed4ba36428114b5c67dcda034a79c882e97e43c03e66a4dd7389942 - languageName: node - linkType: hard - -"wcwidth@npm:^1.0.1": - version: 1.0.1 - resolution: "wcwidth@npm:1.0.1" - dependencies: - defaults: ^1.0.3 - checksum: 5b61ca583a95e2dd85d7078400190efd452e05751a64accb8c06ce4db65d7e0b0cde9917d705e826a2e05cc2548f61efde115ffa374c3e436d04be45c889e5b4 - languageName: node - linkType: hard - -"wrappy@npm:1": - version: 1.0.2 - resolution: "wrappy@npm:1.0.2" - checksum: 56fece1a4018c6a6c8e28fbc88c87e0fbf4ea8fd64fc6c63b18f4acc4bd13e0ad2515189786dd2c30d3eec9663d70f4ecf699330002f8ccb547e4a18231fc9f0 - languageName: node - linkType: hard diff --git a/tasks/run-e2e b/tasks/run-e2e index 244246681a0f..5beb0d3144d4 100755 --- a/tasks/run-e2e +++ b/tasks/run-e2e @@ -56,7 +56,7 @@ const createRedwoodJSApp = () => { const addFrameworkDepsToProject = () => { try { - execa.sync('yarn framework project:deps', { + execa.sync('yarn project:deps', { cwd: REDWOODJS_FRAMEWORK_PATH, shell: true, stdio: 'inherit', @@ -76,7 +76,7 @@ const addFrameworkDepsToProject = () => { const copyFrameworkPackages = () => { try { - execa.sync('yarn framework project:copy', { + execa.sync('yarn project:copy', { cwd: REDWOODJS_FRAMEWORK_PATH, shell: true, stdio: 'inherit', diff --git a/tasks/test-project/frameworkLinking.js b/tasks/test-project/frameworkLinking.js index 1ab39da0fd19..7ace649bd1ea 100644 --- a/tasks/test-project/frameworkLinking.js +++ b/tasks/test-project/frameworkLinking.js @@ -2,7 +2,7 @@ const execa = require('execa') const addFrameworkDepsToProject = (frameworkPath, projectPath) => { - return execa('yarn framework project:deps', { + return execa('yarn project:deps', { cwd: frameworkPath, shell: true, stdio: 'inherit', @@ -14,7 +14,7 @@ const addFrameworkDepsToProject = (frameworkPath, projectPath) => { } const copyFrameworkPackages = (frameworkPath, projectPath) => { - return execa('yarn framework project:copy', { + return execa('yarn project:copy', { cwd: frameworkPath, shell: true, stdio: 'inherit', diff --git a/tasks/test-project/util.js b/tasks/test-project/util.js index fe79d29b1c5e..b3a76654b086 100644 --- a/tasks/test-project/util.js +++ b/tasks/test-project/util.js @@ -4,15 +4,6 @@ const path = require('path') const execa = require('execa') -// Similar to codemods package, but subtly different in where the binary is resolved -const getCommand = () => { - if (process.platform === 'win32') { - return 'yarn jscodeshift' - } else { - return 'node node_modules/.bin/jscodeshift' - } -} - async function applyCodemod(codemod, target) { const args = [ '--fail-on-error', @@ -24,7 +15,11 @@ async function applyCodemod(codemod, target) { args.push() - await execa(getCommand(), args, getExecaOptions(path.resolve(__dirname))) + await execa( + 'yarn jscodeshift', + args, + getExecaOptions(path.resolve(__dirname)) + ) } /** @type {(string) => import('execa').Options} */ diff --git a/yarn.lock b/yarn.lock index 064bd0f5f7b6..ce67171f8d7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22024,7 +22024,7 @@ fsevents@^1.2.7: languageName: node linkType: hard -"ora@npm:^5.4.1": +"ora@npm:5.4.1, ora@npm:^5.4.1": version: 5.4.1 resolution: "ora@npm:5.4.1" dependencies: @@ -25133,11 +25133,13 @@ resolve@^2.0.0-next.3: "@types/jscodeshift": 0.11.2 "@types/lodash.template": 4 all-contributors-cli: 6.20.0 + ansi-colors: 4.1.1 babel-jest: 27.3.1 babel-plugin-auto-import: 1.1.0 babel-plugin-remove-code: 0.0.6 core-js: 3.20.0 eslint: 8.4.1 + fast-glob: 3.2.7 jest: 27.3.1 jscodeshift: 0.13.0 lerna: 4.0.0 @@ -25145,7 +25147,9 @@ resolve@^2.0.0-next.3: nodemon: 2.0.15 npm-packlist: 3.0.0 octokit: 1.7.1 + ora: 5.4.1 rimraf: 3.0.2 + terminal-link: 2.1.1 typescript: 4.5.2 typescript-transform-paths: 3.3.1 languageName: unknown