generator-ngx-rocket
Version:
Extensible Angular 13+ enterprise-grade project generator based on angular-cli with best practices from the community. Includes PWA/Cordova/Electron support, coding guides and more!
258 lines (257 loc) • 9.21 kB
JSON
<% const run = command => `${props.packageManager} run ${command}${props.packageManager === 'npm' ? ' -s' : ''}` -%>
{
"name": "<%= props.projectName %>",
"version": "1.0.0",
"private": true,
<% if (props.target.includes('electron')) { -%>
"main": "electron.main.js",
<% } -%>
"scripts": {
"ng": "ng",
"build": "<%= run('write:env') %> && ng build",
"start": "<%= run('write:env') %> && ng serve --proxy-config proxy.conf.js",
<% if (props.deploy !== 'none') { -%>
"deploy": "<%= run('write:env') %> && ng deploy",
<% } -%>
<% if (props.pwa) { -%>
"serve:sw": "<%= run('build') %> && npx http-server ./<%= props.target.includes('cordova') ? 'www': 'dist' %> -p 4200",
<% } -%>
"lint": "ng lint && stylelint \"src/**/*.scss\"",
"test": "<%= run('write:env') %> && ng test",
"test:ci": "<%= run('write:env') %> && <%= run('lint') %> && ng run <%= props.projectName %>:test:ci",
<% if (props.e2e || props.cypress) { -%>
"e2e": "<%= run('write:env') %> && ng e2e",
<% } -%>
<% if (props.cypress) { -%>
"cypress:open": "<%= run('write:env') %> && ng run <%= props.projectName %>:cypress-open",
"cypress:run": "<%= run('write:env') %> && ng run <%= props.projectName %>:cypress-run",
<% } -%>
"translations:extract": "ngx-translate-extract --input ./src --output ./src/translations/template.json --format=json --clean --sort",
<% if (props.tools.includes('hads')) { -%>
"docs": "hads ./docs -o",
<% } -%>
<% if (props.tools.includes('compodoc')) { -%>
"compodoc": "compodoc -p tsconfig.json -d docs/generated -s -o",
<% } -%>
"write:env": "ngx-scripts env npm_package_version",
<% if (props.tools.includes('prettier')) { -%>
"prettier": "prettier --write \"./src/**/*.{ts,js,html,scss}\"",
"prettier:check": "prettier --list-different \"./src/**/*.{ts,js,html,scss}\"",
<% if (options.git) { -%>
"postinstall": "<%= run('prettier') %> && husky install",
<% } else { -%>
"postinstall": "<%= run('prettier') %>",
<% } -%>
<% } -%>
<% if (props.target.includes('cordova')) { -%>
"cordova:prepare": "ngx-scripts cordova prepare",
"cordova:run": "ngx-scripts cordova run",
"cordova:build": "ngx-scripts cordova build --device --release --copy dist",
"cordova:clean": "ngx-scripts clean",
"cordova": "cordova",
<% } -%>
<% if (props.target.includes('electron')) { -%>
"electron:compile": "tsc --project tsconfig.electron.json --target es5",
"electron:run": "<%= run('electron:compile') %> && electron .",
"electron:build": "<%= run('electron:compile') %> && <%= run('write:env') %> && ng build --base-href ./ --output-path dist-electron",
"electron:package:common": "electron-packager . --overwrite --out=dist-packages --ignore=\"/(platforms|plugins|docs|www|reports|src)\"",
<% if (props.desktop.includes('windows')) { -%>
"electron:package:windows": "<%= run('electron:package:common') %> -- --platform=win32 --arch=x64 --icon=./resources/win/icon.ico",
<% } -%>
<% if (props.desktop.includes('mac')) { -%>
"electron:package:mac": "<%= run('electron:package:common') %> -- --platform=darwin --icon=./resources/mac/icon.icns",
<% } -%>
<% if (props.desktop.includes('linux')) { -%>
"electron:package:linux": "<%= run('electron:package:common') %> --platform=linux",
<% } -%>
"electron:package": "<%- props.desktop.reduce((out, platform) => (out ? out + ' && ' : '') + run('electron:package:' + platform), null) %>",
<% } -%>
"generate": "ng generate"
},
"dependencies": {
"@angular/animations": "~14.1.3",
"@angular/common": "~14.1.3",
"@angular/compiler": "~14.1.3",
"@angular/core": "~14.1.3",
"@angular/forms": "~14.1.3",
<% if (props.ui === 'bootstrap' || props.ui === 'material') { -%>
"@angular/localize": "~14.1.3",
<% } -%>
"@angular/platform-browser": "~14.1.3",
"@angular/platform-browser-dynamic": "~14.1.3",
"@angular/router": "~14.1.3",
"@ngx-translate/core": "^14.0.0",
<% if (props.target.includes('cordova')) { -%>
"@awesome-cordova-plugins/core": "^5.30.0",
"@awesome-cordova-plugins/keyboard": "^5.30.0",
"@awesome-cordova-plugins/splash-screen": "^5.30.0",
"@awesome-cordova-plugins/status-bar": "^5.30.0",
"cordova-android": "^11.0.0",
"cordova-custom-config": "^5.1.0",
"cordova-ios": "^6.2.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-splashscreen": "^6.0.0",
"cordova-plugin-statusbar": "^3.0.0",
<% } -%>
<% if (props.pwa) { -%>
"@angular/service-worker": "~14.1.3",
<% } -%>
<% if (props.ui === 'ionic') { -%>
"@ionic/angular": "^6.2.4",
<% } else if (props.ui === 'bootstrap') { -%>
"@ng-bootstrap/ng-bootstrap": "^13.0.0",
"@popperjs/core": "^2.11.0",
"bootstrap": "^5.0.2",
"@fortawesome/fontawesome-free": "^6.1.2",
<% } else if (props.ui === 'material') { -%>
"@angular/cdk": "~14.1.3",
"@angular/material": "~14.1.3",
"@angular/flex-layout": "^14.0.0-beta.40",
"material-design-icons-iconfont": "^6.1.0",
<% } -%>
<% if (props.angulartics) { -%>
"angulartics2": "^12.1.0",
<% } -%>
<% if (props.utility.includes('lodash')) { -%>
"lodash": "^4.17.20",
<% } -%>
<% if (props.utility.includes('ramda')) { -%>
"ramda": "^0.28.0",
<% } -%>
<% if (props.utility.includes('moment')) { -%>
"moment": "^2.29.4",
<% } -%>
<% if (props.utility.includes('datefns')) { -%>
"date-fns": "^2.29.2",
<% } -%>
"rxjs": "^7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
<% if (props.target.includes('cordova')) { -%>
"cordova": "^11.0.0",
<% } -%>
<% if (props.tools.includes('jest')) { -%>
"@angular-builders/jest": "^14.0.1",
<% } -%>
"@angular-devkit/build-angular": "~14.1.3",
"@angular-eslint/builder": "~14.0.3",
"@angular-eslint/eslint-plugin": "~14.0.3",
"@angular-eslint/eslint-plugin-template": "~14.0.3",
"@angular-eslint/schematics": "~14.0.3",
"@angular-eslint/template-parser": "~14.0.3",
"@angular/cli": "~14.1.3",
"@angular/compiler-cli": "~14.1.3",
"@angular/language-service": "~14.1.3",
"@biesbjerg/ngx-translate-extract": "^7.0.3",
"@biesbjerg/ngx-translate-extract-marker": "^1.0.0",
"@ngx-rocket/scripts": "^5.2.2",
<% if (props.cypress) { -%>
"@cypress/schematic": "^2.0.3",
"cypress": "~10.6.0",
<% } -%>
"@ngneat/until-destroy": "^9.0.0",
"@typescript-eslint/eslint-plugin": "~5.34.0",
"@typescript-eslint/parser": "~5.34.0",
<% if (!props.tools.includes('jest') || props.e2e) { -%>
"@types/jasmine": "^4.0.0",
"@types/jasminewd2": "^2.0.8",
<% } -%>
<% if (props.tools.includes('jest')) { -%>
"@types/jest": "^28.1.8",
<% } -%>
"@types/node": "^14.18.26",
<% if (props.utility.includes('lodash')) { -%>
"@types/lodash": "^4.14.184",
<% } -%>
<% if (props.utility.includes('ramda')) { -%>
"@types/ramda": "^0.28.15",
<% } -%>
<% if (props.target.includes('electron')) { -%>
"electron": "^20.0.3",
"electron-packager": "^16.0.0",
"electron-reload": "^1.5.0",
<% } -%>
"eslint": "^8.3.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jsdoc": "latest",
"eslint-plugin-prefer-arrow": "latest",
<% if (props.tools.includes('hads')) { -%>
"hads": "^3.0.0",
<% } -%>
<% if (props.tools.includes('compodoc')) { -%>
"@compodoc/compodoc": "^1.1.11",
<% } -%>
"https-proxy-agent": "^5.0.0",
<% if (!props.tools.includes('jest') || props.e2e) { -%>
"jasmine-core": "~4.2.0",
"jasmine-spec-reporter": "~7.0.0",
<% } -%>
<% if (props.tools.includes('jest')) { -%>
"jest": "^28.1.3",
"ts-jest": "^28.0.8",
<% } else { -%>
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"karma-junit-reporter": "^2.0.1",
<% } -%>
<% if (props.tools.includes('prettier')) { -%>
"prettier": "^2.2.1",
"stylelint-config-prettier": "^9.0.3",
<% if (options.git) { -%>
"pretty-quick": "^3.1.0",
"husky": "^8.0.1",
<% } -%>
<% } -%>
<% if (props.e2e) { -%>
"protractor": "~7.0.0",
<% } -%>
<% if (props.tools.includes('puppeteer')) { -%>
"puppeteer": "^16.2.0",
<% } -%>
"stylelint": "~14.11.0",
"stylelint-config-recommended-scss": "~7.0.0",
"stylelint-config-standard": "~28.0.0",
"postcss": "^8.4.5",
"ts-node": "^10.1.0",
"typescript": "~4.7.4"
<% if (props.tools.includes('prettier')) { -%>
},
"prettier": {
"singleQuote": true,
"overrides": [
{
"files": "*.scss",
"options": {
"singleQuote": false
}
}
]
<% } -%>
<% if (props.target.includes('cordova')) { -%>
},
"resolutions": {
"webpack": "^5.0.0"
},
"cordova": {
"platforms": [
"android",
"ios"
],
"plugins": {
"cordova-custom-config": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {}
}
<% } -%>
}
}