Skip to content

Commit df0c275

Browse files
timostadlabaj
authored andcommitted
fix(build): Support running npm scripts under Windows (patternfly#1251)
* fix(build): Support running npm scripts under Windows * Correctly resolve packages from the public registry * Use shx to successfully run cat command on Windows
1 parent 7ed0596 commit df0c275

File tree

6 files changed

+45
-13
lines changed

6 files changed

+45
-13
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"react": "^16.3.0",
5959
"react-dev-utils": "^5.0.0",
6060
"react-dom": "^16.3.0",
61+
"shx": "^0.3.2",
6162
"travis-deploy-once": "^4.4.1",
6263
"ts-jest": "^23.10.5"
6364
},
@@ -73,10 +74,10 @@
7374
"build:typecheck": "lerna run build:typecheck --scope=@patternfly/react-core --stream",
7475
"build:prdocs": "lerna run pr-build --scope=@patternfly/react-docs --stream",
7576
"clean": "yarn clean:build",
76-
"clean:build": "rm -rf packages/*/dist && rm -rf packages/patternfly-?/*/dist",
77+
"clean:build": "shx rm -rf packages/*/dist && shx rm -rf packages/patternfly-?/*/dist",
7778
"commit": "git-cz",
7879
"commitmsg": "commitlint -e",
79-
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
80+
"coveralls": "shx cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
8081
"generate": "yarn plop",
8182
"lerna": "lerna",
8283
"lerna:publish": "lerna publish --yes",

packages/patternfly-3/patternfly-react-extensions/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"build:babel": "concurrently \"yarn build:babel:cjs\" \"yarn build:babel:esm\"",
3535
"build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js",
3636
"build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm",
37-
"build:less": "mkdir -p dist/less && cp -r less/* dist/less",
38-
"build:sass": "mkdir -p dist/sass && cp -r sass/patternfly-react-extensions/* dist/sass && node-sass --output-style compressed --include-path sass --include-path $npm_package_sassIncludes_patternfly --include-path $npm_package_sassIncludes_bootstrap --include-path $npm_package_sassIncludes_fontAwesome -o dist/css sass/patternfly-react-extensions.scss"
37+
"build:less": "shx mkdir -p dist/less && shx cp -r less/* dist/less",
38+
"build:sass": "shx mkdir -p dist/sass && shx cp -r sass/patternfly-react-extensions/* dist/sass && cross-var node-sass --output-style compressed --include-path sass --include-path $npm_package_sassIncludes_patternfly --include-path $npm_package_sassIncludes_bootstrap --include-path $npm_package_sassIncludes_fontAwesome -o dist/css sass/patternfly-react-extensions.scss"
3939
},
4040
"dependencies": {
4141
"breakjs": "^1.0.0",
@@ -52,5 +52,8 @@
5252
"prop-types": "^15.6.1",
5353
"react": "^16.3.2",
5454
"react-dom": "^16.3.2"
55+
},
56+
"devDependencies": {
57+
"cross-var": "^1.1.0"
5558
}
5659
}

packages/patternfly-3/patternfly-react/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@
6262
"build:babel": "concurrently \"yarn build:babel:cjs\" \"yarn build:babel:esm\"",
6363
"build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js",
6464
"build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm",
65-
"build:less": "mkdir -p dist/less && cp -r less/* dist/less",
66-
"build:sass": "mkdir -p dist/sass && cp -r sass/patternfly-react/* dist/sass && node-sass --output-style compressed --include-path sass --include-path $npm_package_sassIncludes_patternfly --include-path $npm_package_sassIncludes_bootstrap --include-path $npm_package_sassIncludes_fontAwesome -o dist/css sass/patternfly-react.scss"
65+
"build:less": "shx mkdir -p dist/less && shx cp -r less/* dist/less",
66+
"build:sass": "shx mkdir -p dist/sass && shx cp -r sass/patternfly-react/* dist/sass && cross-var node-sass --output-style compressed --include-path sass --include-path $npm_package_sassIncludes_patternfly --include-path $npm_package_sassIncludes_bootstrap --include-path $npm_package_sassIncludes_fontAwesome -o dist/css sass/patternfly-react.scss"
6767
},
6868
"devDependencies": {
69-
"react-axe": "^3.0.2"
69+
"cross-var": "^1.1.0",
70+
"react-axe": "^3.0.2",
71+
"shx": "^0.3.2"
7072
}
7173
}

