Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #1

Merged
merged 22 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9295f80
fix: pass this.config when calling internal hooks (#3126)
albertxing Jan 8, 2023
1fc62ec
chore: add `.gitattributes` file for proper handling of line endings …
erikian Jan 9, 2023
1af6c2d
build(deps): bump json5 from 1.0.1 to 1.0.2 (#3133)
dependabot[bot] Jan 9, 2023
6a118c6
fix(cli): use fallback renderer for any DEBUG vars (#3135)
erickzhao Jan 10, 2023
4c813a7
fix(package): ensure `electron-packager` throws if fails (#3136)
erickzhao Jan 11, 2023
45c46f4
chore: update repo link from userland migration (#3138)
dsanders11 Jan 12, 2023
0720e07
chore: set @wg-ecosystem as CODEOWNERS (#3143)
dsanders11 Jan 23, 2023
b985924
build: update dependencies to clean up yarn audit
MarshallOfSound Jan 31, 2023
663a0f8
ci: create a `test:slow` script to avoid re-running fast tests in the…
erikian Feb 1, 2023
8ed43ee
build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (#3156)
dependabot[bot] Feb 3, 2023
3d5c87c
fix(publisher-ers): Update ERS API usage for v2.0 (#3149)
ArekSredzki Feb 7, 2023
fd9de41
chore(maker-rpm): map arm64 -> aarch64 (#3137)
dsanders11 Feb 7, 2023
a8c8192
fix(build): ensure lerna publishes exact versions
erickzhao Feb 7, 2023
89d0cd2
v6.0.5
erickzhao Feb 7, 2023
5a8e41c
chore: gitignore `lerna-debug.log` (#3162)
erickzhao Feb 7, 2023
71569f8
docs: update release process guide (#3161)
erickzhao Feb 7, 2023
6856204
ci: use action-semantic-pull-request (#3144)
dsanders11 Feb 7, 2023
133ad63
feat: add Fuses plugin (#3132)
erikian Feb 21, 2023
8f485cc
ci: fix the build and tests (#3173)
erickzhao Feb 22, 2023
a98e2cb
ci: run tests in merge queue (#3174)
dsanders11 Feb 23, 2023
b026eea
Merge branch 'main' into caoxie-vite
erickzhao Feb 24, 2023
b465708
chore: update version numbers
erickzhao Feb 24, 2023
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @electron/wg-ecosystem
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
merge_group:

jobs:
fast-tests:
Expand All @@ -23,13 +24,10 @@ jobs:
with:
node-version: 14.x
cache: yarn
- name: Install latest NPM on Windows
- name: Install npm 8 on Windows
if: matrix.os == 'windows-latest'
# See https://github.com/actions/virtual-environments/issues/4856#issuecomment-1043256330
# and https://github.com/actions/setup-node/issues/411#issuecomment-1051084491
run: |
npm install -g npm@8.3.1
npm install -g npm@latest
npm install -g npm@8
- name: Install
run: yarn install
- name: Lint
Expand All @@ -54,6 +52,7 @@ jobs:
if: matrix.os == 'windows-latest'
shell: bash
run: |
npm install -g npm@8
echo 'C:\Program Files (x86)\WiX Toolset v3.11\bin' >> $GITHUB_PATH
npm config set node-gyp "$GITHUB_WORKSPACE\node_modules\node-gyp\bin\node-gyp.js"
- name: Linux specific setup
Expand All @@ -72,10 +71,10 @@ jobs:
node-version: 14.x
cache: yarn
- name: Install
run: yarn install
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Test
run: yarn test
run: yarn test:slow
env:
DEBUG: electron-installer-snap:snapcraft
26 changes: 26 additions & 0 deletions .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Check Semantic Commit'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
contents: read

jobs:
main:
permissions:
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: semantic-pull-request
uses: amannn/action-semantic-pull-request@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb # tag: v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dist
docs
doc
node_modules
lerna-debug.log
yarn-error.log
packages/**/.npmignore
packages/**/tsconfig.json
Expand Down
55 changes: 35 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,38 @@ Here are some things to keep in mind as you file pull requests to fix bugs, add
- If you are continuing the work of another person's PR and need to rebase/squash, please retain the
attribution of the original author(s) and continue the work in subsequent commits.

### Release process

- Make sure the tests pass with `yarn test`
- Run `git clean -fdx` - this will ensure unneeded build files (and potentially sensitive files) are not included in the npm package.
- Ensure that you are logged into npm via command line (`npm login`)
- Run `yarn lerna:publish`, which will run the `lerna publish` command with a necessary set of flags.
- The script will then ask you for your `npm` OTP password.
- The script will commit the changes automatically. Run `git log` to confirm that the changes have been
committed.
- The command will have published your packages to `npm`, and pushed an appropriate tag to github.
- After running the command, you should have a commit which:
- Updates the version field in the package.json file
- Updates the version fields in each of the submodule package.json files
- Push your commit upstream to the main/default branch.
- Create a new github release
- Go to releases tab
- Draft a new release and choose the appropriate tag
- Target default branch
- Generate release notes by copying in CHANGELOG.md contents into the release description or use
GitHub's [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)
## Release process

This guide is for maintainers who have:

- Push access to the `electron/forge` repository.
- Collaborator access to the `@electron-forge` packages on npm.

### 1. Prepare your local code checkout

- Switch to the tip of the `main` branch with `git switch main && git pull`.
- Run tests locally with `yarn test`.
- Check that the latest CI run passed on `main` on [GitHub](https://github.com/electron/forge/actions?query=workflow:CI).
- Remove all untracked files and directories from your checkout with `git clean -fdx`.
- Install dependencies with `yarn install`.

### 2. Publish all npm packages

- Log into npm with `npm login`.
- Run the `yarn lerna:publish` command.
- Enter your npm account's time-based one-time password (TOTP).

The `lerna:publish` script will automatically increment the next package version based on the
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. From there, it does two things:

1. It creates a tagged commit that bumps the version number in `package.json` at the root and package levels
and pushes the commit and tag to GitHub.
1. It publishes every `@electron-forge/` package to npm.

### 3. Publish release to GitHub

- Go to the repo's [New Release](https://github.com/electron/forge/releases/new) page.
- Select tag you just published.
- Target the `main` branch.
- [Automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)
against the previous Forge release.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "6.0.4",
"version": "6.0.5",
"npmClient": "yarn"
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
"docs": "yarn build && yarn docs:generate",
"docs:generate": "yarn docs:plugin && node --max-old-space-size=8192 -r ts-node/register ./tools/gen-docs.ts",
"docs:plugin": "cd ./tools/doc-plugin && yarn build",
"lerna:publish": "lerna publish --force-publish --conventional-commits --no-changelog",
"lerna:publish": "lerna publish --force-publish --conventional-commits --no-changelog --exact",
"lint": "prettier --check . && eslint .",
"lint:fix": "prettier --write .",
"link:prepare": "lerna exec -- node ../../../tools/silent.js yarn link --link-folder ../../../.links --silent --no-bin-links",
"test": "xvfb-maybe cross-env LINK_FORGE_DEPENDENCIES_ON_INIT=1 TS_NODE_PROJECT='./tsconfig.test.json' TS_NODE_FILES=1 mocha './tools/test-globber.ts'",
"test:fast": "xvfb-maybe cross-env LINK_FORGE_DEPENDENCIES_ON_INIT=1 TS_NODE_PROJECT='./tsconfig.test.json' TEST_FAST_ONLY=1 TS_NODE_FILES=1 mocha './tools/test-globber.ts'",
"test:slow": "xvfb-maybe cross-env LINK_FORGE_DEPENDENCIES_ON_INIT=1 TS_NODE_PROJECT='./tsconfig.test.json' TEST_SLOW_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",
"prepare": "husky install",
"preversion": "yarn build"
Expand Down Expand Up @@ -78,6 +79,7 @@
"yarn-or-npm": "^3.0.1"
},
"devDependencies": {
"@electron/fuses": ">=1.0.0",
"@knodes/typedoc-plugin-monorepo-readmes": "0.22.5",
"@malept/eslint-config": "^2.0.0",
"@types/chai": "^4.2.12",
Expand Down Expand Up @@ -151,6 +153,9 @@
"electron-wix-msi": "^5.0.0",
"macos-alias": "^0.2.11"
},
"peerDependencies": {
"@electron/fuses": ">=1.0.0"
},
"lint-staged": {
"*.{html,json,md,yml}": "prettier --write",
"*.{js,ts}": [
Expand Down
6 changes: 3 additions & 3 deletions packages/api/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@electron-forge/cli",
"version": "6.0.4",
"version": "6.0.5",
"description": "A complete tool for building modern Electron applications",
"repository": "https://github.com/electron/forge",
"author": "Samuel Attard",
Expand All @@ -17,8 +17,8 @@
"mocha": "^9.0.1"
},
"dependencies": {
"@electron-forge/core": "6.0.4",
"@electron-forge/shared-types": "6.0.4",
"@electron-forge/core": "6.0.5",
"@electron-forge/shared-types": "6.0.5",
"@electron/get": "^2.0.0",
"chalk": "^4.0.0",
"commander": "^4.1.1",
Expand Down
38 changes: 19 additions & 19 deletions packages/api/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@electron-forge/core",
"version": "6.0.4",
"version": "6.0.5",
"description": "A complete tool for building modern Electron applications",
"repository": "https://github.com/electron/forge",
"main": "dist/api/index.js",
Expand All @@ -15,16 +15,16 @@
"test:slow": "yarn test:base test/slow/**/*_spec_slow.ts"
},
"devDependencies": {
"@electron-forge/maker-appx": "6.0.4",
"@electron-forge/maker-deb": "6.0.4",
"@electron-forge/maker-dmg": "6.0.4",
"@electron-forge/maker-flatpak": "6.0.4",
"@electron-forge/maker-rpm": "6.0.4",
"@electron-forge/maker-snap": "6.0.4",
"@electron-forge/maker-squirrel": "6.0.4",
"@electron-forge/maker-wix": "6.0.4",
"@electron-forge/maker-zip": "6.0.4",
"@electron-forge/test-utils": "6.0.4",
"@electron-forge/maker-appx": "6.0.5",
"@electron-forge/maker-deb": "6.0.5",
"@electron-forge/maker-dmg": "6.0.5",
"@electron-forge/maker-flatpak": "6.0.5",
"@electron-forge/maker-rpm": "6.0.5",
"@electron-forge/maker-snap": "6.0.5",
"@electron-forge/maker-squirrel": "6.0.5",
"@electron-forge/maker-wix": "6.0.5",
"@electron-forge/maker-zip": "6.0.5",
"@electron-forge/test-utils": "6.0.5",
"@types/interpret": "^1.1.1",
"@types/progress": "^2.0.5",
"@types/rechoir": "^0.6.1",
Expand All @@ -40,14 +40,14 @@
"yaml-hook": "^1.0.0"
},
"dependencies": {
"@electron-forge/core-utils": "6.0.4",
"@electron-forge/maker-base": "6.0.4",
"@electron-forge/plugin-base": "6.0.4",
"@electron-forge/publisher-base": "6.0.4",
"@electron-forge/shared-types": "6.0.4",
"@electron-forge/template-base": "6.0.4",
"@electron-forge/template-webpack": "6.0.4",
"@electron-forge/template-webpack-typescript": "6.0.4",
"@electron-forge/core-utils": "6.0.5",
"@electron-forge/maker-base": "6.0.5",
"@electron-forge/plugin-base": "6.0.5",
"@electron-forge/publisher-base": "6.0.5",
"@electron-forge/shared-types": "6.0.5",
"@electron-forge/template-base": "6.0.5",
"@electron-forge/template-webpack": "6.0.5",
"@electron-forge/template-webpack-typescript": "6.0.5",
"@electron/get": "^2.0.0",
"@electron/rebuild": "^3.2.10",
"@malept/cross-spawn-promise": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default async ({
collapseErrors: false,
},
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG && process.env.DEBUG.includes('electron-forge')),
rendererFallback: Boolean(process.env.DEBUG),
};

const runner = new Listr(
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default async ({ dir = process.cwd(), interactive = false, copyCIFiles =
{
concurrent: false,
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG && process.env.DEBUG.includes('electron-forge')),
rendererFallback: Boolean(process.env.DEBUG),
}
);

Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const listrMake = (
collapseErrors: false,
},
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG && process.env.DEBUG.includes('electron-forge')),
rendererFallback: Boolean(process.env.DEBUG),
};

const runner = new Listr<MakeContext>(
Expand Down
17 changes: 10 additions & 7 deletions packages/api/core/src/api/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ export const listrPackage = ({

task.output = 'Determining targets...';

let provideTargets: (targets: TargetDefinition[]) => void;
const targetsPromise = new Promise<InternalTargetDefinition[]>((resolve) => {
provideTargets = resolve;
});

type StepDoneSignalMap = Map<string, (() => void)[]>;
const signalCopyDone: StepDoneSignalMap = new Map();
const signalRebuildDone: StepDoneSignalMap = new Map();
Expand All @@ -186,6 +181,12 @@ export const listrPackage = ({
});
};

let provideTargets: (targets: TargetDefinition[]) => void;
const targetsPromise = new Promise<InternalTargetDefinition[]>((resolve, reject) => {
provideTargets = resolve;
rejects.push(reject);
});

const rebuildTasks = new Map<string, Promise<ForgeListrTask<never>>[]>();
const signalRebuildStart = new Map<string, ((task: ForgeListrTask<never>) => void)[]>();

Expand Down Expand Up @@ -309,7 +310,9 @@ export const listrPackage = ({
// rejects is populated by the reject handlers for every
// signal based promise in every subtask
ctx.packagerPromise.catch((err) => {
for (const reject of rejects) reject(err);
for (const reject of rejects) {
reject(err);
}
});

const targets = await targetsPromise;
Expand Down Expand Up @@ -430,7 +433,7 @@ export const listrPackage = ({
{
concurrent: false,
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG && process.env.DEBUG.includes('electron-forge')),
rendererFallback: Boolean(process.env.DEBUG),
rendererOptions: {
collapse: false,
collapseErrors: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const publish = async ({
collapseErrors: false,
},
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG && process.env.DEBUG.includes('electron-forge')),
rendererFallback: Boolean(process.env.DEBUG),
};

const publishDistributablesTasks = [
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async ({
collapseErrors: false,
},
rendererSilent: !interactive,
rendererFallback: Boolean(process.env.DEBUG && process.env.DEBUG.includes('electron-forge')),
rendererFallback: Boolean(process.env.DEBUG),
};

const runner = new Listr<StartContext>(
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/util/plugin-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default class PluginInterface implements IForgePluginInterface {
task: async (_, task) => {
if ((hook as any).__hookName) {
// Also give it the task
await (hook as any).call(task, ...(hookArgs as any[]));
await (hook as any).call(task, this.config, ...(hookArgs as any[]));
} else {
await hook(this.config, ...hookArgs);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/external/create-electron-app/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "create-electron-app",
"version": "6.0.4",
"version": "6.0.5",
"description": "Create Electron App",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Samuel Attard",
"license": "MIT",
"dependencies": {
"@electron-forge/cli": "6.0.4"
"@electron-forge/cli": "6.0.5"
},
"bin": {
"create-electron-app": "dist/index.js"
Expand Down
6 changes: 3 additions & 3 deletions packages/maker/appx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@electron-forge/maker-appx",
"version": "6.0.4",
"version": "6.0.5",
"description": "AppX maker for Electron Forge",
"repository": "https://github.com/electron/forge",
"author": "Samuel Attard",
Expand All @@ -15,8 +15,8 @@
"node": ">= 14.17.5"
},
"dependencies": {
"@electron-forge/maker-base": "6.0.4",
"@electron-forge/shared-types": "6.0.4",
"@electron-forge/maker-base": "6.0.5",
"@electron-forge/shared-types": "6.0.5",
"cross-spawn": "^7.0.3",
"fs-extra": "^10.0.0",
"parse-author": "^2.0.0"
Expand Down
Loading