Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8bfc0de
init upgrade commit
georgexu99 Sep 23, 2025
624f1b3
minimumage
georgexu99 Sep 23, 2025
2a32e98
immutable
georgexu99 Sep 24, 2025
9cf15fb
chore: upgrade to v4
georgexu99 Sep 25, 2025
f388779
don't need this yet
georgexu99 Sep 25, 2025
19c9e0d
resolve issues
georgexu99 Sep 27, 2025
634d479
chore: update yarn config and node engine requirement
georgexu99 Sep 29, 2025
832b044
add back link scripts
georgexu99 Sep 29, 2025
3cafb7c
update dev dependencies
georgexu99 Sep 30, 2025
38e2b40
fix: resolve CI failures with native builds and test fixtures
georgexu99 Sep 30, 2025
f43399a
fix links and tests
georgexu99 Oct 3, 2025
f9838e2
use individual yarn link vs dynamically generating resolutions
georgexu99 Oct 3, 2025
0303914
fix: rebuild native modules for macos-alias in CI
georgexu99 Oct 6, 2025
3f9128b
attempt to fix other errors
georgexu99 Oct 6, 2025
fc63fae
yarn lock
georgexu99 Oct 6, 2025
fba8bf0
copy out assetrelocator files to avoid yarn shenanigans
georgexu99 Oct 7, 2025
89127c0
temporarily allow scripts for native rebuilds in ci
georgexu99 Oct 7, 2025
7a2cb57
allow immutable installs on temporary test fixtures
georgexu99 Oct 7, 2025
c3103cb
address change rquest
georgexu99 Oct 8, 2025
ef6e8ca
use pregenerated lockfile and add a regeneration script
georgexu99 Oct 8, 2025
5ff7805
fix: remove unnecessary yarn environment overrides from lockfile rege…
georgexu99 Oct 8, 2025
976ca66
update yarn.locks
georgexu99 Oct 8, 2025
7e304aa
fix tests
georgexu99 Oct 9, 2025
1274322
Merge branch 'main' into gxu-yarn-upgrade
georgexu99 Oct 9, 2025
024ab13
init-link: address comments
georgexu99 Oct 9, 2025
51beeda
use npm ci instead of npm install to avoid modifying the lockfile
georgexu99 Oct 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Build Electron Forge
run: yarn build
Expand All @@ -45,7 +45,7 @@ jobs:
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .eslintcache
key: v1-lint-dependencies-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.eslintrc.json') }}
key: v2-lint-dependencies-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.eslintrc.json') }}

- name: Lint codebase
run: |
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Download build artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Download build artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ reports
packages/**/typedoc.json
.eslintcache
.vscode/settings.json
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.nx/cache
.nx/workspace-data
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.17.0
20.19.0
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ packages/*/*/typedoc.json
packages/api/core/spec/fixture/bad_external_forge_config/bad.js
packages/plugin/webpack/spec/**/.webpack
.links

/.nx/cache
/.nx/workspace-data
942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.10.2.cjs

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
enableScripts: false

# 1 week
npmMinimalAgeGate: 10080

