Skip to content

Commit

Permalink
Revert "Adjust project bootstrap scripts to be windows-friendly (#1870)"
Browse files Browse the repository at this point in the history
This reverts commit ced2181.
  • Loading branch information
EmiM committed Oct 9, 2023
1 parent e4cdc80 commit 14c8380
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 121 deletions.
11 changes: 0 additions & 11 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ runs:
shell: bash

- name: "Bootstrap project"
if: ${{ runner.os != 'Windows' }}
run: |
if [[ ! -z "${{ inputs.bootstrap-packages }}" ]]
then
Expand All @@ -60,13 +59,3 @@ runs:
lerna bootstrap
fi
shell: bash

- name: "Bootstrap project on windows"
if: ${{ runner.os == 'Windows' }}
run: |
if ( "${{ inputs.bootstrap-packages }}" ) {
lerna bootstrap --scope '{${{ inputs.bootstrap-packages }},}'
} else {
lerna bootstrap
}
shell: powershell
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

* Bump github actions/* to versions using node16

* Project can now be bootstraped on Windows (powershell)

* Placeholder(...) for community name

* No unregistered/duplicated label for system messages
Expand Down
5 changes: 0 additions & 5 deletions packages/backend/.gitattributes

This file was deleted.

18 changes: 0 additions & 18 deletions packages/backend/electron-fetch-git.patch

This file was deleted.

19 changes: 3 additions & 16 deletions packages/backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@
"private": true,
"scripts": {
"build": "tsc -p tsconfig.build.json",
"webpack": "run-script-os",
"webpack:default": "webpack --env mode=development && cp ./lib/bundle.cjs ../backend-bundle/bundle.cjs",
"webpack": "webpack --env mode=development && cp ./lib/bundle.cjs ../backend-bundle/bundle.cjs",
"webpack:prod": "webpack --env mode=production && cp ./lib/bundle.cjs ../backend-bundle/bundle.cjs",
"webpack:windows": "webpack --env mode=development && xcopy .\\lib\\bundle.cjs ..\\backend-bundle\\ /Y",
"webpack:prod:windows": "webpack --env mode=production && xcopy .\\lib\\bundle.cjs ..\\backend-bundle\\ /Y",
"applyPatches": "run-script-os",
"applyPatches:default": "patch -f -p0 < ./electron-fetch.patch || true && patch -f -p0 --forward --binary < ./parse-duration.patch || true && patch -f -p0 --forward --binary < ./parse-duration-esm.patch || true",
"applyPatches:windows": "git apply ./electron-fetch-git.patch --whitespace=fix --reject --verbose --no-index --ignore-space-change --inaccurate-eof || cd .",
"applyPatches": "patch -f -p0 < ./electron-fetch.patch || true && patch -f -p0 --forward --binary < ./parse-duration.patch || true && patch -f -p0 --forward --binary < ./parse-duration-esm.patch || true",
"prepare": "npm run applyPatches && npm run webpack",
"version": "git add -A src",
"lint": "eslint --ext .jsx,.js,.ts,.tsx ./src/ --fix",
"lint-ci": "eslint --ext .jsx,.js,.ts,.tsx ./src/",
"test2": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* node_modules/jest/bin/jest.js",
"test-nest": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* node_modules/jest/bin/jest.js --detectOpenHandles --forceExit ./src/nest/**/*.spec.ts",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* node_modules/jest/bin/jest.js ./src/**/* --runInBand --verbose --testPathIgnorePatterns=\".src/(!?nodeTest*)|(.node_modules*)\"",
"test-ci": "cross-env NODE_OPTIONS=--experimental-vm-modules jest ./src/**/* --runInBand --colors --ci --silent --verbose --testPathIgnorePatterns=\".src/nest/(!?nodeTest*)|(.node_modules*)|src/nest/.*\\.tor.spec\\.(t|j)s|src/nest/ipfs-file-manager/big-files.long.spec.ts$\"",
Expand Down Expand Up @@ -77,7 +73,6 @@
"fetch-mock-jest": "^1.5.1",
"jest": "^29.4.2",
"mock-fs": "^5.1.2",
"run-script-os": "1.1.6",
"tmp": "^0.2.1",
"ts-jest": "^29.0.3",
"ts-loader": "9.4.2",
Expand Down
14 changes: 0 additions & 14 deletions packages/desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@ npm run start
```
----

## Running dev desktop on Windows

Bootstrap scripts has been adjusted to work on Windows (powershell or cmd) hovewer there still may be a problem with patching.
Getting error:

```
webpack://@quiet/backend/./node_modules/electron/index.js?:9
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
```

while running desktop may mean that applying patch in packages/backend (`npm run applyPatches`) did not work correctly.
If that's the case file must be patched manually according to `electron-fetch-git.patch` and backend must be rebuilt by running `npm run webpack` in packages/backend.


## Versioning packages

Before trying to release a new version, make sure you have `GH_TOKEN` env set.
Expand Down
17 changes: 0 additions & 17 deletions packages/desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@
"rmDist": "rimraf dist/",
"setMainEnvs": "node scripts/setMainEnvs.js",
"copyMainEnvs": "cp mainEnvs.json dist/main",
"copyFonts": "run-script-os",
"copyFonts:windows": "xcopy src\\renderer\\fonts\\* dist\\main /Y",
"copyFonts:default": "cp src/renderer/fonts/* dist/main"
"copyFonts": "cp src/renderer/fonts/* dist/main"
},
"dependencies": {
"@electron/remote": "^2.0.8",
Expand Down Expand Up @@ -258,7 +256,6 @@
"redux-saga-test-plan": "^4.0.3",
"redux-thunk": "^2.3.0",
"reselect": "^4.1.5",
"run-script-os": "1.1.6",
"socket.io-mock": "^1.3.2",
"source-map-loader": "^4.0.1",
"standard": "^12.0.1",
Expand Down
17 changes: 0 additions & 17 deletions packages/mobile/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@
"lint": "eslint --ext .jsx,.js,.ts,.tsx ./src/ --fix",
"lint-ci": "eslint --ext .jsx,.js,.ts,.tsx ./src/",
"gen": "plop",
"prepare-backend-assets": "run-script-os",
"prepare-backend-assets:default": "mkdir -p ./nodejs-assets/nodejs-project && cp ../backend/lib/bundle.cjs ./nodejs-assets/nodejs-project/bundle.cjs",
"prepare-backend-assets:windows": "mkdir .\\nodejs-assets\\nodejs-project || cd . && xcopy ..\\backend\\lib\\bundle.cjs .\\nodejs-assets\\nodejs-project\\ /Y",
"prepare-backend-assets": "mkdir -p ./nodejs-assets/nodejs-project && cp ../backend/lib/bundle.cjs ./nodejs-assets/nodejs-project/bundle.cjs",
"patch-state-manager": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || patch -f -d ../state-manager -p0 < ./factory-girl.patch || true",
"patch-react-native": "patch -f -p0 --forward --binary < ./react-native.patch || true",
"patch-webview-crypto": "patch -f -p0 --forward --binary < ./react-native-webview-crypto.patch || true",
"override-dlopen": "run-script-os",
"override-dlopen:default": "cd ./nodejs-assets/nodejs-project && cp ../override-dlopen-paths-preload.js ./ && cp ../override-dlopen-paths-data.json ./",
"override-dlopen:windows": "cd ./nodejs-assets/nodejs-project && xcopy ..\\override-dlopen-paths-preload.js .\\ /Y && xcopy ..\\override-dlopen-paths-data.json .\\ /Y",
"prepare": "run-script-os",
"prepare:default": "npm run prepare-backend-assets && npm run override-dlopen && npm run patch-state-manager && npm run patch-react-native && npm run patch-webview-crypto && npm run build",
"prepare:windows": "npm run prepare-backend-assets && npm run override-dlopen && npm run build",
"override-dlopen": "cd ./nodejs-assets/nodejs-project && cp ../override-dlopen-paths-preload.js ./ && cp ../override-dlopen-paths-data.json ./",
"prepare": "npm run prepare-backend-assets && npm run override-dlopen && npm run patch-state-manager && npm run patch-react-native && npm run patch-webview-crypto && npm run build",
"version": "react-native-version --skip-tag"
},
"dependencies": {
Expand Down

0 comments on commit 14c8380

Please sign in to comment.