From e2161a45a8328e553eab2cdeb0bc71452d719def Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Tue, 25 Oct 2022 15:27:18 -0700 Subject: [PATCH 01/22] feat: move create-electron-app into forge --- .eslintignore | 1 + .prettierignore | 1 + .../externals/create-electron-app/package.json | 15 +++++++++++++++ .../externals/create-electron-app/src/index.js | 3 +++ .../externals/create-electron-app/src/index.ts | 3 +++ 5 files changed, 23 insertions(+) create mode 100644 packages/externals/create-electron-app/package.json create mode 100755 packages/externals/create-electron-app/src/index.js create mode 100644 packages/externals/create-electron-app/src/index.ts diff --git a/.eslintignore b/.eslintignore index 2b6fe7c12c..b33a7c0f05 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,4 +5,5 @@ node_modules packages/*/*/doc packages/*/*/index.ts packages/**/bad.js +packages/externals/create-electron-app/src/* tmpl diff --git a/.prettierignore b/.prettierignore index 38f3fe9eb5..da752b46e4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,4 +8,5 @@ packages/*/*/index.ts packages/*/*/README.md packages/*/*/tsconfig.json packages/api/core/test/fixture/bad_external_forge_config/bad.js +packages/externals/create-electron-app/src/* packages/plugin/webpack/test/**/.webpack diff --git a/packages/externals/create-electron-app/package.json b/packages/externals/create-electron-app/package.json new file mode 100644 index 0000000000..5470add0fc --- /dev/null +++ b/packages/externals/create-electron-app/package.json @@ -0,0 +1,15 @@ +{ + "name": "create-electron-app", + "version": "6.0.0-beta.68", + "description": "Create Electron App", + "main": "src/index.js", + "typings": "src/index.ts", + "author": "Samuel Attard", + "license": "MIT", + "dependencies": { + "@electron-forge/cli": "6.0.0-beta.68" + }, + "bin": { + "create-electron-app": "./src/index" + } +} diff --git a/packages/externals/create-electron-app/src/index.js b/packages/externals/create-electron-app/src/index.js new file mode 100755 index 0000000000..62e9a20ec4 --- /dev/null +++ b/packages/externals/create-electron-app/src/index.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require('@electron-forge/cli/dist/electron-forge-init.js'); diff --git a/packages/externals/create-electron-app/src/index.ts b/packages/externals/create-electron-app/src/index.ts new file mode 100644 index 0000000000..0a6d58e018 --- /dev/null +++ b/packages/externals/create-electron-app/src/index.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env ts-node + +require('@electron-forge/cli/dist/electron-forge-init.js'); \ No newline at end of file From 74e10b1ed67954a20046ac09a59a6db2116c499d Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 26 Oct 2022 16:02:29 -0700 Subject: [PATCH 02/22] build: do stuff --- .eslintrc.json | 2 +- package.json | 1 + .../create-electron-app/package.json | 6 +++--- packages/external/create-electron-app/src/index.ts | 3 +++ packages/externals/create-electron-app/src/index.js | 3 --- packages/externals/create-electron-app/src/index.ts | 3 --- 6 files changed, 8 insertions(+), 10 deletions(-) rename packages/{externals => external}/create-electron-app/package.json (71%) create mode 100644 packages/external/create-electron-app/src/index.ts delete mode 100755 packages/externals/create-electron-app/src/index.js delete mode 100644 packages/externals/create-electron-app/src/index.ts diff --git a/.eslintrc.json b/.eslintrc.json index 39a02aebee..4947d302a0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -65,7 +65,7 @@ } }, { - "files": ["packages/api/cli/src/**/*.ts", "tools/*.{js,ts}"], + "files": ["packages/api/cli/src/**/*.ts", "packages/external/create-electron-app/src/**/*.ts", "tools/*.{js,ts}"], "rules": { "no-process-exit": "off", "node/shebang": [ diff --git a/package.json b/package.json index 0c78b97d25..025319d448 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "bolt": { "workspaces": [ "packages/api/*", + "packages/external/*", "packages/maker/*", "packages/publisher/*", "packages/utils/*", diff --git a/packages/externals/create-electron-app/package.json b/packages/external/create-electron-app/package.json similarity index 71% rename from packages/externals/create-electron-app/package.json rename to packages/external/create-electron-app/package.json index 5470add0fc..e238bb92ac 100644 --- a/packages/externals/create-electron-app/package.json +++ b/packages/external/create-electron-app/package.json @@ -2,14 +2,14 @@ "name": "create-electron-app", "version": "6.0.0-beta.68", "description": "Create Electron App", - "main": "src/index.js", - "typings": "src/index.ts", + "main": "dist/index.js", + "typings": "dist/index.d.ts", "author": "Samuel Attard", "license": "MIT", "dependencies": { "@electron-forge/cli": "6.0.0-beta.68" }, "bin": { - "create-electron-app": "./src/index" + "electron-forge": "dist/index.js" } } diff --git a/packages/external/create-electron-app/src/index.ts b/packages/external/create-electron-app/src/index.ts new file mode 100644 index 0000000000..0a29ca8036 --- /dev/null +++ b/packages/external/create-electron-app/src/index.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +import '@electron-forge/cli/dist/electron-forge-init'; diff --git a/packages/externals/create-electron-app/src/index.js b/packages/externals/create-electron-app/src/index.js deleted file mode 100755 index 62e9a20ec4..0000000000 --- a/packages/externals/create-electron-app/src/index.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require('@electron-forge/cli/dist/electron-forge-init.js'); diff --git a/packages/externals/create-electron-app/src/index.ts b/packages/externals/create-electron-app/src/index.ts deleted file mode 100644 index 0a6d58e018..0000000000 --- a/packages/externals/create-electron-app/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ts-node - -require('@electron-forge/cli/dist/electron-forge-init.js'); \ No newline at end of file From c9495ca6fac7e68819dd9ba50e2e1fdb3f79a4a2 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 26 Oct 2022 16:04:03 -0700 Subject: [PATCH 03/22] build: how dare we ignore this file --- .eslintignore | 1 - .prettierignore | 1 - 2 files changed, 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index b33a7c0f05..2b6fe7c12c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,5 +5,4 @@ node_modules packages/*/*/doc packages/*/*/index.ts packages/**/bad.js -packages/externals/create-electron-app/src/* tmpl diff --git a/.prettierignore b/.prettierignore index da752b46e4..38f3fe9eb5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,5 +8,4 @@ packages/*/*/index.ts packages/*/*/README.md packages/*/*/tsconfig.json packages/api/core/test/fixture/bad_external_forge_config/bad.js -packages/externals/create-electron-app/src/* packages/plugin/webpack/test/**/.webpack From 23ba2dbfc79a5bd0d171392d5172c040269fac22 Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Wed, 26 Oct 2022 16:05:28 -0700 Subject: [PATCH 04/22] chore: add README --- .../external/create-electron-app/README.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/external/create-electron-app/README.md diff --git a/packages/external/create-electron-app/README.md b/packages/external/create-electron-app/README.md new file mode 100644 index 0000000000..b20c86eacc --- /dev/null +++ b/packages/external/create-electron-app/README.md @@ -0,0 +1,27 @@ +## create-electron-app + +Create Electron App allows you to quickly bootstrap a new Electron app, using Electron Forge. + +### Usage + +Initialize a new project by running the following: + +``` +// yarn 1 +yarn create electron-app my-app + +// npm +npx create-electron-app@latest my-app +``` + +You should now have a directory called my-app with an ultra-minimal Electron app boilerplate inside. If you head into that directory and start up the app, you'll be all set to start developing! + +``` +// yarn 1 +cd my-app +yarn start + +// npm +cd my-app +npm start +``` From f5fa94f5d6d8bfd1ff03cfbe25f3c1039353ba68 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 26 Oct 2022 16:26:46 -0700 Subject: [PATCH 05/22] fix: name bin for cre correctly --- packages/external/create-electron-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/external/create-electron-app/package.json b/packages/external/create-electron-app/package.json index e238bb92ac..2f7d8f3b88 100644 --- a/packages/external/create-electron-app/package.json +++ b/packages/external/create-electron-app/package.json @@ -10,6 +10,6 @@ "@electron-forge/cli": "6.0.0-beta.68" }, "bin": { - "electron-forge": "dist/index.js" + "create-electron-app": "dist/index.js" } } From aaa6ef6b3ec5d0e934c13fca0c70eb2182a9e0d3 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 26 Oct 2022 16:36:38 -0700 Subject: [PATCH 06/22] fix: disable eslint for CEA --- packages/external/create-electron-app/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/external/create-electron-app/src/index.ts b/packages/external/create-electron-app/src/index.ts index 0a29ca8036..0cb57e085f 100644 --- a/packages/external/create-electron-app/src/index.ts +++ b/packages/external/create-electron-app/src/index.ts @@ -1,3 +1,4 @@ #!/usr/bin/env node +/* eslint-disable */ import '@electron-forge/cli/dist/electron-forge-init'; From 4b35ffed2c170cc8c8f9c5a57958d81e297e9bd3 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 26 Oct 2022 17:12:43 -0700 Subject: [PATCH 07/22] build: bust ci cache --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62300f507a..8f16a88114 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v.3.5.1 with: node-version: 14.x - cache: yarn - name: Run dependabolt if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'dependabot/npm_and_yarn') && !contains(github.event.pull_request.head.ref, 'npm_and_yarn/packages') }} uses: malept/github-action-dependabolt@v4.0.1 @@ -41,7 +40,6 @@ jobs: uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v.3.5.1 with: node-version: 14.x - cache: yarn - name: Install latest NPM on Windows if: matrix.os == 'windows-latest' # See https://github.com/actions/virtual-environments/issues/4856#issuecomment-1043256330 @@ -104,7 +102,6 @@ jobs: uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v.3.5.1 with: node-version: 14.x - cache: yarn - name: Install bolt shell: bash run: | From 27465bbe56bc466c7f2c0d9cc6a14e099bd81a95 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 18:09:57 -0700 Subject: [PATCH 08/22] fix: set version to 74 --- packages/external/create-electron-app/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/external/create-electron-app/package.json b/packages/external/create-electron-app/package.json index 2f7d8f3b88..32d6be3fe7 100644 --- a/packages/external/create-electron-app/package.json +++ b/packages/external/create-electron-app/package.json @@ -1,13 +1,13 @@ { "name": "create-electron-app", - "version": "6.0.0-beta.68", + "version": "6.0.0-beta.74", "description": "Create Electron App", "main": "dist/index.js", "typings": "dist/index.d.ts", "author": "Samuel Attard", "license": "MIT", "dependencies": { - "@electron-forge/cli": "6.0.0-beta.68" + "@electron-forge/cli": "6.0.0-beta.74" }, "bin": { "create-electron-app": "dist/index.js" From 37847a28155524c7f5a580433051063d8ea1067d Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Mon, 31 Oct 2022 19:54:16 -0700 Subject: [PATCH 09/22] debug: remove windows-latest run --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f16a88114..0467fd17db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [windows-latest, macOS-latest, ubuntu-latest] + os: [macOS-latest, ubuntu-latest] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input @@ -77,7 +77,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [windows-latest, macOS-latest, ubuntu-20.04] + os: [macOS-latest, ubuntu-20.04] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input From 2458c6097798732f4c8c8e2c74f08d21a97817fb Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Mon, 31 Oct 2022 20:21:22 -0700 Subject: [PATCH 10/22] debug: bump windows bolt 0.21.2 -> 0.24.10 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0467fd17db..16cdbe51f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [macOS-latest, ubuntu-latest] + os: [windows-latest, macOS-latest, ubuntu-latest] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input @@ -51,7 +51,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION @@ -77,7 +77,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [macOS-latest, ubuntu-20.04] + os: [windows-latest, macOS-latest, ubuntu-20.04] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input @@ -106,7 +106,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION From dcb2a66b7e92fa951e8f1822aa306fa16ddd85e5 Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Mon, 31 Oct 2022 20:36:58 -0700 Subject: [PATCH 11/22] debug: pre-install cli --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16cdbe51f2..6ee1828678 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,12 @@ jobs: *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION + - name: Fix linking 'create-electron-app' on Windows + shell: bash + if: matrix.os == 'windows-latest' + run: | + cd packages/api/cli + yarn install - name: Install run: bolt - name: Lint From 8d632438c2cb5386a1d77e0b0d245f4948f1b4e0 Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Mon, 31 Oct 2022 21:31:02 -0700 Subject: [PATCH 12/22] debug: bolt to 0.22.4 --- .github/workflows/ci.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ee1828678..2a01761d70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,16 +51,10 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.22.4 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION - - name: Fix linking 'create-electron-app' on Windows - shell: bash - if: matrix.os == 'windows-latest' - run: | - cd packages/api/cli - yarn install - name: Install run: bolt - name: Lint @@ -112,7 +106,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.22.4 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION From ad6d8f1fefbbd27a17899bc89d39627170196aa1 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 23:31:52 -0700 Subject: [PATCH 13/22] build: make stub electron-forge.js file in dist for windows build to work --- package.json | 4 +++- yarn.lock | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 025319d448..8bba758579 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lint:fix": "prettier --write .", "test": "xvfb-maybe cross-env TS_NODE_PROJECT='./tsconfig.test.json' TS_NODE_FILES=1 mocha './tools/test-globber.ts'", "test:fast": "xvfb-maybe cross-env TS_NODE_PROJECT='./tsconfig.test.json' TEST_FAST_ONLY=1 TS_NODE_FILES=1 mocha './tools/test-globber.ts'", - "postinstall": "rimraf node_modules/.bin/*.ps1 && ts-node ./tools/gen-tsconfigs.ts && ts-node ./tools/gen-ts-glue.ts", + "postinstall": "rimraf node_modules/.bin/*.ps1 && ts-node ./tools/gen-tsconfigs.ts && ts-node ./tools/gen-ts-glue.ts && mkdirp packages/api/cli/dist && touch packages/api/cli/dist/electron-forge.js", "prepare": "husky install" }, "dependencies": { @@ -70,6 +70,7 @@ "lodash": "^4.17.20", "log-symbols": "^4.0.0", "mime-types": "^2.1.25", + "mkdirp": "^1.0.4", "node-fetch": "^2.6.7", "ora": "^5.0.0", "parse-author": "^2.0.0", @@ -148,6 +149,7 @@ "rimraf": "^3.0.1", "sinon": "^13.0.1", "sinon-chai": "^3.6.0", + "touch": "^3.1.0", "ts-node": "^10.0.0", "typedoc": "^0.22.15", "typedoc-plugin-missing-exports": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index 589692da23..bdc572159b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7123,6 +7123,13 @@ nopt@^6.0.0: dependencies: abbrev "^1.0.0" +nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg== + dependencies: + abbrev "1" + normalize-package-data@^2.0.0, normalize-package-data@^2.3.2: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -8992,6 +8999,13 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +touch@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" + integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== + dependencies: + nopt "~1.0.10" + tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" From 27c945027e2e268643a5a92e0b7a2b0b8d8e1d66 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 23:34:50 -0700 Subject: [PATCH 14/22] Revert "debug: bolt to 0.22.4" This reverts commit 8d632438c2cb5386a1d77e0b0d245f4948f1b4e0. --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a01761d70..6ee1828678 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,10 +51,16 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.22.4 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION + - name: Fix linking 'create-electron-app' on Windows + shell: bash + if: matrix.os == 'windows-latest' + run: | + cd packages/api/cli + yarn install - name: Install run: bolt - name: Lint @@ -106,7 +112,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.22.4 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION From aee22f8f13cd1bb19884c24e8c6f55c89274a36c Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 23:34:58 -0700 Subject: [PATCH 15/22] Revert "debug: pre-install cli" This reverts commit dcb2a66b7e92fa951e8f1822aa306fa16ddd85e5. --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ee1828678..16cdbe51f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,12 +55,6 @@ jobs: *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION - - name: Fix linking 'create-electron-app' on Windows - shell: bash - if: matrix.os == 'windows-latest' - run: | - cd packages/api/cli - yarn install - name: Install run: bolt - name: Lint From 8e6bdf5df27233c3651e9f285d7be9d5b1433bea Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 23:35:06 -0700 Subject: [PATCH 16/22] Revert "debug: bump windows bolt 0.21.2 -> 0.24.10" This reverts commit 2458c6097798732f4c8c8e2c74f08d21a97817fb. --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16cdbe51f2..0467fd17db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [windows-latest, macOS-latest, ubuntu-latest] + os: [macOS-latest, ubuntu-latest] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input @@ -51,7 +51,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION @@ -77,7 +77,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [windows-latest, macOS-latest, ubuntu-20.04] + os: [macOS-latest, ubuntu-20.04] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input @@ -106,7 +106,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION From 7f7253f78b51e2bbc588701b5e8e4e0cf04d578f Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 23:35:18 -0700 Subject: [PATCH 17/22] Revert "debug: remove windows-latest run" This reverts commit 37847a28155524c7f5a580433051063d8ea1067d. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0467fd17db..8f16a88114 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [macOS-latest, ubuntu-latest] + os: [windows-latest, macOS-latest, ubuntu-latest] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input @@ -77,7 +77,7 @@ jobs: needs: dependabolt strategy: matrix: - os: [macOS-latest, ubuntu-20.04] + os: [windows-latest, macOS-latest, ubuntu-20.04] steps: - name: Fix git checkout line endings run: git config --global core.autocrlf input From b1cc95a7e7dee69954be2037a9ea4e9d2b4c3f90 Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Tue, 1 Nov 2022 07:40:40 -0700 Subject: [PATCH 18/22] Revert "build: bust ci cache" This reverts commit 4b35ffed2c170cc8c8f9c5a57958d81e297e9bd3. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f16a88114..62300f507a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v.3.5.1 with: node-version: 14.x + cache: yarn - name: Run dependabolt if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'dependabot/npm_and_yarn') && !contains(github.event.pull_request.head.ref, 'npm_and_yarn/packages') }} uses: malept/github-action-dependabolt@v4.0.1 @@ -40,6 +41,7 @@ jobs: uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v.3.5.1 with: node-version: 14.x + cache: yarn - name: Install latest NPM on Windows if: matrix.os == 'windows-latest' # See https://github.com/actions/virtual-environments/issues/4856#issuecomment-1043256330 @@ -102,6 +104,7 @@ jobs: uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v.3.5.1 with: node-version: 14.x + cache: yarn - name: Install bolt shell: bash run: | From 0bc588ac6824aa11072c2b7a4c927b3c1e6ac530 Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Tue, 1 Nov 2022 07:42:59 -0700 Subject: [PATCH 19/22] build: move stub folder to preinstall hook --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8bba758579..b0ed53456d 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "lint:fix": "prettier --write .", "test": "xvfb-maybe cross-env TS_NODE_PROJECT='./tsconfig.test.json' TS_NODE_FILES=1 mocha './tools/test-globber.ts'", "test:fast": "xvfb-maybe cross-env TS_NODE_PROJECT='./tsconfig.test.json' TEST_FAST_ONLY=1 TS_NODE_FILES=1 mocha './tools/test-globber.ts'", - "postinstall": "rimraf node_modules/.bin/*.ps1 && ts-node ./tools/gen-tsconfigs.ts && ts-node ./tools/gen-ts-glue.ts && mkdirp packages/api/cli/dist && touch packages/api/cli/dist/electron-forge.js", + "preinstall": "npx mkdirp packages/api/cli/dist && npx mkdirp packages/external/create-electron-app/dist && touch packages/api/cli/dist/electron-forge.js && touch packages/external/create-electron-app/dist/index.js", + "postinstall": "rimraf node_modules/.bin/*.ps1 && ts-node ./tools/gen-tsconfigs.ts && ts-node ./tools/gen-ts-glue.ts", "prepare": "husky install" }, "dependencies": { From 181c8c347e4840316b72c9c136da8ccba179e1c9 Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Tue, 1 Nov 2022 08:14:11 -0700 Subject: [PATCH 20/22] Reland: bump windows bolt 0.21.2 -> 0.24.10 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62300f507a..66a45e0af3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION @@ -109,7 +109,7 @@ jobs: shell: bash run: | case "$(uname -s)" in - Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; + Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.24.10 ;; *) BOLT_VERSION=latest ;; esac npm install -g bolt@$BOLT_VERSION From af016b6fff276f6316c89c55c1cd8635141159d4 Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Tue, 1 Nov 2022 12:47:21 -0700 Subject: [PATCH 21/22] build: add shim script for windows, remove unneeded deps --- package.json | 4 +--- tools/maybe-shim-windows.js | 27 +++++++++++++++++++++++++++ yarn.lock | 14 -------------- 3 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 tools/maybe-shim-windows.js diff --git a/package.json b/package.json index b0ed53456d..3fb184a7c5 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "lint:fix": "prettier --write .", "test": "xvfb-maybe cross-env TS_NODE_PROJECT='./tsconfig.test.json' TS_NODE_FILES=1 mocha './tools/test-globber.ts'", "test:fast": "xvfb-maybe cross-env TS_NODE_PROJECT='./tsconfig.test.json' TEST_FAST_ONLY=1 TS_NODE_FILES=1 mocha './tools/test-globber.ts'", - "preinstall": "npx mkdirp packages/api/cli/dist && npx mkdirp packages/external/create-electron-app/dist && touch packages/api/cli/dist/electron-forge.js && touch packages/external/create-electron-app/dist/index.js", + "preinstall": "node ./tools/maybe-shim-windows.js", "postinstall": "rimraf node_modules/.bin/*.ps1 && ts-node ./tools/gen-tsconfigs.ts && ts-node ./tools/gen-ts-glue.ts", "prepare": "husky install" }, @@ -71,7 +71,6 @@ "lodash": "^4.17.20", "log-symbols": "^4.0.0", "mime-types": "^2.1.25", - "mkdirp": "^1.0.4", "node-fetch": "^2.6.7", "ora": "^5.0.0", "parse-author": "^2.0.0", @@ -150,7 +149,6 @@ "rimraf": "^3.0.1", "sinon": "^13.0.1", "sinon-chai": "^3.6.0", - "touch": "^3.1.0", "ts-node": "^10.0.0", "typedoc": "^0.22.15", "typedoc-plugin-missing-exports": "^1.0.0", diff --git a/tools/maybe-shim-windows.js b/tools/maybe-shim-windows.js new file mode 100644 index 0000000000..736309b351 --- /dev/null +++ b/tools/maybe-shim-windows.js @@ -0,0 +1,27 @@ +const fs = require('fs'); +const path = require('path'); + +/* + * Adds a shim to fix Windows symlinking with create-electron-app. + * Should run on Windows only. + * More details: https://github.com/boltpkg/bolt/issues/207 + */ +function createShim(dir, shimPath) { + const cwd = process.cwd(); + fs.mkdirSync(path.resolve(cwd, dir), { recursive: true }); + fs.writeFileSync(path.resolve(cwd, shimPath), ''); +} + +async function main() { + const cli = path.resolve('packages', 'api', 'cli', 'dist'); + const cea = path.resolve('packages', 'external', 'create-electron-app', 'dist'); + createShim(cli, path.resolve(cli, 'electron-forge.js')); + createShim(cea, path.resolve(cea, 'index.js')); +} + +if (process.platform === 'win32') { + main().catch((err) => { + console.error(err); + process.exit(1); + }); +} diff --git a/yarn.lock b/yarn.lock index bdc572159b..589692da23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7123,13 +7123,6 @@ nopt@^6.0.0: dependencies: abbrev "^1.0.0" -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg== - dependencies: - abbrev "1" - normalize-package-data@^2.0.0, normalize-package-data@^2.3.2: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -8999,13 +8992,6 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -touch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" - integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== - dependencies: - nopt "~1.0.10" - tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" From dcdcc6c621145de1d49927ebb1c890a97e4bc01f Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Tue, 1 Nov 2022 14:23:02 -0700 Subject: [PATCH 22/22] build: improve tools/maybe-shim-windows.js Co-authored-by: Samuel Attard --- tools/maybe-shim-windows.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/maybe-shim-windows.js b/tools/maybe-shim-windows.js index 736309b351..6804b8694d 100644 --- a/tools/maybe-shim-windows.js +++ b/tools/maybe-shim-windows.js @@ -6,17 +6,17 @@ const path = require('path'); * Should run on Windows only. * More details: https://github.com/boltpkg/bolt/issues/207 */ -function createShim(dir, shimPath) { - const cwd = process.cwd(); - fs.mkdirSync(path.resolve(cwd, dir), { recursive: true }); - fs.writeFileSync(path.resolve(cwd, shimPath), ''); +function createShim(shimPath) { + fs.mkdirSync(path.dirname(shimPath), { recursive: true }); + fs.writeFileSync(shimPath, ''); } async function main() { - const cli = path.resolve('packages', 'api', 'cli', 'dist'); - const cea = path.resolve('packages', 'external', 'create-electron-app', 'dist'); - createShim(cli, path.resolve(cli, 'electron-forge.js')); - createShim(cea, path.resolve(cea, 'index.js')); + const srcRoot = path.resolve(__dirname, '..'); + const cli = path.resolve(srcRoot, 'packages', 'api', 'cli', 'dist', 'electron-forge.js'); + const cea = path.resolve(srcRoot, 'packages', 'external', 'create-electron-app', 'dist', 'index.js'); + createShim(cli); + createShim(cea); } if (process.platform === 'win32') {