From 8c49e38c1badf01c0393cb8ebbc41995d2d0b214 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Tue, 18 Jun 2019 10:07:01 -0700 Subject: [PATCH 1/6] fix: Update .gitignore with more deets --- packages/api/core/tmpl/_gitignore | 91 ++++++++++++++++++- .../template/webpack/src/WebpackTemplate.ts | 2 +- 2 files changed, 90 insertions(+), 3 deletions(-) diff --git a/packages/api/core/tmpl/_gitignore b/packages/api/core/tmpl/_gitignore index 9209ef5bfd..8e3a106692 100644 --- a/packages/api/core/tmpl/_gitignore +++ b/packages/api/core/tmpl/_gitignore @@ -1,2 +1,89 @@ -node_modules -out +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock +.DS_Store + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# Webpack +.webpack/ + +# Electron-Forge +out/ diff --git a/packages/template/webpack/src/WebpackTemplate.ts b/packages/template/webpack/src/WebpackTemplate.ts index a57746571e..063fdf68e6 100644 --- a/packages/template/webpack/src/WebpackTemplate.ts +++ b/packages/template/webpack/src/WebpackTemplate.ts @@ -39,7 +39,7 @@ class WebpackTemplate implements ForgeTemplate { }); }); await asyncOra('Setting up webpack configuration', async () => { - await fs.appendFile(path.resolve(directory, '.gitignore'), '.webpack\n'); + await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'README.md'), path.resolve(directory, 'README.md')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.main.config.js'), path.resolve(directory, 'webpack.main.config.js')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.renderer.config.js'), path.resolve(directory, 'webpack.renderer.config.js')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.rules.js'), path.resolve(directory, 'webpack.rules.js')); From 76be7281b9fb489fafc26fce92d64bd613ecf5f9 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Tue, 18 Jun 2019 10:07:12 -0700 Subject: [PATCH 2/6] docs: Add some details to renderer.js --- packages/template/webpack/tmpl/renderer.js | 30 +++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/template/webpack/tmpl/renderer.js b/packages/template/webpack/tmpl/renderer.js index 6e7abde768..b1554f314a 100644 --- a/packages/template/webpack/tmpl/renderer.js +++ b/packages/template/webpack/tmpl/renderer.js @@ -1 +1,29 @@ -console.log('Heya, this is coming from a webpack bundle'); +/** + * This file will automatically be loaded by webpack and run in the "renderer" context. + * To learn more about the differences between the "main" and the "renderer" context in + * Electron, visit: + * + * https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes + * + * By default, Node.js integration in this file is disabled. When enabling Node.js integration + * in a renderer process, please be aware of potential security implications. You can read + * more about security risks here: + * + * https://electronjs.org/docs/tutorial/security + * + * To enable Node.js integration in this file, open up `main.js` and enable the `nodeIntegration` + * flag: + * + * ``` + * // Create the browser window. + * mainWindow = new BrowserWindow({ + * width: 800, + * height: 600, + * webPreferences: { + * nodeIntegration: true + * } + * }); + * ``` + */ + +console.log(`👋 This message is being logged by "renderer.js", included via webpack`); From 5c686386a753dd0ebe62443dd4236d60d1c7805f Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Tue, 18 Jun 2019 10:07:32 -0700 Subject: [PATCH 3/6] docs: Add a README --- packages/template/webpack/tmpl/README.md | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 packages/template/webpack/tmpl/README.md diff --git a/packages/template/webpack/tmpl/README.md b/packages/template/webpack/tmpl/README.md new file mode 100644 index 0000000000..abcdb1459b --- /dev/null +++ b/packages/template/webpack/tmpl/README.md @@ -0,0 +1,41 @@ +# Electron Template + +This is the official template for new Electron applications, using Electron, the `electron-forge` command line tool, +and Webpack. To create a new repository using this template, [click here][generate]. + +## Prerequisites + +You will need the following things properly installed on your computer. + +* [Git](https://git-scm.com/) +* [Node.js](https://nodejs.org/) + +## Installation + +* [Create a new repository from this template][generate] +* `git clone ` this repository +* `cd template` +* `npm install` + +## Running / Development + +* `npm start` +* Your app automatically starts + +### Packaging + +* To create binaries, run `npm run package` +* To create installers, run `npm run make` + +Both commands will create binaries and installers for the platform you're running on. + +## Further Reading / Useful Links + +* [Electron](https://www.electronjs.org) +* [Electron Documentation](https://electronjs.org/docs) +* [Electron Forge](https://www.electronforge.io) + +* [Webpack Documentation](https://webpack.js.org/) +* [Node.js Documentation](https://nodejs.org/en/docs/) + +[generate]: https://github.com/electron/template/generate \ No newline at end of file From 82011ff921278f476b4d85ced1ed92bf46a3e525 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Tue, 18 Jun 2019 10:15:42 -0700 Subject: [PATCH 4/6] feat: Improve the core index.html a little bit --- packages/api/core/tmpl/index.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/api/core/tmpl/index.html b/packages/api/core/tmpl/index.html index e11c582a95..69ba2a448c 100644 --- a/packages/api/core/tmpl/index.html +++ b/packages/api/core/tmpl/index.html @@ -1,10 +1,19 @@ - - + + Hello World! + - Well hey there!!! +

