# electron-demo-app **Repository Path**: yunxian_zfy/electron-demo-app ## Basic Information - **Project Name**: electron-demo-app - **Description**: 广泛记录各种不同用处的angular为基础的项目搭建方式 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-11-26 - **Last Updated**: 2023-03-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: Angular, Electron ## README # ElectronDemoApp This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.1. ## 1 Development server Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. ## 2 Code scaffolding Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. ## 3 Build Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. ## 4 搭建流程 ### 4.1 安装所需依赖 #### ~~4.1.1. `npm install --save typeorm`~~ #### ~~4.1.2. `npm install --save reflect-metadata`~~ #### 4.1.3. `npm install --save-dev electron` * (你可能需要设置国内镜像: `npm config set ELECTRON_MIRROR="http://npm.taobao.org/mirrors/electron/"`) #### 4.1.4. `npm install --save-dev electron-builder` #### 4.1.5. `npm install --save-dev electron-reload` #### 4.1.6. `npm install --save-dev lodash` #### 4.1.7. `npm install --save-dev npm-run-all` #### 4.1.8. `npm install --save-dev wait-on` #### ~~4.1.9. `npm install --save-dev node-sass`~~ ### 4.2 如何在项目中配置 #### ~~4.2.1~~ ```ts import "reflect-metadata"; // 在项目主目录中进入,例如 app.component.ts ``` #### 4.2.2 更新index.html (也可参考 https://fireship.io/lessons/desktop-apps-with-electron-and-angular/) ```html ``` #### 4.2.3 main.ts / main.js #### 4.2.4 tsconfig.json ```json "emitDecoratorMetadata": true, "experimentalDecorators": true, ``` #### 4.2.5 angular.json ```json "outputPath": "dist", ``` #### 4.2.6 tsconfig.app.json ```json "compilerOptions":{ "types": [ "node" ], "typeRoots": [ "node_modules/@types" ] } ``` ## Running unit tests Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). ## Running end-to-end tests Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. ## Further help To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.