Skip to content

Commit

Permalink
fix: make dev environment run on windows (#271)
Browse files Browse the repository at this point in the history
* fix: make build compatible with windows

* fix: make build compatible with windows

* fix: make build compatible with windows

* fix: add .gitattributes to check out lf on windows

* fix: include dotenv for core tests

* fix: prettier calls now use double quotes
(single quotes do not work on windows)
  • Loading branch information
johannesspohr authored and birkir committed Jul 10, 2019
1 parent 753617b commit b560249
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text=auto eol=lf
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -4,24 +4,24 @@
"node": ">= 10.*"
},
"scripts": {
"setup": "lerna bootstrap; yarn run link",
"setup": "lerna bootstrap && yarn run link",
"start": "lerna run dev --stream",
"link": "lerna exec -- yarn link",
"unlink": "lerna exec -- yarn unlink",
"clean": "lerna run clean; rimraf {.cache,node_modules,reports,packages/**/{node_modules,lib,build,coverage},yarn.lock}",
"clean": "lerna run clean && rimraf {.cache,node_modules,reports,packages/**/{node_modules,lib,build,coverage},yarn.lock}",
"compile": "lerna run compile",
"lint": "tslint ./packages/*/{src,__tests__}/*.{ts,tsx}",
"lint:ci": "mkdir -p reports/junit; yarn lint --formatters-dir node_modules/tslint-junit-formatter/formatters --format junit -o ./reports/junit/tslint.xml",
"lint:ci": "mkdir -p reports/junit && yarn lint --formatters-dir node_modules/tslint-junit-formatter/formatters --format junit -o ./reports/junit/tslint.xml",
"publish": "lerna publish prerelease",
"publish:canary": "lerna publish --canary",
"test": "yarn lint && yarn compile && yarn coverage && yarn test:prettier",
"testonly": "lerna run testonly",
"prettier": "prettier --write '**/*.{json,md,js,jsx,ts,tsx}'",
"test:prettier": "prettier --list-different '**/*.{json,md,js,jsx,ts,tsx}'",
"prettier": "prettier --write \"**/*.{json,md,js,jsx,ts,tsx}\"",
"test:prettier": "prettier --list-different \"**/*.{json,md,js,jsx,ts,tsx}\"",
"coverage": "lerna run coverage",
"coverage:ci": "lerna run coverage -- --ci --reporters=default --reporters=jest-junit",
"codecov": "codecov",
"reset": "yarn clean; yarn install; yarn setup; yarn compile",
"reset": "yarn clean && yarn install && yarn setup && yarn compile",
"docs": "typedoc --readme none --mode modules --out docs/api --ignoreCompilerErrors --excludeExternals --external-modulemap \".*(packages/[^/]+)/.*\" --logger none --name \"Prime CMS\" ./packages"
},
"workspaces": {
Expand Down
10 changes: 6 additions & 4 deletions packages/prime-core/package.json
Expand Up @@ -19,15 +19,16 @@
"coveragePathIgnorePatterns": [
"/node_modules/",
"/__tests__/utils"
]
],
"setupFiles": ["dotenv/config"]
},
"scripts": {
"clean": "rimraf lib",
"start": "node lib/index.js",
"prepublishOnly": "yarn compile",
"compile": "rm -rf ./lib && tsc -p .",
"dev": "DEBUG=prime* ts-node-dev --no-notify --transpileOnly src",
"dev:debug": "DEBUG=prime:*,typeorm:* ts-node-dev --no-notify --transpileOnly --inspect -- src",
"compile": "rimraf lib && tsc -p .",
"dev": "cross-env DEBUG=prime* ts-node-dev --no-notify --transpileOnly src",
"dev:debug": "cross-env DEBUG=prime:*,typeorm:* ts-node-dev --no-notify --transpileOnly --inspect -- src",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
"coverage": "yarn testonly --coverage"
Expand Down Expand Up @@ -82,6 +83,7 @@
"@types/graphql": "14.2.2",
"@types/lodash": "4.14.135",
"@types/rc": "1.1.0",
"cross-env": "^5.2.0",
"ts-node": "8.0.2",
"ts-node-dev": "1.0.0-pre.39"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-asset/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-boolean/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-datetime/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-document/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-geopoint/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-group/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-number/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-select/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-slice/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion packages/prime-field-string/package.json
Expand Up @@ -19,7 +19,7 @@
"clean": "rimraf lib",
"start": "tsc --watch; webpack --config ../prime-tools/webpack.config.js --watch",
"precompile": "yarn clean",
"compile": "tsc; rimraf lib/ui; webpack --config ../prime-tools/webpack.config.js",
"compile": "tsc && rimraf lib/ui && webpack --config ../prime-tools/webpack.config.js",
"prepublishOnly": "yarn compile",
"testonly": "jest --runInBand",
"test:watch": "jest --watch",
Expand Down
10 changes: 7 additions & 3 deletions packages/prime-ui/package.json
Expand Up @@ -11,8 +11,8 @@
],
"scripts": {
"prepublishOnly": "yarn compile",
"dev": "SKIP_PREFLIGHT_CHECK=true react-app-rewired start",
"compile": "SKIP_PREFLIGHT_CHECK=true PUBLIC_URL=/ react-app-rewired build",
"dev": "cross-env SKIP_PREFLIGHT_CHECK=true react-app-rewired start",
"compile": "cross-env SKIP_PREFLIGHT_CHECK=true PUBLIC_URL=/ react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
},
Expand Down Expand Up @@ -48,6 +48,7 @@
"apollo-link-http": "1.5.15",
"babel-plugin-import": "1.12.0",
"braft-editor": "2.3.7",
"cross-env": "^5.2.0",
"date-fns": "1.30.1",
"fork-ts-checker-webpack-plugin": "0.5.2",
"formik": "1.5.7",
Expand Down Expand Up @@ -80,5 +81,8 @@
"publishConfig": {
"access": "public"
},
"gitHead": "f00baf08a686c40cd5cc34fa4facdacf605b7e0c"
"gitHead": "f00baf08a686c40cd5cc34fa4facdacf605b7e0c",
"dependencies": {
"cross-env": "^5.2.0"
}
}
10 changes: 9 additions & 1 deletion yarn.lock
Expand Up @@ -5866,6 +5866,14 @@ create-react-context@^0.2.2:
fbjs "^0.8.0"
gud "^1.0.0"

cross-env@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"

cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
Expand Down Expand Up @@ -9823,7 +9831,7 @@ is-valid-path@0.1.1:
dependencies:
is-invalid-path "^0.1.0"

is-windows@^1.0.1, is-windows@^1.0.2:
is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==
Expand Down

0 comments on commit b560249

Please sign in to comment.