Skip to content

Commit

Permalink
chore: enable managed manifest mode (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra authored Feb 16, 2024
1 parent d7a5ffd commit 180992b
Show file tree
Hide file tree
Showing 10 changed files with 2,164 additions and 1,946 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
- name: Check for linting errors
run: npm run lint
- name: Check for build errors
run: npm run build
run: npm run bld
- name: Run test suite
run: npm test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/cache
/dist
/dist-ng
/dist-nw
/tmp
/out
/out-tsc
/bazel-out

Expand Down
62 changes: 11 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,19 @@
# NW.js and Angular CLI example

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.8. Though dependencies have been updated since then. You'll likely want to clone from `main` rather than use the latest release. Here is the [diff between the latest release and main](https://github.com/nwutils/nw-angular-cli-example/compare/v1.3.0...main).
# NW.js Angular CLI example

An example of running Angular with NW.js.

![A Screenshot of the default app running on Windows](screenshot.png)

## Getting started

## Running Locally for development

1. `npm install`
1. `npm start`
1. Webpack will spin up (takes a moment) then a window will pop up

You can also run this repo in a regular browser with `npm run start:web`, but will need to add conditionals into your code to skip desktop-specific code (`if (window.nw) {}`).


## Building for distribution

1. `npm run build:clean` will delete your `./dist` and `/dist-ng` folders
1. `npm run build:ng` will build just your Angular app for distribution (`./dist-ng`)
1. `npm run build:nw` will build just your NW.js app (`./dist`)
1. `npm run build` is your all-in-one command. It will clean out the old dist folders and build your Angular and NW.js app


# **IMPORTANT NOTE ABOUT BUILDS!!!**

They take a long time. If you do `npm run build` expect it to take 10-15 minutes. This can be adjusted by changing the build params in the `package.json`. The more platforms and build types, the longer it takes. You can also remove the `--concurrent` from the `build:nw` script to see a status of what has been completed. This will allow individual pieces to finish faster, but the entire build will take longer.


## Automated quality enforcment

1. **Linting:** `npm run lint` - tslint.json
1. **Unit tests:** `npm test` - [Karma](https://karma-runner.github.io).
1. **End-to-end:** `npm run e2e` - Accepting PR to fix these tests. - [Protractor](http://www.protractortest.org).


## Code scaffolding

[ng generate Docs](https://angular.io/cli/generate)

1. `npm run generate -- component component-name` to generate a new component.
1. `npm run generate -- directive directive-name` to generate a new directive.
1. `npm run generate -- pipe pipe-name` to generate a new pipe.
1. `npm run generate -- service service-name` to generate a new service.
1. `npm run generate -- class class-name` to generate a new class.
1. `npm run generate -- guard guard-name` to generate a new guard.
1. `npm run generate -- interface interface-name` to generate a new interface.
1. `npm run generate -- enum enum-name` to generate a new enum.
1. `npm run generate -- module module-name` to generate a new module.


## Further help

To get more help on the Angular CLI use `npm run ng -- help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

1. Install [Volta](https://volta.sh/)
1. `npm i` to install node modules
1. `npm run lint` to lint code
1. `npm run test:unit` to run unit tests (figure out how to launch nwjs via karma)
1. `npm run test:e2e`to test app via Selenium (figure out how to do this)
1. `npm start` to run in development mode
1. `npm run dev:ng` to run only Angular in a browser (add ``if (window.nw) {}` conditionals to skip desktop specific code)
1. `npm run build` to build desktop app

## Alternatives

Expand Down
10 changes: 0 additions & 10 deletions hooks/pre.nw.mjs

This file was deleted.

6 changes: 4 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();
const { findpath } = require("nw");

// const puppeteer = require('puppeteer');
process.env.CHROME_BIN = findpath();

module.exports = function (config) {
config.set({
Expand Down
Loading

0 comments on commit 180992b

Please sign in to comment.