Monorepo Utils: Move postinstall build to local package.json (#37688)
* add warning if package hasn't been built yet * move postinstall script * remove extra build in highlight flow
This commit is contained in:
parent
d62b2995b5
commit
0fda297965
|
@ -22,7 +22,7 @@ jobs:
|
|||
run: |
|
||||
npm install -g pnpm@7
|
||||
npm -g i @wordpress/env@5.1.0
|
||||
pnpm install --filter monorepo-utils --filter code-analyzer --filter cli-core
|
||||
pnpm install --filter code-analyzer --filter cli-core
|
||||
- name: Run analyzer
|
||||
id: run
|
||||
working-directory: tools/code-analyzer
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"test": "pnpm exec turbo run turbo:test",
|
||||
"clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"postinstall": "pnpm git:update-hooks && pnpm run --filter='./tools/monorepo-utils' build",
|
||||
"postinstall": "pnpm git:update-hooks",
|
||||
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && husky install",
|
||||
"create-extension": "node ./tools/create-extension/index.js",
|
||||
"cherry-pick": "node ./tools/cherry-pick/bin/run",
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const { existsSync } = require( 'fs' );
|
||||
const chalk = require( 'chalk' );
|
||||
const path = require( 'path' );
|
||||
|
||||
const nodeModulesDirectory = path.join( __dirname, '../', 'node_modules' );
|
||||
|
||||
if ( ! existsSync( nodeModulesDirectory ) ) {
|
||||
console.log(
|
||||
chalk.red(
|
||||
'The @woocommerce/monorepo-utils must be built before running the CLI.'
|
||||
)
|
||||
);
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
'run `pnpm run build` from the root of the monorepo-utils package. or `pnpm install --filter monorepo-utils` from project root.'
|
||||
)
|
||||
);
|
||||
process.exit( 1 );
|
||||
}
|
||||
|
||||
const { program } = require( '../dist/index' );
|
||||
|
||||
program.parse( process.argv );
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
"build": "tsc",
|
||||
"start": "tsc --watch",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"postinstall": "pnpm run build",
|
||||
"test": "jest"
|
||||
},
|
||||
"engines": {
|
||||
|
|
Loading…
Reference in New Issue