Skip to content

Commit

Permalink
fix: incorrect setting of env variables for windows (#1763)
Browse files Browse the repository at this point in the history
* fix(blade): added rules for prettier to resolve '[eslint] Delete CR [prettier/prettier]' error

* fix(blade): fixed scripts for project setup in Windows

Added 'set' keyword in scripts to add env variables and values during script execution

Used escape character to remove extra space character that was getting appended to env variable value

* feat: use cross-env for windows support

* fix: removed prettier rule as it might create conflicts on different environments

---------

Co-authored-by: rzpcibot <tools+cibot@razorpay.com>
  • Loading branch information
TejasShekar and rzpcibot authored Oct 31, 2023
1 parent dc0d4bf commit 37c265d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
31 changes: 16 additions & 15 deletions packages/blade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,24 @@
"types:copy-declarations:native": "copyfiles -u 1 \"src/**/*.d.ts\" build/types/native",
"build:generate-root-imports": "rollup -c && node ./scripts/generateRootImports.js",
"build:clean-declarations": "rm -rf build/types",
"build:react-dev": "FRAMEWORK=REACT NODE_ENV=development rollup -c",
"build:react-prod": "FRAMEWORK=REACT NODE_ENV=production rollup -c",
"build:react-native": "FRAMEWORK=REACT_NATIVE rollup -c",
"build:generate-css-variables": "GENERATE_CSS_VARIABLES=true FRAMEWORK=REACT rollup -c && node ./scripts/generateCssThemeVariables.js",
"build:react-dev": "cross-env FRAMEWORK=REACT NODE_ENV=development rollup -c",
"build:react-prod": "cross-env FRAMEWORK=REACT NODE_ENV=production rollup -c",
"build:react-native": "cross-env FRAMEWORK=REACT_NATIVE rollup -c",
"build:generate-css-variables": "cross-env GENERATE_CSS_VARIABLES=true FRAMEWORK=REACT rollup -c && node ./scripts/generateCssThemeVariables.js",
"build:clean-theme-bundle": "rm -rf build/js-bundle-for-css",
"react-native:get-stories": "sb-rn-get-stories --config-path=./.storybook/react-native && yarn prettier --write ./.storybook/react-native/storybook.requires.js",
"react-native:storybook:android": "yarn react-native:get-stories && FRAMEWORK=REACT_NATIVE react-native run-android",
"react-native:storybook:ios": "yarn react-native:get-stories && FRAMEWORK=REACT_NATIVE react-native run-ios",
"react-native:storybook:start": "yarn react-native:get-stories && NODE_OPTIONS=--openssl-legacy-provider FRAMEWORK=REACT_NATIVE react-native start --reset-cache",
"react-native:storybook:android": "yarn react-native:get-stories && cross-env FRAMEWORK=REACT_NATIVE react-native run-android",
"react-native:storybook:ios": "yarn react-native:get-stories && cross-env FRAMEWORK=REACT_NATIVE react-native run-ios",
"react-native:storybook:start": "yarn react-native:get-stories && cross-env NODE_OPTIONS=--openssl-legacy-provider FRAMEWORK=REACT_NATIVE react-native start --reset-cache",
"react": "yarn run react:storybook",
"react:storybook": "NODE_OPTIONS=--openssl-legacy-provider FRAMEWORK=REACT start-storybook -c ./.storybook/react -p 9009",
"react:storybook:build": "NODE_OPTIONS=--openssl-legacy-provider FRAMEWORK=REACT build-storybook -c ./.storybook/react -o storybook-site",
"test:react": "FRAMEWORK=REACT jest -c ./jest.web.config.js --shard=$SHARD --forceExit",
"test:react-native": "FRAMEWORK=REACT_NATIVE jest -c ./jest.native.config.js --shard=$SHARD --forceExit",
"start:ios": "NODE_OPTIONS=--openssl-legacy-provider run-p react-native:storybook:start react-native:storybook:ios",
"start:android": "NODE_OPTIONS=--openssl-legacy-provider run-p react-native:storybook:start react-native:storybook:android",
"start:native": "NODE_OPTIONS=--openssl-legacy-provider run-p react-native:storybook:start react-native:storybook:android react-native:storybook:ios",
"start:web": "NODE_OPTIONS=--openssl-legacy-provider yarn react",
"react:storybook": "cross-env NODE_OPTIONS=--openssl-legacy-provider FRAMEWORK=REACT start-storybook -c ./.storybook/react -p 9009",
"react:storybook:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider FRAMEWORK=REACT build-storybook -c ./.storybook/react -o storybook-site",
"test:react": "cross-env FRAMEWORK=REACT jest -c ./jest.web.config.js --shard=$SHARD --forceExit",
"test:react-native": "cross-env FRAMEWORK=REACT_NATIVE jest -c ./jest.native.config.js --shard=$SHARD --forceExit",
"start:ios": "cross-env NODE_OPTIONS=--openssl-legacy-provider run-p react-native:storybook:start react-native:storybook:ios",
"start:android": "cross-env NODE_OPTIONS=--openssl-legacy-provider run-p react-native:storybook:start react-native:storybook:android",
"start:native": "cross-env NODE_OPTIONS=--openssl-legacy-provider run-p react-native:storybook:start react-native:storybook:android react-native:storybook:ios",
"start:web": "cross-env NODE_OPTIONS=--openssl-legacy-provider yarn react",
"start:all": "run-p start:native start:web",
"watch:test": "run-p watch:test:*",
"watch:test:react": "yarn test:react --watch --onlyChanged",
Expand Down Expand Up @@ -194,6 +194,7 @@
"bundlemon": "2.0.1",
"chalk": "4.1.1",
"copyfiles": "2.4.1",
"cross-env": "7.0.3",
"dedent": "0.7.0",
"eslint-plugin-mdx": "1.16.0",
"execa": "5.0.0",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11440,6 +11440,13 @@ crelt@^1.0.5:
resolved "https://registry.yarnpkg.com/crelt/-/crelt-1.0.5.tgz#57c0d52af8c859e354bace1883eb2e1eb182bb94"
integrity sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==

cross-env@7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"

cross-fetch@3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
Expand All @@ -11458,7 +11465,7 @@ cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
Expand Down

0 comments on commit 37c265d

Please sign in to comment.