packages/patternfly-3/react-console/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"build:babel": "concurrently \"yarn build:babel:cjs\" \"yarn build:babel:esm\"",
3535
"build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js",
3636
"build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm",
37-
"build:less": "mkdir -p dist/less && cp -r less/* dist/less",
38-
"build:sass": "mkdir -p dist/sass && cp -r sass/* dist/sass && node-sass --output-style compressed --include-path sass --include-path $npm_package_sassIncludes_patternfly --include-path $npm_package_sassIncludes_bootstrap --include-path $npm_package_sassIncludes_fontAwesome -o dist/css sass/console.scss"
37+
"build:less": "shx mkdir -p dist/less && shx cp -r less/* dist/less",
38+
"build:sass": "shx mkdir -p dist/sass && shx cp -r sass/* dist/sass && cross-var node-sass --output-style compressed --include-path sass --include-path $npm_package_sassIncludes_patternfly --include-path $npm_package_sassIncludes_bootstrap --include-path $npm_package_sassIncludes_fontAwesome -o dist/css sass/console.scss"
3939
},
4040
"dependencies": {
4141
"@novnc/novnc": "^1.0.0",
@@ -45,6 +45,7 @@
4545
"xterm": "^3.3.0"
4646
},
4747
"devDependencies": {
48+
"cross-var": "^1.1.0",
4849
"patternfly": "^3.58.0",
4950
"patternfly-react": "^2.29.8"
5051
},

packages/react-icons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"homepage": "https://github.com/patternfly/patternfly-react#readme",
2626
"scripts": {
2727
"prebuild": "node ./build/generateIcons.js",
28-
"build": "yarn build:babel; yarn build:ts",
28+
"build": "yarn build:babel && yarn build:ts",
2929
"build:babel": "concurrently \"yarn build:babel:cjs\" \"yarn build:babel:esm\"",
3030
"build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js",
3131
"build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm",

yarn.lock

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4380,7 +4380,7 @@ babel-preset-env@^1.6.1:
43804380
invariant "^2.2.2"
43814381
semver "^5.3.0"
43824382

4383-
babel-preset-es2015@^6.9.0:
4383+
babel-preset-es2015@^6.18.0, babel-preset-es2015@^6.9.0:
43844384
version "6.24.1"
43854385
resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"
43864386
dependencies:
@@ -4529,7 +4529,7 @@ babel-preset-react@^6.24.1:
45294529
babel-plugin-transform-react-jsx-source "^6.22.0"
45304530
babel-preset-flow "^6.23.0"
45314531

4532-
babel-preset-stage-0@^6.24.1:
4532+
babel-preset-stage-0@^6.16.0, babel-preset-stage-0@^6.24.1:
45334533
version "6.24.1"
45344534
resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz#5642d15042f91384d7e5af8bc88b1db95b039e6a"
45354535
dependencies:
@@ -4564,7 +4564,7 @@ babel-preset-stage-3@^6.24.1:
45644564
babel-plugin-transform-exponentiation-operator "^6.24.1"
45654565
babel-plugin-transform-object-rest-spread "^6.22.0"
45664566

4567-
babel-register@^6.26.0, babel-register@^6.9.0:
4567+
babel-register@^6.18.0, babel-register@^6.26.0, babel-register@^6.9.0:
45684568
version "6.26.0"
45694569
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"
45704570
dependencies:
@@ -6689,6 +6689,17 @@ cross-spawn@^3.0.0:
66896689
lru-cache "^4.0.1"
66906690
which "^1.2.9"
66916691

6692+
cross-var@^1.1.0:
6693+
version "1.1.0"
6694+
resolved "https://registry.yarnpkg.com/cross-var/-/cross-var-1.1.0.tgz#f0f0d4bb235d95138d1a539842d290f00db71cd6"
6695+
integrity sha1-8PDUuyNdlRONGlOYQtKQ8A23HNY=
6696+
dependencies:
6697+
babel-preset-es2015 "^6.18.0"
6698+
babel-preset-stage-0 "^6.16.0"
6699+
babel-register "^6.18.0"
6700+
cross-spawn "^5.0.1"
6701+
exit "^0.1.2"
6702+
66926703
crypt@~0.0.1:
66936704
version "0.0.2"
66946705
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
@@ -8049,6 +8060,11 @@ es6-map@^0.1.3:
80498060
es6-symbol "~3.1.1"
80508061
event-emitter "~0.3.5"
80518062

8063+
es6-object-assign@^1.0.3:
8064+
version "1.1.0"
8065+
resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c"
8066+
integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=
8067+
80528068
es6-promise@^4.0.3:
80538069
version "4.2.4"
80548070
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
@@ -18277,6 +18293,15 @@ shellwords@^0.1.1:
1827718293
version "0.1.1"
1827818294
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
1827918295

18296+
shx@^0.3.2:
18297+
version "0.3.2"
18298+
resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.2.tgz#40501ce14eb5e0cbcac7ddbd4b325563aad8c123"
18299+
integrity sha512-aS0mWtW3T2sHAenrSrip2XGv39O9dXIFUqxAEWHEOS1ePtGIBavdPJY1kE2IHl14V/4iCbUiNDPGdyYTtmhSoA==
18300+
dependencies:
18301+
es6-object-assign "^1.0.3"
18302+
minimist "^1.2.0"
18303+
shelljs "^0.8.1"
18304+
1828018305
sift@^5.1.0:
1828118306
version "5.1.0"
1828218307
resolved "https://registry.yarnpkg.com/sift/-/sift-5.1.0.tgz#1bbf2dfb0eb71e56c4cc7fb567fbd1351b65015e"

0 commit comments

Comments
 (0)