Skip to content

Commit

Permalink
Merge branch 'main' into feat/try-other-ports
Browse files Browse the repository at this point in the history
  • Loading branch information
DevanceJ authored Nov 18, 2024
2 parents 63d3e93 + 2b6da59 commit 4cbf812
Show file tree
Hide file tree
Showing 113 changed files with 3,208 additions and 3,553 deletions.
28 changes: 23 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
version: 2.1

orbs:
node: electronjs/[email protected]
node: electronjs/[email protected]

executors:
linux-medium-plus:
docker:
- image: cimg/base:stable
resource_class: medium+

commands:
install:
steps:
- run: git config --global core.autocrlf input
- node/install:
node-version: '18.15.0'
node-version: '18.20.3'
- checkout
run-lint-and-build:
steps:
Expand Down Expand Up @@ -67,6 +73,17 @@ jobs:
executor: << parameters.executor >>
steps:
- install
- when:
condition:
equal: [node/windows, << parameters.executor >>]
steps:
- run:
name: Windows Setup
shell: bash
command: |
pip install setuptools
cd 'C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script'
npm install [email protected]
- when:
condition:
equal: [node/linux, << parameters.executor >>]
Expand Down Expand Up @@ -108,13 +125,14 @@ jobs:
name: Windows Setup
shell: bash
command: |
pip install setuptools
choco install --no-progress -y wixtoolset --version=3.14.0
echo 'export PATH=$PATH:"/C/Program Files (x86)/WiX Toolset v3.14/bin"' >> "$BASH_ENV"
cd 'C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script'
npm install [email protected]
- when:
condition:
equal: [node/linux, << parameters.executor >>]
equal: [linux-medium-plus, << parameters.executor >>]
steps:
- run:
name: Linux specific setup
Expand Down Expand Up @@ -162,10 +180,10 @@ workflows:
- lint-and-build
matrix:
parameters:
executor: [node/windows, node/linux, node/macos]
executor: [node/windows, linux-medium-plus, node/macos]
arch: [x64, arm64]
exclude:
- executor: node/windows
arch: arm64
- executor: node/linux
- executor: linux-medium-plus
arch: arm64
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@
"node/no-unpublished-require": "off",
"node/shebang": "off"
}
},
{
"files": ["packages/plugin/vite/src/**/*.ts"],
"rules": {
"node/no-unpublished-import": [
"error",
{
"allowModules": ["vite"]
}
]
}
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
creds: ${{ secrets.ECOSYSTEM_ISSUE_TRIAGE_GH_APP_CREDS }}
org: electron
- name: Add to Project
uses: dsanders11/project-actions/add-item@eb760c48894b5702398529cbb8f6e98378e315d0 # v1.3.0
uses: dsanders11/project-actions/add-item@438b25e007c2f4efec324497fadc6402e7cc61a6 # v1.4.0
with:
field: Opened
field-value: ${{ github.event.pull_request.created_at || github.event.issue.created_at }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
creds: ${{ secrets.GH_APP_CREDS }}

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
fetch-depth: 0
Expand All @@ -29,7 +29,7 @@ jobs:
run: echo "sha=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT

- name: Use Node.js LTS
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20.x
cache: yarn
Expand All @@ -51,7 +51,7 @@ jobs:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

- name: Commit docs
uses: dsanders11/github-app-commit-action@48d2ff8c1a855eb15d16afa97ae12616456d7cbc # v1.4.0
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
with:
fail-on-no-changes: false
message: 'deploy: ${{ steps.get-short-sha.outputs.sha }}'
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.17.0
3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "7.4.0",
"version": "7.5.0",
"npmClient": "yarn"
}
6 changes: 6 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@
"test:slow": {
"dependsOn": ["^test:slow"]
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": ["default"]
}
}
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@
"preversion": "yarn build"
},
"dependencies": {
"@aws-sdk/abort-controller": "^3.29.0",
"@aws-sdk/client-s3": "^3.461.0",
"@aws-sdk/lib-storage": "^3.28.0",
"@aws-sdk/types": "^3.25.0",
"@aws-sdk/client-s3": "^3.654.0",
"@aws-sdk/lib-storage": "^3.654.0",
"@aws-sdk/types": "^3.654.0",
"@doyensec/electronegativity": "^1.9.1",
"@electron/get": "^3.0.0",
"@electron/osx-sign": "^1.0.5",
"@electron/packager": "^18.3.1",
"@electron/rebuild": "^3.2.10",
"@electron/packager": "^18.3.5",
"@electron/rebuild": "^3.7.0",
"@google-cloud/storage": "^7.5.0",
"@malept/cross-spawn-promise": "^2.0.0",
"@octokit/core": "^3.2.4",
Expand Down Expand Up @@ -130,7 +129,7 @@
"generate-changelog": "^1.8.0",
"husky": "^7.0.1",
"inquirer": "^8.0.0",
"lerna": "^6.6.2",
"lerna": "^7.4.2",
"lint-staged": "^12.1.7",
"minimist": "^1.2.6",
"mocha": "^9.0.1",
Expand All @@ -140,7 +139,7 @@
"rimraf": "^3.0.1",
"sinon": "^13.0.1",
"sinon-chai": "^3.6.0",
"syncpack": "^8.4.11",
"syncpack": "^11.2.1",
"ts-node": "^10.0.0",
"typedoc": "0.25.13",
"typescript": "^4.6.3",
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": "7.4.0",
"version": "7.5.0",
"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": "7.4.0",
"@electron-forge/shared-types": "7.4.0",
"@electron-forge/core": "7.5.0",
"@electron-forge/shared-types": "7.5.0",
"@electron/get": "^3.0.0",
"chalk": "^4.0.0",
"commander": "^4.1.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/api/core/helper/dynamic-import.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export declare function dynamicImport(path: string): Promise<any>;
/** Like {@link dynamicImport()}, except it tries out {@link require()} first. */
export declare function dynamicImportMaybe(path: string): Promise<any>;
22 changes: 20 additions & 2 deletions packages/api/core/helper/dynamic-import.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
const url = require('url');
const fs = require('fs');

exports.dynamicImport = function dynamicImport(path) {
return import(url.pathToFileURL(path));
exports.dynamicImport = async function dynamicImport(path) {
try {
return await import(fs.existsSync(path) ? url.pathToFileURL(path) : path);
} catch (error) {
return Promise.reject(error);
}
};

exports.dynamicImportMaybe = async function dynamicImportMaybe(path) {
try {
return require(path);
} catch (e1) {
try {
return await exports.dynamicImport(path);
} catch (e2) {
e1.message = '\n1. ' + e1.message + '\n2. ' + e2.message;
throw e1;
}
}
};
48 changes: 24 additions & 24 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": "7.4.0",
"version": "7.5.0",
"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": "7.4.0",
"@electron-forge/maker-deb": "7.4.0",
"@electron-forge/maker-dmg": "7.4.0",
"@electron-forge/maker-flatpak": "7.4.0",
"@electron-forge/maker-rpm": "7.4.0",
"@electron-forge/maker-snap": "7.4.0",
"@electron-forge/maker-squirrel": "7.4.0",
"@electron-forge/maker-wix": "7.4.0",
"@electron-forge/maker-zip": "7.4.0",
"@electron-forge/test-utils": "7.4.0",
"@electron-forge/maker-appx": "7.5.0",
"@electron-forge/maker-deb": "7.5.0",
"@electron-forge/maker-dmg": "7.5.0",
"@electron-forge/maker-flatpak": "7.5.0",
"@electron-forge/maker-rpm": "7.5.0",
"@electron-forge/maker-snap": "7.5.0",
"@electron-forge/maker-squirrel": "7.5.0",
"@electron-forge/maker-wix": "7.5.0",
"@electron-forge/maker-zip": "7.5.0",
"@electron-forge/test-utils": "7.5.0",
"@types/interpret": "^1.1.1",
"@types/progress": "^2.0.5",
"@types/rechoir": "^0.6.1",
Expand All @@ -40,20 +40,20 @@
"yaml-hook": "^1.0.0"
},
"dependencies": {
"@electron-forge/core-utils": "7.4.0",
"@electron-forge/maker-base": "7.4.0",
"@electron-forge/plugin-base": "7.4.0",
"@electron-forge/publisher-base": "7.4.0",
"@electron-forge/shared-types": "7.4.0",
"@electron-forge/template-base": "7.4.0",
"@electron-forge/template-vite": "7.4.0",
"@electron-forge/template-vite-typescript": "7.4.0",
"@electron-forge/template-webpack": "7.4.0",
"@electron-forge/template-webpack-typescript": "7.4.0",
"@electron-forge/tracer": "7.4.0",
"@electron-forge/core-utils": "7.5.0",
"@electron-forge/maker-base": "7.5.0",
"@electron-forge/plugin-base": "7.5.0",
"@electron-forge/publisher-base": "7.5.0",
"@electron-forge/shared-types": "7.5.0",
"@electron-forge/template-base": "7.5.0",
"@electron-forge/template-vite": "7.5.0",
"@electron-forge/template-vite-typescript": "7.5.0",
"@electron-forge/template-webpack": "7.5.0",
"@electron-forge/template-webpack-typescript": "7.5.0",
"@electron-forge/tracer": "7.5.0",
"@electron/get": "^3.0.0",
"@electron/packager": "^18.3.1",
"@electron/rebuild": "^3.2.10",
"@electron/packager": "^18.3.5",
"@electron/rebuild": "^3.7.0",
"@malept/cross-spawn-promise": "^2.0.0",
"chalk": "^4.0.0",
"debug": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/src/api/init-scripts/find-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ForgeTemplate } from '@electron-forge/shared-types';
import debug from 'debug';
import resolvePackage from 'resolve-package';

import { PossibleModule } from '../../util/require-search';
import { PossibleModule } from '../../util/import-search';

const d = debug('electron-forge:init:find-template');

Expand Down
24 changes: 21 additions & 3 deletions packages/api/core/src/api/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import logSymbols from 'log-symbols';

import getForgeConfig from '../util/forge-config';
import { getHookListrTasks, runMutatingHook } from '../util/hook';
import importSearch from '../util/import-search';
import getCurrentOutDir from '../util/out-dir';
import parseArchs from '../util/parse-archs';
import { readMutatedPackageJson } from '../util/read-package-json';
import requireSearch from '../util/require-search';
import resolveDir from '../util/resolve-dir';

import { listrPackage } from './package';
Expand Down Expand Up @@ -168,7 +168,7 @@ export const listrMake = (
throw new Error(`The following maker config has a maker name that is not a string: ${JSON.stringify(resolvableTarget)}`);
}

const MakerClass = requireSearch<typeof MakerImpl>(dir, [resolvableTarget.name]);
const MakerClass = await importSearch<typeof MakerImpl>(dir, [resolvableTarget.name]);
if (!MakerClass) {
throw new Error(
`Could not find module with name '${resolvableTarget.name}'. If this is a package from NPM, make sure it's listed in the devDependencies of your package.json. If this is a local module, make sure you have the correct path to its entry point. Try using the DEBUG="electron-forge:require-search" environment variable for more information.`
Expand Down Expand Up @@ -317,10 +317,28 @@ export const listrMake = (
task: childTrace<Parameters<ForgeListrTaskFn<MakeContext>>>({ name: 'run-postMake-hook', category: '@electron-forge/core' }, async (_, ctx, task) => {
// If the postMake hooks modifies the locations / names of the outputs it must return
// the new locations so that the publish step knows where to look
const originalOutputs = JSON.stringify(ctx.outputs);
ctx.outputs = await runMutatingHook(ctx.forgeConfig, 'postMake', ctx.outputs);

let outputLocations = [path.resolve(ctx.actualOutDir, 'make')];
if (originalOutputs !== JSON.stringify(ctx.outputs)) {
const newDirs = new Set<string>();
const artifactPaths = [];
for (const result of ctx.outputs) {
for (const artifact of result.artifacts) {
newDirs.add(path.dirname(artifact));
artifactPaths.push(artifact);
}
}
if (newDirs.size <= ctx.outputs.length) {
outputLocations = [...newDirs];
} else {
outputLocations = artifactPaths;
}
}
receiveMakeResults?.(ctx.outputs);

task.output = `Artifacts available at: ${chalk.green(path.resolve(ctx.actualOutDir, 'make'))}`;
task.output = `Artifacts available at: ${chalk.green(outputLocations.join(', '))})}`;
}),
rendererOptions: {
persistentOutput: true,
Expand Down
Loading

0 comments on commit 4cbf812

Please sign in to comment.