Skip to content

Commit 6dee74f

Browse files
committed
feat: initial commit
0 parents  commit 6dee74f

File tree

11 files changed

+4837
-0
lines changed

11 files changed

+4837
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
/sample*/
3+
*.log
4+
.DS_Store
5+
Thumbs.db

CHANGELOG.md

Whitespace-only changes.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 Yohan Lasorsa
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# :rocket: create-ngx
2+
3+
[![NPM version](https://img.shields.io/npm/v/create-ngx.svg)](https://www.npmjs.com/package/create-ngx)
4+
[![Build Status](https://sinedied.visualstudio.com/oss-pipelines/_apis/build/status/ngx-rocket.create-ngx?branchName=master)](https://sinedied.visualstudio.com/oss-pipelines/_build/latest?definitionId=3&branchName=master&WT.mc_id=createngx-github-yolasors)
5+
![Node version](https://img.shields.io/node/v/create-ngx.svg)
6+
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
7+
8+
![ngx-rocket logo](https://user-images.githubusercontent.com/593151/28924751-08023b32-7863-11e7-9186-c17d4647d861.png)
9+
10+
> The fastest way to rocket start your Angular projects
11+
12+
This package is a **no-install** frontend for [ngX-Rocket](https://github.com/ngx-rocket/generator-ngx-rocket).
13+
It allows you to use the latest ngX-Rocket CLI with any local or remote add-ons from NPM without having to install it on your machine.
14+
15+
See [ngX-Rocket documentation](https://github.com/ngx-rocket/generator-ngx-rocket) for the full details and options.
16+
17+
*Note: This package does not replace the original `ngx` CLI, it is aimed to compliment it by providing an always-fresh, no-install alternative.
18+
If you plan to frequently generate new projects, it is better to install the `generator-ngx-rocket` globally to use the local `ngx` CLI instead of `create-ngx` that will always fetch the latest version from the network.*
19+
20+
## Usage
21+
22+
To create a new project, just run:
23+
```sh
24+
npm init ngx
25+
```
26+
or
27+
```sh
28+
yarn create ngx
29+
```
30+
or simply
31+
```sh
32+
npx create-ngx
33+
```
34+
35+
Any supported [ngX-Rocket option](https://github.com/ngx-rocket/generator-ngx-rocket#generator-options) can be used.
36+
37+
### Using add-ons
38+
39+
You can provide a coma-separated list of add-ons to use using the `--addons` option.
40+
By default add-ons will be fetched from NPM, but any [supported package format](https://docs.npmjs.com/files/package.json#dependencies) can be used, so local packages and private git repositories for example works too.
41+
42+
Some examples:
43+
```sh
44+
npm init ngx --addons addon-firebase # fetch generator-addon-firebase from NPM
45+
npm init ngx --addons ../my-local-addon # use local add-on
46+
npm init ngx --addons ngx-rocket/addon-firebase # add-on from github repo
47+
npm init ngx --addons https://github.com/ngx-rocket/addon-firebase.git # add-on from git repo
48+
npm init ngx --addons addon-firebase,addon-azure-deploy # multiple add-ons can be provided
49+
```
50+
51+
*Note: when using add-ons from NPM, the `generator-` prefix is automatically added for you if you don't specify it.*
52+
53+
## What's included?
54+
55+
See [the list of features here](https://github.com/ngx-rocket/generator-ngx-rocket#whats-in-the-box).
56+
57+
# License
58+
59+
[MIT](LICENSE)

azure-pipelines.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Node.js
2+
# Build a general Node.js project with npm.
3+
# Add steps that analyze code, save build artifacts, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript&WT.mc_id=createngx-github-yolasors
5+
6+
strategy:
7+
matrix:
8+
linux-node10:
9+
imageName: 'ubuntu-latest'
10+
nodeVersion: '10.x'
11+
linux-node-latest:
12+
imageName: 'ubuntu-latest'
13+
nodeVersion: '>=12.x'
14+
mac-node10:
15+
imageName: 'macos-latest'
16+
nodeVersion: '10.x'
17+
mac-node-latest:
18+
imageName: 'macos-latest'
19+
nodeVersion: '>=12.x'
20+
windows-node8:
21+
imageName: 'windows-latest'
22+
nodeVersion: '10.x'
23+
windows-node-latest:
24+
imageName: 'windows-latest'
25+
nodeVersion: '>=12.x'
26+
27+
pool:
28+
vmImage: $(imageName)
29+
30+
trigger:
31+
- master
32+
33+
schedules:
34+
- cron: "0 12 * * 1"
35+
always: true
36+
branches:
37+
include:
38+
- master
39+
displayName: Weekly monday build
40+
41+
steps:
42+
# Needed to avoid issues with Prettier
43+
- script: git config --global core.autocrlf false
44+
displayName: Disable git automatic line ending conversion
45+
46+
- checkout: self
47+
48+
- task: NodeTool@0
49+
inputs:
50+
versionSpec: $(nodeVersion)
51+
displayName: Install Node.js
52+
53+
- script: npm install
54+
displayName: Install dependencies
55+
56+
- script: npm test
57+
displayName: Run unit tests

bin/create-ngx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
require('../index')(process.argv.slice(2));

index.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const spawn = require('cross-spawn');
2+
const minimist = require('minimist');
3+
const pkg = require('./package.json');
4+
5+
function createNgxCli(args) {
6+
const options = minimist(args, {
7+
boolean: ['version'],
8+
string: ['addons'],
9+
alias: {v: 'version'}
10+
});
11+
12+
if (options.version) {
13+
return console.log(pkg.version);
14+
}
15+
16+
const packages = ['-p', 'generator-ngx-rocket'];
17+
const addons = options.addons ? options.addons.split(' ') : [];
18+
addons.forEach(addon => {
19+
if (addon) {
20+
packages.push('-p');
21+
packages.push(
22+
addon.startsWith('generator') || /[:/]/.test(addon)
23+
? addon
24+
: 'generator-' + addon
25+
);
26+
}
27+
});
28+
29+
return spawn.sync('npx', packages.concat(['ngx', 'new']).concat(args || []), {
30+
stdio: 'inherit'
31+
});
32+
}
33+
34+
module.exports = createNgxCli;

0 commit comments

Comments
 (0)