fix: windows build (#20854)

* fix: update icons build to work on windows

* Add rimraf

* Update scripts

* Update script

* Update scripts

* Fix windows migration

* Update postinstall script

* Remove script
This commit is contained in:
Alejandro Estrada
2022-04-04 11:12:08 -05:00
committed by GitHub
parent 404447e397
commit e6cbc5ae1e
16 changed files with 70 additions and 44 deletions

View File

@@ -61,8 +61,8 @@ export async function makePackage () {
scripts: {
'build-prod': 'tsc || echo \'built, with errors\'',
'check-ts': 'tsc --noEmit',
'clean-deps': 'rm -rf node_modules',
'clean': 'rm -f ./src/*.js ./src/**/*.js ./src/**/**/*.js ./test/**/*.js || echo \'cleaned\'',
'clean-deps': 'rimraf node_modules',
'clean': 'rimraf ./src/*.js ./src/**/*.js ./src/**/**/*.js ./test/**/*.js || echo \'cleaned\'',
...(results.scaffoldTests ? {
'test-unit': 'mocha -r @packages/ts/register test/unit/**/*.spec.ts --config ./test/.mocharc.js --exit',
'test-integration': 'mocha -r @packages/ts/register test/integration/**/*.spec.ts --config ./test/.mocharc.js --exit',
@@ -71,10 +71,12 @@ export async function makePackage () {
files: ['src'],
dependencies: {},
devDependencies: results.scaffoldTests ? {
'rimraf': '3.0.2',
'mocha': '7.0.1',
'chai': '4.2.0',
'@packages/ts': '0.0.0-development',
} : {
'rimraf': '3.0.2',
'@packages/ts': '0.0.0-development',
},
},

View File

@@ -1,6 +0,0 @@
#!/bin/bash
# If we're in CI, exit early
if [[ $CI ]]; then exit 0; fi
# otherwise, run the supplied command
"${@:1}"

View File

@@ -0,0 +1,12 @@
const { execSync } = require('child_process')
const executionEnv = process.env.CI ? 'ci' : 'local'
const postInstallCommands = {
local: 'patch-package && yarn-deduplicate --strategy=highest && yarn clean && gulp postinstall && yarn build',
ci: 'patch-package && yarn clean && gulp postinstall',
}
execSync(postInstallCommands[executionEnv], {
stdio: 'inherit',
})