npmPreapprovedPackages:
- '@electron/*'
- '@electron-forge/*'
- 'electron'

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.10.2.cjs
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "7.10.0",
"version": "9.0.0",
"npmClient": "yarn"
}
29 changes: 10 additions & 19 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"coverage:base",
"test",
"test:base",
"test:fast",
"test:slow"
]
}
}
},
"targetDefaults": {
"coverage:base": {
"dependsOn": ["^coverage:base"]
"dependsOn": ["^coverage:base"],
"cache": true
},
"test": {
"dependsOn": ["^test"]
"dependsOn": ["^test"],
"cache": true
},
"test:base": {
"dependsOn": ["^test:base"]
"dependsOn": ["^test:base"],
"cache": true
},
"test:fast": {
"dependsOn": ["^test:fast"]
"dependsOn": ["^test:fast"],
"cache": true
},
"test:slow": {
"dependsOn": ["^test:slow"]
"dependsOn": ["^test:slow"],
"cache": true
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
Expand Down
36 changes: 23 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,24 @@
"node": ">= 16.4.0"
},
"scripts": {
"clean": "rimraf dist && lerna exec -- rimraf dist tsconfig.tsbuildinfo",
"build": "tsc -b packages",
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\" && lerna exec -- \"node -e \\\"fs.rmSync('dist', { recursive: true, force: true })\\\" && node -e \\\"fs.rmSync('tsconfig.tsbuildinfo', { recursive: true, force: true })\\\"\"",
"build": "tsc -b packages && ts-node tools/test-dist",
"build:watch": "yarn build --watch",
"postbuild": "ts-node tools/test-dist",
"docs": "yarn build && npx typedoc",
"docs": "yarn build && typedoc",
"lerna:publish": "lerna publish --force-publish --conventional-commits --no-changelog --exact",
"lint:js": "prettier --check . --experimental-cli && eslint . --cache",
"lint:markdown": "electron-markdownlint \"**/*.md\"",
"lint:markdown-js": "electron-lint-markdown-standard --root . --ignore-path .markdownlintignore --semi \"**/*.md\"",
"lint:markdown-links": "electron-lint-markdown-links --root . --ignore-path .markdownlintignore \"**/*.md\"",
"lint": "npm run lint:js && npm run lint:markdown && npm run lint:markdown-js && npm run lint:markdown-links",
"lint:fix": "prettier --write . --experimental-cli && eslint --fix . --cache",
"link:prepare": "lerna exec -- node ../../../tools/silent.js yarn link --silent --no-bin-links --link-folder ../../../.links",
"link:remove": "lerna exec -- node ../../../tools/silent.js yarn unlink --silent --no-bin-links --link-folder ../../../.links",
"test": "xvfb-maybe vitest run --project fast --project slow",
"test:fast": "xvfb-maybe vitest run --project fast",
"test:slow": "xvfb-maybe vitest run --project slow",
"test:clear": "ts-node tools/test-clear",
"postinstall": "rimraf node_modules/.bin/*.ps1 && ts-node ./tools/gen-tsconfigs.ts && ts-node ./tools/gen-ts-glue.ts",
"prepare": "husky install",
"preversion": "yarn build"
"update:lockfile-fixtures": "ts-node tools/regenerate-lockfile-fixtures.ts",
"postinstall": "node -e \"try { fs.rmSync('node_modules/.bin/*.ps1', { recursive: true, force: true }) } catch (e) {}\" && ts-node ./tools/gen-tsconfigs.ts && ts-node ./tools/gen-ts-glue.ts",
"prepare": "husky install"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.654.0",
Expand Down Expand Up @@ -86,7 +83,7 @@
"@electron/fuses": "^1.0.0",
"@electron/lint-roller": "1.10.1",
"@types/cross-spawn": "^6.0.1",
"@types/debug": "^4.1.5",
"@types/debug": "^4.1.12",
"@types/express": "^4.17.9",
"@types/express-ws": "^3.0.0",
"@types/fs-extra": "^9.0.6",
Expand All @@ -113,12 +110,11 @@
"fork-ts-checker-webpack-plugin": "^7.2.13",
"husky": "^7.0.1",
"inquirer": "^8.0.0",
"lerna": "^7.4.2",
"lerna": "^9.0.0",
"lint-staged": "^12.1.7",
"minimist": "^1.2.6",
"msw": "^2.7.0",
"prettier": "^3.6.2",
"rimraf": "^3.0.1",
"syncpack": "^11.2.1",
"ts-node": "^10.0.0",
"typedoc": "0.25.13",
Expand Down Expand Up @@ -152,7 +148,21 @@
"prettier": {
"singleQuote": true
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f",
"dependenciesMeta": {
"@bitdisaster/exe-icon-extractor": {
"built": true
},
"electron-winstaller": {
"built": true
},
Comment on lines +153 to +158
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erickzhao can we take action items somewhere to make these not require building. Seems strange to me

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I made of note of in Slack but I'll create a separate GitHub issue for it as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fs-xattr": {
"built": true
},
"macos-alias": {
"built": true
}
},
"workspaces": {
"packages": [
"packages/api/*",
Expand Down
4 changes: 2 additions & 2 deletions packages/api/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"@electron-forge/maker-squirrel": "7.10.0",
"@electron-forge/maker-wix": "7.10.0",
"@electron-forge/maker-zip": "7.10.0",
"@electron-forge/template-fixture": "file:./spec/fixture/electron-forge-template-fixture",
"@electron-forge/template-fixture": "link:./spec/fixture/electron-forge-template-fixture",
"@electron-forge/test-utils": "7.10.0",
"@types/interpret": "^1.1.1",
"@types/progress": "^2.0.5",
"@types/rechoir": "^0.6.1",
"electron-forge-template-fixture-two": "file:./spec/fixture/electron-forge-template-fixture",
"electron-forge-template-fixture-two": "link:./spec/fixture/electron-forge-template-fixture",
"electron-installer-common": "^0.10.2",
"vitest": "^3.1.3",
"yaml-hook": "^1.0.0"
Expand Down
48 changes: 34 additions & 14 deletions packages/api/core/spec/slow/api.slow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,43 @@ describe.each([
let dir: string;

beforeAll(async () => {
await spawnPackageManager(pm, ['run', 'link:prepare']);

if (pm.executable === 'pnpm') {
await spawnPackageManager(
pm,
'config set node-linker hoisted'.split(' '),
);
// temporarily disable corepack to enable pnpm to set links
const originalCorepackStrict = process.env.COREPACK_ENABLE_STRICT;
process.env.COREPACK_ENABLE_STRICT = '0';
try {
await spawnPackageManager(
pm,
'config set node-linker hoisted'.split(' '),
);
} finally {
if (originalCorepackStrict === undefined) {
delete process.env.COREPACK_ENABLE_STRICT;
} else {
process.env.COREPACK_ENABLE_STRICT = originalCorepackStrict;
}
}
}

return async () => {
await spawnPackageManager(pm, ['run', 'link:remove']);
// Unlink packages created during tests (syntax varies by package manager)
if (pm.executable === 'yarn') {
// yarn unlink --all removes all linked packages
await spawnPackageManager(pm, ['unlink', '--all']);
} else if (pm.executable === 'pnpm') {
// pnpm doesn't support --all, and requires Corepack bypass
const originalCorepackStrict = process.env.COREPACK_ENABLE_STRICT;
process.env.COREPACK_ENABLE_STRICT = '0';
try {
await spawnPackageManager(pm, ['unlink']);
} finally {
if (originalCorepackStrict === undefined) {
delete process.env.COREPACK_ENABLE_STRICT;
} else {
process.env.COREPACK_ENABLE_STRICT = originalCorepackStrict;
}
}
}
delete process.env.NODE_INSTALLER;
};
});
Expand Down Expand Up @@ -284,8 +310,6 @@ describe.each([

expect(fs.existsSync(path.join(dir, 'forge.config.js'))).toEqual(true);

await spawnPackageManager(pm, ['install'], { cwd: dir });

await api.package({ dir });

const outDirContents = fs.readdirSync(path.join(dir, 'out'));
Expand Down Expand Up @@ -379,15 +403,11 @@ describe.each([

await api.make({ dir, skipPackage: true, outDir: `${dir}/foo` });

// Cleanup here to ensure things dont break in the make tests
// Cleanup the custom outDir
await fs.promises.rm(path.resolve(dir, 'foo'), {
recursive: true,
force: true,
});
await fs.promises.rm(path.resolve(dir, 'out'), {
recursive: true,
force: true,
});
});

describe('with prebuilt native module deps installed', () => {
Expand Down
19 changes: 19 additions & 0 deletions packages/api/core/src/api/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,25 @@ export default autoTrace(
task.title = `Resolving package manager: ${chalk.cyan(ctx.pm.executable)}`;
},
},
{
title: 'Configuring Yarn (if applicable)',
task: async ({ pm }) => {
// Yarn v4 defaults to PnP which doesn't work well with CommonJS requires in our forge config
// lets ensure that nodeLinker is set to node-modules
if (pm.executable === 'yarn') {
const yarnrcPath = path.resolve(dir, '.yarnrc.yml');
if (!(await fs.pathExists(yarnrcPath))) {
d(
'creating .yarnrc.yml with nodeLinker: node-modules',
);
await fs.writeFile(
yarnrcPath,
'nodeLinker: node-modules\n',
);
}
}
},
},
{
title: 'Installing dependencies',
task: async ({ pm }, task) => {
Expand Down
Loading
Loading