Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows vs linux/mac specific postinstall commands #1394

Merged
merged 12 commits into from
Mar 5, 2021
12 changes: 12 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- dependency-cache-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- dependency-cache-
- run: mkdir ~/.npm-global
- run: npm config set prefix '~/.npm-global'
- run: export PATH=~/.npm-global/bin:$PATH
- run: yarn install --pure-lockfile
- save_cache:
key: dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
Expand Down Expand Up @@ -53,6 +56,9 @@ jobs:
- run: cd ..
- restore_cache:
key: dependency-cache-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: mkdir ~/.npm-global
- run: npm config set prefix '~/.npm-global'
- run: export PATH=~/.npm-global/bin:$PATH
- run: yarn install --pure-lockfile
- run:
name: Install JUnit coverage reporter
Expand All @@ -74,6 +80,9 @@ jobs:
- checkout
- restore_cache:
key: dependency-cache-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: mkdir ~/.npm-global
- run: npm config set prefix '~/.npm-global'
- run: export PATH=~/.npm-global/bin:$PATH
- run: yarn install --pure-lockfile
- run:
name: Rebuild node-sass
Expand All @@ -93,6 +102,9 @@ jobs:
- checkout
- restore_cache:
key: dependency-cache-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: mkdir ~/.npm-global
- run: npm config set prefix '~/.npm-global'
- run: export PATH=~/.npm-global/bin:$PATH
- run:
name: Build server
command: mkdir server && cp package.json src/server.js src/saml2-config.js src/routes.js server/
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "talentmap",
"version": "5.0.0",
"version": "4.1.0",
"private": true,
"dependencies": {
"@babel/core": "^7.12.13",
Expand Down Expand Up @@ -116,6 +116,7 @@
"bundlesize": "^0.18.1",
"case-sensitive-paths-webpack-plugin": "^2.3.0",
"chalk": "2.4.2",
"cross-os": "^1.4.0",
"css-loader": "^3.6.0",
"dotenv": "4.0.0",
"enzyme": "^3.11.0",
Expand Down Expand Up @@ -182,7 +183,14 @@
"analyze:scss": "codeclimate analyze -e scss-lint -f html > codeclimate.html",
"stats": "NODE_ENV=production webpack --json --config ./config/webpack.config.prod.js > stats.json",
"bundlesize": "bundlesize",
"postinstall": "test -n \"$NOYARNPOSTINSTALL\" || ./node_modules/@babel/cli/bin/babel.js --presets @babel/preset-env ./node_modules/@sweetalert --out-dir ./node_modules/@sweetalert"
"postinstall": "npm install -g cross-os && cross-os babel-deps"
},
"cross-os": {
"babel-deps": {
"linux": "test -n \"$NOYARNPOSTINSTALL\" || ./node_modules/@babel/cli/bin/babel.js --presets @babel/preset-env ./node_modules/@sweetalert --out-dir ./node_modules/@sweetalert",
"darwin": "test -n \"$NOYARNPOSTINSTALL\" || ./node_modules/@babel/cli/bin/babel.js --presets @babel/preset-env ./node_modules/@sweetalert --out-dir ./node_modules/@sweetalert",
"win32": "node ./node_modules/@babel/cli/bin/babel.js --presets @babel/preset-env ./node_modules/@sweetalert --out-dir ./node_modules/@sweetalert"
}
},
"engines": {
"node": ">=12"
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3929,6 +3929,11 @@ create-react-class@^15.6.3:
loose-envify "^1.3.1"
object-assign "^4.1.1"

cross-os@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/cross-os/-/cross-os-1.4.0.tgz#350f03fccb4bd9178777b6ae20160c1c7c79dbed"
integrity sha512-nuARAXqbsizhsqo3qo1bpYW2S6ohxJICjo/5Q/mq5xQ9dn1uWoRQ855DZrBAWgVfg7liPLdatnY2KMZwZYuxsQ==

cross-spawn@7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14"
Expand Down