generator-ngx-rocket

授权协议 MIT License
开发语言 TypeScript
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 陈浩
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

�� generator-ngx-rocket

ngx-rocket logo

Extensible Angular 12+ enterprise-grade project generator based onangular-cli with best practices from the community.Includes PWA, Cordova & Electron support, coding guides and more!

See generated project example here.

Benefits versus bare angular-cli projects

  • A complete starter template: example app structure tailored for scalability, with examples and boilerplate codefor every common thing needed in enterprise projects, such as unit tests, routing, authentication, HTTPS serviceextensions, i18n support with dynamic language change and automatic user language detection...

  • Improved tooling: SCSS & HTML linting, stricter TSLint rules, markdown-based local wiki server for documentation,automated localizable strings extraction, corporate proxy support, Cordova integration

  • Extensive base documentation: coding guides for TypeScript/SCSS/HTML, Angular onboarding guide,corporate proxy and other tools configuration and usage...

  • Ready-to-use UI components: focus on your app, not on the stack! Choose between aBootstrap 4, Ionic orAngular Material based UI with nicely looking, responsive starter templates

  • Mobile/desktop hybrid app support: choose between a web app, a mobile app (using Cordova),a desktop app (using Electron) or all at the same time using the same code base

  • API proxy example setup: develop and debug faster using any remote server

  • Generator output customization: with the providedadd-on support, start multipleprojects even faster by plugging in additions that fit your needs, such as your enterprise theme, SSO authentication,services integrations...

And there's even more! See What's in the box for more details.

Getting started

Using ngX-Rocket CLI

  1. Install required tools:
npm install -g generator-ngx-rocket
  1. Create your application:
ngx new

�� Pro tip: the ngx CLI can do more that just bootstrapping new projects! You can use it to run yourNPM scripts with fuzzy matching (try ngx ci for example) or help you maintaining your project up-to-date.Take a look at the full documentation!

Project structure

The structure follows Angular style guide.

dist/                        app production build
docs/                        project docs and coding guides
e2e/                         end-to-end tests
src/                         project source code
|- app/                      app components
|  |- @shared/               shared module  (common components, directives, pipes and services)
|  |- app.component.*        app root component (shell)
|  |- app.module.ts          app root module definition
|  |- app-routing.module.ts  app routes
|  +- ...                    additional modules and components
|- assets/                   app assets (images, fonts, sounds...)
|- environments/             values for various build environments
|- theme/                    app global scss variables and theme
|- translations/             translations files
|- index.html                html entry point
|- main.scss                 global style entry point
|- main.ts                   app entry point
|- polyfills.ts              polyfills needed by Angular
+- test.ts                   unit tests entry point
reports/                     test and coverage reports
proxy.conf.js                backend proxy configuration

Main tasks

Task automation is based on NPM scripts.

Task Description
npm start Run development server on http://localhost:4200/
npm run serve:sw Run test server on http://localhost:4200/ with service worker enabled
npm run build [-- --configuration=production] Lint code and build web app for production (with AOT) in dist/
npm test Run unit tests via Karma or Jest in watch mode
npm run test:ci Lint code and run unit tests once for continuous integration
npm run e2e Run e2e tests using Protractor
npm run lint Lint code
npm run translations:extract Extract strings from code and templates to src/app/translations/template.json
npm run docs Display project documentation

Additional tasks for Cordova-based projects:

Task Description
npm run cordova:prepare Prepare for building mobile app (restore Cordova platforms and plugins)
npm run cordova:run <ios/android> [--device] Run app on target platform device or simulator
npm run cordova:build [-- --configuration=production] Build mobile app for production in dist/ folder
npm run cordova:clean Removes www/, platforms/ and plugins/ folders

Additional tasks for Electron-based projects:

Task Description
npm run electron:build Build desktop app
npm run electron:run Run app on electron
npm run electron:package Package app for all supported platforms

When building the application, you can specify the target configuration using the additional flag--configuration <name> (do not forget to prepend -- to pass arguments to npm scripts).

The default build configuration is production.

Development server

Run npm start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you changeany of the source files.You should not use ng serve directly, as it does not use the backend proxy configuration by default.

Code scaffolding

Run npm run generate -- component <name> to generate a new component. You can also usenpm run generate -- directive|pipe|service|class|module.

If you have installed angular-cli globally with npm install -g @angular/cli,you can also use the command ng generate directly.

