diff --git a/.changeset/neat-rivers-itch.md b/.changeset/neat-rivers-itch.md new file mode 100644 index 00000000000..6d9a161f26c --- /dev/null +++ b/.changeset/neat-rivers-itch.md @@ -0,0 +1,5 @@ +--- +"app-builder-lib": patch +--- + +chore: updating pnpm and setting minimumReleaseAge to 1 week diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml index cb4e730912a..e8a27ef7c6d 100644 --- a/.github/actions/pnpm/action.yml +++ b/.github/actions/pnpm/action.yml @@ -1,18 +1,12 @@ name: 'pnpm installation' -description: 'Install and audit dependencies via pnpm' -inputs: - version: # id of input - description: 'The pnpm version to use' - required: false - default: 9.4.0 +description: 'Enable via corepack and install dependencies' runs: using: 'composite' steps: - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - version: ${{ inputs.version }} + - name: Enable Corepack for pnpm + run: corepack enable + shell: bash - name: Setup node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 @@ -25,7 +19,5 @@ runs: shell: bash ## Usage -# - name: install and audit -# uses: ./.github/actions/pnpm -# with: -# version: ${{ env.PNPM_VERSION }} +# - name: corepack and install dependencies +# uses: ./.github/actions/pnpm \ No newline at end of file diff --git a/.github/actions/pretest/action.yml b/.github/actions/pretest/action.yml index 65fbcaea46e..c7d9e2206a9 100644 --- a/.github/actions/pretest/action.yml +++ b/.github/actions/pretest/action.yml @@ -1,5 +1,5 @@ name: 'Setup Tests' -description: 'Set up pnpm, node w/ pnpm cache, install and audit deps, compile, and restore electron cache' +description: 'Set up pnpm, node w/ pnpm cache, install deps, compile, and restore electron cache' inputs: cache-key: description: 'The key to the electron cache' @@ -7,18 +7,13 @@ inputs: cache-path: description: 'The path to the electron cache' required: true - version: - description: 'The pnpm version to use' - required: false - default: 9.4.0 runs: using: 'composite' steps: - - name: Setup pnpm - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - version: ${{ inputs.version }} + - name: Enable Corepack for pnpm + run: corepack enable + shell: bash - name: Setup python uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 40573557964..34bba63f564 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -114,7 +114,7 @@ jobs: # Need to separate from other tests because logic is specific to when TOKEN env vars are set test-updater: runs-on: ubuntu-22.04 - timeout-minutes: 30 + timeout-minutes: 20 needs: [check-if-docker-build, run-docker-build] # Wonky if-conditional to allow this step to run AFTER docker images are rebuilt OR if the build stage skipped and we want to use dockerhub registry for images if: | @@ -160,13 +160,27 @@ jobs: FORCE_COLOR: 1 TEST_RUNNER_IMAGE_TAG: electronuserland/builder:${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}-wine-mono - - name: Test Linux Updater - run: | - sh test/src/updater/test-specific-platforms.sh + # must be it's own build node due to docker library/images size limit on github hosted runners + test-e2e: + runs-on: ubuntu-22.04 + timeout-minutes: 30 + steps: + - name: Checkout code repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Setup Tests + uses: ./.github/actions/pretest + with: + cache-path: ~/.cache/electron + cache-key: v-23.3.10-update-electron - name: Verify Docs Generation run: pnpm generate-all + - name: e2e Linux Updater tests (install, auto-update, uninstall) + run: | + sh test/src/updater/test-specific-platforms.sh + test-windows: runs-on: windows-2022 timeout-minutes: 20 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cbb726f423e..5217b1ec58f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,14 +7,17 @@ This repository has a mono-repo structure consisting of multiple packages. Try t ## Prerequisites -> All prerequisites could be installed via script at the end of the chapter +- [pnpm](https://pnpm.js.org) is required. -- [pnpm](https://pnpm.js.org) is required because NPM is not reliable and Yarn 2 is not as good as PNPM. +Use `corepack` to activate the correct version of pnpm for this project. -Currently we use the following version of PNPM in the Github CI's action config, please use the same version to ensure that lockfiles are compatible. -https://github.com/electron-userland/electron-builder/blob/master/.github/actions/pnpm/action.yml +For local development: +### New dev route +https://pnpm.io/cli/link -- For local development, you can use [yalc](https://github.com/whitecolor/yalc) in order to apply changes made to +### Legacy dev Route + +You can use [yalc](https://github.com/whitecolor/yalc) in order to apply changes made to electron-builder for your other projects to leverage and test with. ``` diff --git a/docker/node/Dockerfile b/docker/node/Dockerfile index e75f25b0e41..f26c6b7f349 100644 --- a/docker/node/Dockerfile +++ b/docker/node/Dockerfile @@ -8,4 +8,4 @@ RUN curl -L https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64 unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md && \ # https://github.com/npm/npm/issues/4531 echo "unsafe-perm true" > .npmrc -RUN npm i -g pnpm@9.4.0 +RUN npm i -g pnpm@10.18.0 diff --git a/package.json b/package.json index ddbfc2caa61..f62208209b4 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,8 @@ "@babel/plugin-transform-modules-commonjs": "7.24.8", "@changesets/changelog-github": "0.4.7", "@changesets/cli": "2.29.7", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "^9.37.0", "@stylistic/eslint-plugin": "^2.8.0", "@types/node": "^22.7.4", "@typescript-eslint/eslint-plugin": "8.17.0", @@ -74,9 +76,9 @@ }, "engines": { "node": ">=14.14", - "pnpm": ">=9" + "pnpm": ">=10" }, - "packageManager": "pnpm@9.4.0", + "packageManager": "pnpm@10.18.0+sha512.e804f889f1cecc40d572db084eec3e4881739f8dec69c0ff10d2d1beff9a4e309383ba27b5b750059d7f4c149535b6cd0d2cb1ed3aeb739239a4284a68f40cfa", "pnpm": { "patchedDependencies": { "@changesets/cli@2.29.7": "patches/@changesets__cli@2.29.7.patch", diff --git a/packages/app-builder-lib/src/node-module-collector/packageManager.ts b/packages/app-builder-lib/src/node-module-collector/packageManager.ts index eae45983ddb..0e95047ce40 100644 --- a/packages/app-builder-lib/src/node-module-collector/packageManager.ts +++ b/packages/app-builder-lib/src/node-module-collector/packageManager.ts @@ -91,8 +91,13 @@ export function detectPackageManagerByLockfile(cwd: string): PM | null { } export function detectYarnBerry() { - // yarn --version - const version = execSync("yarn --version").toString().trim() - if (parseInt(version.split(".")[0]) > 1) return PM.YARN_BERRY + try { + const version = execSync("yarn --version").toString().trim() + if (parseInt(version.split(".")[0]) > 1) { + return PM.YARN_BERRY + } + } catch (_e) { + // If `yarn` is not found or another error occurs, fallback to the regular Yarn + } return PM.YARN } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9492c269ef..eabce802525 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,10 +6,10 @@ settings: patchedDependencies: '@changesets/assemble-release-plan@6.0.9': - hash: scxbrhht2ttmun6dmullcw2ipu + hash: ef56f57067dfcc594f40d9afc7278abe38cecf1c04230936e447a60e0d58a46e path: patches/@changesets__assemble-release-plan@6.0.9.patch '@changesets/cli@2.29.7': - hash: hn5w3ar5kzfvrwqaymff5f37xu + hash: 0840fdb970dc9d87c5b800e1772fa7183819563f50d1bb3b5487471be7f933ba path: patches/@changesets__cli@2.29.7.patch importers: @@ -31,7 +31,13 @@ importers: version: 0.4.7(encoding@0.1.13) '@changesets/cli': specifier: 2.29.7 - version: 2.29.7(patch_hash=hn5w3ar5kzfvrwqaymff5f37xu)(@types/node@22.13.17) + version: 2.29.7(patch_hash=0840fdb970dc9d87c5b800e1772fa7183819563f50d1bb3b5487471be7f933ba)(@types/node@22.13.17) + '@eslint/eslintrc': + specifier: ^3.3.1 + version: 3.3.1 + '@eslint/js': + specifier: ^9.37.0 + version: 9.37.0 '@stylistic/eslint-plugin': specifier: ^2.8.0 version: 2.13.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.8.2) @@ -398,10 +404,6 @@ importers: js-yaml: specifier: ^4.1.0 version: 4.1.0 - optionalDependencies: - dmg-license: - specifier: ^1.0.11 - version: 1.0.11 devDependencies: '@types/fs-extra': specifier: 9.0.13 @@ -412,6 +414,10 @@ importers: temp-file: specifier: 3.4.0 version: 3.4.0 + optionalDependencies: + dmg-license: + specifier: ^1.0.11 + version: 1.0.11 packages/electron-builder: dependencies: @@ -1836,6 +1842,10 @@ packages: resolution: {integrity: sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@9.37.0': + resolution: {integrity: sha512-jaS+NJ+hximswBG6pjNX0uEJZkrT0zwpVi3BA3vX22aFGjJjmgSTSmPpZCRKmoBL5VY/M6p0xsSJx7rk7sy5gg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/object-schema@2.1.6': resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5538,7 +5548,7 @@ snapshots: '@babel/helper-module-imports': 7.25.9 '@babel/helper-plugin-utils': 7.26.5 '@babel/traverse': 7.27.0 - debug: 4.4.0 + debug: 4.4.1 lodash.debounce: 4.0.8 resolve: 1.22.10 semver: 6.3.1 @@ -5550,7 +5560,7 @@ snapshots: '@babel/core': 7.24.9 '@babel/helper-compilation-targets': 7.27.0 '@babel/helper-plugin-utils': 7.26.5 - debug: 4.4.0 + debug: 4.4.1 lodash.debounce: 4.0.8 resolve: 1.22.10 transitivePeerDependencies: @@ -6560,7 +6570,7 @@ snapshots: '@babel/parser': 7.27.0 '@babel/template': 7.27.0 '@babel/types': 7.27.0 - debug: 4.4.0 + debug: 4.4.1 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -6586,7 +6596,7 @@ snapshots: resolve-from: 5.0.0 semver: 7.7.2 - '@changesets/assemble-release-plan@6.0.9(patch_hash=scxbrhht2ttmun6dmullcw2ipu)': + '@changesets/assemble-release-plan@6.0.9(patch_hash=ef56f57067dfcc594f40d9afc7278abe38cecf1c04230936e447a60e0d58a46e)': dependencies: '@changesets/errors': 0.2.0 '@changesets/get-dependents-graph': 2.1.3 @@ -6607,10 +6617,10 @@ snapshots: transitivePeerDependencies: - encoding - '@changesets/cli@2.29.7(patch_hash=hn5w3ar5kzfvrwqaymff5f37xu)(@types/node@22.13.17)': + '@changesets/cli@2.29.7(patch_hash=0840fdb970dc9d87c5b800e1772fa7183819563f50d1bb3b5487471be7f933ba)(@types/node@22.13.17)': dependencies: '@changesets/apply-release-plan': 7.0.13 - '@changesets/assemble-release-plan': 6.0.9(patch_hash=scxbrhht2ttmun6dmullcw2ipu) + '@changesets/assemble-release-plan': 6.0.9(patch_hash=ef56f57067dfcc594f40d9afc7278abe38cecf1c04230936e447a60e0d58a46e) '@changesets/changelog-git': 0.2.1 '@changesets/config': 3.1.1 '@changesets/errors': 0.2.0 @@ -6670,7 +6680,7 @@ snapshots: '@changesets/get-release-plan@4.0.13': dependencies: - '@changesets/assemble-release-plan': 6.0.9(patch_hash=scxbrhht2ttmun6dmullcw2ipu) + '@changesets/assemble-release-plan': 6.0.9(patch_hash=ef56f57067dfcc594f40d9afc7278abe38cecf1c04230936e447a60e0d58a46e) '@changesets/config': 3.1.1 '@changesets/pre': 2.0.2 '@changesets/read': 0.6.5 @@ -6762,7 +6772,7 @@ snapshots: '@electron/get@2.0.3': dependencies: - debug: 4.4.0 + debug: 4.4.1 env-paths: 2.2.1 fs-extra: 8.1.0 got: 11.8.6 @@ -6838,7 +6848,7 @@ snapshots: '@electron/windows-sign@1.2.1': dependencies: cross-dirname: 0.1.0 - debug: 4.4.0 + debug: 4.4.1 fs-extra: 11.3.0 minimist: 1.2.8 postject: 1.0.0-alpha.6 @@ -6931,7 +6941,7 @@ snapshots: '@eslint/config-array@0.19.2': dependencies: '@eslint/object-schema': 2.1.6 - debug: 4.4.0 + debug: 4.4.1 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -6947,7 +6957,7 @@ snapshots: '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.12.6 - debug: 4.4.0 + debug: 4.4.1 espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -6960,6 +6970,8 @@ snapshots: '@eslint/js@9.16.0': {} + '@eslint/js@9.37.0': {} + '@eslint/object-schema@2.1.6': {} '@eslint/plugin-kit@0.2.8': @@ -7587,7 +7599,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.17.0(typescript@5.8.2) '@typescript-eslint/utils': 8.17.0(eslint@9.16.0(jiti@2.4.2))(typescript@5.8.2) - debug: 4.4.0 + debug: 4.4.1 eslint: 9.16.0(jiti@2.4.2) ts-api-utils: 1.4.3(typescript@5.8.2) optionalDependencies: @@ -7603,7 +7615,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.17.0 '@typescript-eslint/visitor-keys': 8.17.0 - debug: 4.4.0 + debug: 4.4.1 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -7618,7 +7630,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.29.0 '@typescript-eslint/visitor-keys': 8.29.0 - debug: 4.4.0 + debug: 4.4.1 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -8670,7 +8682,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.4.0 + debug: 4.4.1 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -10302,7 +10314,7 @@ snapshots: sumchecker@3.0.1: dependencies: - debug: 4.4.0 + debug: 4.4.1 transitivePeerDependencies: - supports-color @@ -10628,7 +10640,7 @@ snapshots: vite-node@3.1.1(@types/node@22.13.17)(jiti@2.4.2)(sass@1.86.1)(yaml@2.7.1): dependencies: cac: 6.7.14 - debug: 4.4.0 + debug: 4.4.1 es-module-lexer: 1.6.0 pathe: 2.0.3 vite: 6.2.4(@types/node@22.13.17)(jiti@2.4.2)(sass@1.86.1)(yaml@2.7.1) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a1c1e9aaa41..d3eb36f4e57 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,6 @@ packages: - "packages/**" - - "test" \ No newline at end of file + - "test" + +# 10080 minutes = 7 days +minimumReleaseAge: 10080 \ No newline at end of file diff --git a/scripts/checkDeps.js b/scripts/checkDeps.js index 9eb9ce8afa4..8337e70368e 100644 --- a/scripts/checkDeps.js +++ b/scripts/checkDeps.js @@ -8,6 +8,8 @@ const knownUnusedDevDependencies = new Set([ "typedoc-plugin-markdown", // Used in typedoc config // Eslint config doesn't get scanned by depCheck "@stylistic/eslint-plugin", + "@eslint/js", + "@eslint/eslintrc", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", "eslint-config-prettier",