💖 Hello World!

3 +

Welcome to your first Electron application.

- + \ No newline at end of file From 756a209d02b9b564db3b9d38e6887ab1a531dfda Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Wed, 19 Jun 2019 12:35:34 -0700 Subject: [PATCH 5/6] Update packages/api/core/tmpl/index.html Co-Authored-By: Mark Lee --- packages/api/core/tmpl/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/api/core/tmpl/index.html b/packages/api/core/tmpl/index.html index 69ba2a448c..d4cb3586fa 100644 --- a/packages/api/core/tmpl/index.html +++ b/packages/api/core/tmpl/index.html @@ -14,6 +14,6 @@

💖 Hello World!

3 -

Welcome to your first Electron application.

+

Welcome to your Electron application.

- \ No newline at end of file + From 184c08d65519f942eed7501572b67bcdf97a0960 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 20 Jun 2019 07:16:20 -0700 Subject: [PATCH 6/6] Remove the README for now --- .../template/webpack/src/WebpackTemplate.ts | 1 - packages/template/webpack/tmpl/README.md | 41 ------------------- 2 files changed, 42 deletions(-) delete mode 100644 packages/template/webpack/tmpl/README.md diff --git a/packages/template/webpack/src/WebpackTemplate.ts b/packages/template/webpack/src/WebpackTemplate.ts index 063fdf68e6..9df52204af 100644 --- a/packages/template/webpack/src/WebpackTemplate.ts +++ b/packages/template/webpack/src/WebpackTemplate.ts @@ -39,7 +39,6 @@ class WebpackTemplate implements ForgeTemplate { }); }); await asyncOra('Setting up webpack configuration', async () => { - await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'README.md'), path.resolve(directory, 'README.md')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.main.config.js'), path.resolve(directory, 'webpack.main.config.js')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.renderer.config.js'), path.resolve(directory, 'webpack.renderer.config.js')); await fs.copy(path.resolve(__dirname, '..', 'tmpl', 'webpack.rules.js'), path.resolve(directory, 'webpack.rules.js')); diff --git a/packages/template/webpack/tmpl/README.md b/packages/template/webpack/tmpl/README.md deleted file mode 100644 index abcdb1459b..0000000000 --- a/packages/template/webpack/tmpl/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Electron Template - -This is the official template for new Electron applications, using Electron, the `electron-forge` command line tool, -and Webpack. To create a new repository using this template, [click here][generate]. - -## Prerequisites - -You will need the following things properly installed on your computer. - -* [Git](https://git-scm.com/) -* [Node.js](https://nodejs.org/) - -## Installation - -* [Create a new repository from this template][generate] -* `git clone ` this repository -* `cd template` -* `npm install` - -## Running / Development - -* `npm start` -* Your app automatically starts - -### Packaging - -* To create binaries, run `npm run package` -* To create installers, run `npm run make` - -Both commands will create binaries and installers for the platform you're running on. - -## Further Reading / Useful Links - -* [Electron](https://www.electronjs.org) -* [Electron Documentation](https://electronjs.org/docs) -* [Electron Forge](https://www.electronforge.io) - -* [Webpack Documentation](https://webpack.js.org/) -* [Node.js Documentation](https://nodejs.org/en/docs/) - -[generate]: https://github.com/electron/template/generate \ No newline at end of file