What's in the box

The app template is based on HTML5, TypeScript andSass. The translation files use the common JSON format.

Tools

Development, build and quality processes are based on angular-cli andNPM scripts, which includes:

Progressive Web App (PWA) support provided by@angular/service-worker.

Native mobile application bundling is based on Cordova.Ionic WKWebView is used for iOS for better performance.

Libraries

Coding guides

Other documentation

Generator options

  • --packageManager [npm|yarn]: specify whether to use Yarn or NPM as your package manager(default is NPM).You can also use the environment variable NGX_PACKAGE_MANAGER to set this option globally.
  • --automate <json_file>: automate prompt answers using specified JSON file (seehere for examples).
  • --addons <addon_name> [<addon_name>] ...: space-separated list of add-ons to use.
  • --no-update: do no update existing project (see also updating generated projects).
  • --no-analytics: do not report anonymous usage analytics.You can also use the environment variable NGX_DISABLE_ANALYTICS to set this option globally.
  • --raw: do not use any UI library for templates.
  • --tools: generate only the toolchain, without application template.
  • --location-strategy [hash|path]: location strategy to use inAngular router (default is path).
  • --no-git: do not initialize git repository.
  • --no-strict: disable TypeScript strict type checking options.
  • --skip-quickstart: disable quick start message after project generation.
  • --no-prefix: do not add @ prefix to core/shared folders.
  • --deploy <option>: choose automatic deployment option. Use ngx n --deploy to see possible values.

When generating a fullstack project (with both client and server code), you can use the environment variablesNGX_CLIENT_PATH and NGX_SERVER_PATH to customize the paths for client and server code. Be aware though that someadd-ons may force specific paths that will preempt your changes.

Updating generated projects

As new features and newer libraries and tools are added to the generator, you may want to update your project at somepoint. Here is how we suggest you to do it:

  1. Make sure your working directory is clean (no pending / uncommited changes).
  2. Run ngx update using the CLI inside your project folder.
  3. The generator will then run again using the same options you used initially, prompting you for each file change.From there the recommended approach is simply to overwrite everything.
  4. Finally, use your source control to see the diff for each file and merge the changes manually.

Note: you can use the --tools option to generate only the toolchain and not application templates, thus reducingthe number of changes to merge.

Customize project generation

You can customize the generator output to change or enhance it to better suit your needs usingadd-ons.

To create a new add-on, you can use the addon sub-generator of the CLI:

ngx new --addon

See the add-on generator documentationfor more information about add-on creation.

Contributing

First time contributors are welcome in this project! ��

To get started, take a look at the contributing guide.If you want to help and don't know what you can do, look for good first contribution issues, or if you're a seasoned OSS contributor look for PR welcome tags.

Thanks for helping ❤️

License

MIT

  • 加州大学伯克利分校 体系结构研究中心: https://bar.eecs.berkeley.edu/index.html 生成Rocket Core 和Boom Core 的Rocket-Chip项目: https://bar.eecs.berkeley.edu/projects/rocket_chip.html rocket-chip链接的源代码网址: https://github.com/ch

 相关资料
  • ngx-weui 是一个使用 Angular 构建的 WeUI 组件。 在线示例以及API文档。

  • ngx-fastdfs 是 nginx + lua +fastdfs 实现分布式图片实时动态压缩。 install 进入docker目录docker build -t  fastdfs:dev . 使用 docker -idt -p 80:80 fastdfs:dev /bin/bash进入容器执行/etc/rc.local 测试 进入容器执行test目录下的./test.sh或者直接执行下面脚本

  • ngx-markdown ngx-markdown is an Angular library that combines... Marked to parse markdown to HTML Prism.js for language syntax highlight Emoji-Toolkit for emoji support KaTeX for math expression rende

  • ngx-admin Who uses ngx-admin?| Documentation | Installation Guidelines | Angular templates New! Material theme for ngx-admin Material admin theme is based on the most popular Angular dashboard templat

  • @sweetalert2/ngx-sweetalert2 Official SweetAlert2 integration for Angular This is not a regular API wrapper for SweetAlert (which already works very well alone), it intends to provide Angular-esque ut

  • ngx-dropzone A lightweight and highly customizable Angular dropzone component for file uploads. For a demo see DEMO. And the CODE for the demo. Install $ npm install --save ngx-dropzone Usage // in ap