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

feat: move create-electron-app into forge #2988

Merged
merged 22 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e2161a4
feat: move create-electron-app into forge
VerteDinde Oct 25, 2022
74e10b1
build: do stuff
MarshallOfSound Oct 26, 2022
c9495ca
build: how dare we ignore this file
MarshallOfSound Oct 26, 2022
23ba2db
chore: add README
VerteDinde Oct 26, 2022
f5fa94f
fix: name bin for cre correctly
MarshallOfSound Oct 26, 2022
aaa6ef6
fix: disable eslint for CEA
MarshallOfSound Oct 26, 2022
4b35ffe
build: bust ci cache
MarshallOfSound Oct 27, 2022
27465bb
fix: set version to 74
MarshallOfSound Nov 1, 2022
37847a2
debug: remove windows-latest run
VerteDinde Nov 1, 2022
2458c60
debug: bump windows bolt 0.21.2 -> 0.24.10
VerteDinde Nov 1, 2022
dcb2a66
debug: pre-install cli
VerteDinde Nov 1, 2022
8d63243
debug: bolt to 0.22.4
VerteDinde Nov 1, 2022
ad6d8f1
build: make stub electron-forge.js file in dist for windows build to …
MarshallOfSound Nov 1, 2022
27c9450
Revert "debug: bolt to 0.22.4"
MarshallOfSound Nov 1, 2022
aee22f8
Revert "debug: pre-install cli"
MarshallOfSound Nov 1, 2022
8e6bdf5
Revert "debug: bump windows bolt 0.21.2 -> 0.24.10"
MarshallOfSound Nov 1, 2022
7f7253f
Revert "debug: remove windows-latest run"
MarshallOfSound Nov 1, 2022
b1cc95a
Revert "build: bust ci cache"
VerteDinde Nov 1, 2022
0bc588a
build: move stub folder to preinstall hook
VerteDinde Nov 1, 2022
181c8c3
Reland: bump windows bolt 0.21.2 -> 0.24.10
VerteDinde Nov 1, 2022
af016b6
build: add shim script for windows, remove unneeded deps
VerteDinde Nov 1, 2022
dcdcc6c
build: improve tools/maybe-shim-windows.js
VerteDinde Nov 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"bolt": {
"workspaces": [
"packages/api/*",
"packages/external/*",
"packages/maker/*",
"packages/publisher/*",
"packages/utils/*",
Expand All @@ -31,6 +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": "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"
},
Expand Down
27 changes: 27 additions & 0 deletions packages/external/create-electron-app/README.md
Original file line number Diff line number Diff line change
@@ -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
```
15 changes: 15 additions & 0 deletions packages/external/create-electron-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "create-electron-app",
"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.74"
},
"bin": {
"create-electron-app": "dist/index.js"
}
}
4 changes: 4 additions & 0 deletions packages/external/create-electron-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

/* eslint-disable */
import '@electron-forge/cli/dist/electron-forge-init';
27 changes: 27 additions & 0 deletions tools/maybe-shim-windows.js
Original file line number Diff line number Diff line change
@@ -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'));
}
VerteDinde marked this conversation as resolved.
Show resolved Hide resolved

if (process.platform === 'win32') {
main().catch((err) => {
console.error(err);
process.exit(1);
});
}