-
-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move create-electron-app into forge (#2988)
* feat: move create-electron-app into forge * build: do stuff * build: how dare we ignore this file * chore: add README * fix: name bin for cre correctly * fix: disable eslint for CEA * build: bust ci cache * fix: set version to 74 * debug: remove windows-latest run * debug: bump windows bolt 0.21.2 -> 0.24.10 * debug: pre-install cli * debug: bolt to 0.22.4 * build: make stub electron-forge.js file in dist for windows build to work * Revert "debug: bolt to 0.22.4" This reverts commit 8d63243. * Revert "debug: pre-install cli" This reverts commit dcb2a66. * Revert "debug: bump windows bolt 0.21.2 -> 0.24.10" This reverts commit 2458c60. * Revert "debug: remove windows-latest run" This reverts commit 37847a2. * Revert "build: bust ci cache" This reverts commit 4b35ffe. * build: move stub folder to preinstall hook * Reland: bump windows bolt 0.21.2 -> 0.24.10 * build: add shim script for windows, remove unneeded deps * build: improve tools/maybe-shim-windows.js Co-authored-by: Samuel Attard <sam@electronjs.org> Co-authored-by: Samuel Attard <sattard@salesforce.com> Co-authored-by: Samuel Attard <sam@electronjs.org>
- Loading branch information
1 parent
524e3cd
commit a2eadbc
Showing
7 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(shimPath) { | ||
fs.mkdirSync(path.dirname(shimPath), { recursive: true }); | ||
fs.writeFileSync(shimPath, ''); | ||
} | ||
|
||
async function main() { | ||
const srcRoot = path.resolve(__dirname, '..'); | ||
const cli = path.resolve(srcRoot, 'packages', 'api', 'cli', 'dist', 'electron-forge.js'); | ||
const cea = path.resolve(srcRoot, 'packages', 'external', 'create-electron-app', 'dist', 'index.js'); | ||
createShim(cli); | ||
createShim(cea); | ||
} | ||
|
||
if (process.platform === 'win32') { | ||
main().catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); | ||
} |