Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- [CircleCI](#circleci)
- [📦 Options](#options)
- [--configuration](#--configuration)
- [--no-build](#--no-build)
- [--package-version](#--package-version)
- [--tag](#--tag)
- [--access](#--access)
Expand Down Expand Up @@ -115,6 +116,20 @@ jobs:
A named build target, as specified in the `configurations` section of `angular.json`.
Each named target is accompanied by a configuration of option defaults for that target.
Same as `ng build --configuration=XXX`.
This command has no effect if the option `--no-build` option is active.

#### --no-build
- **optional**
- Default: `false` (string)
- Example:
- `ng deploy` – Angular project is build in production mode before the deployment
- `ng deploy --no-build` – Angular project is NOT build

Skip build process during deployment.
This can be used when you are sure that you haven't changed anything and want to deploy with the latest artifact.
This command causes the `--configuration` setting to have no effect.

> **This is a proposal from [RFC #1](https://github.com/angular-schule/ngx-deploy-starter/issues/1).**

#### --package-version

Expand Down
11 changes: 6 additions & 5 deletions docs/README_contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Follow the instructions for [checking and updating the Angular CLI version](#ang
1. Install the next version of the Angular CLI.

```sh
npm install -g @angular/cli@next
npm install -g @angular/cli
```

2. Run `ng version`, make sure you have installed Angular CLI v8.3.0-next.0 or greater.
2. Run `ng version`, make sure you have installed Angular CLI v8.3.0 or greater.

3. Update your existing project using the command:

```sh
ng update @angular/cli @angular/core --next=true
ng update @angular/cli @angular/core
```


Expand Down Expand Up @@ -99,8 +99,9 @@ Once you have completed the previous steps to `npm link` the local copy of `@ang
ng deploy
```

Which is the same as:
```
Or with the old builder syntax:

```sh
ng run your-angular-project:deploy
```

Expand Down
50 changes: 27 additions & 23 deletions src/deploy/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,35 @@ export default async function deploy(
projectRoot: string,
options: Schema
) {
if (!context.target) {
throw new Error('Cannot execute the build target');
if (options.noBuild) {
context.logger.info(`📦 Skipping build`);
} else {
if (!context.target) {
throw new Error('Cannot execute the build target');
}

const configuration = options.configuration;

context.logger.info(
`📦 Building "${context.target.project}". ${
configuration ? `Configuration "${configuration}"` : ''
}`
);

const target = {
target: 'build',
project: context.target.project
} as Target;

// Set the configuration if set on the options
if (configuration) {
target.configuration = configuration;
}

const build = await context.scheduleTarget(target);
await build.result;
}

const configuration = options.configuration;

context.logger.info(
`📦 Building "${context.target.project}". ${
configuration ? `Configuration "${configuration}"` : ''
}`
);

const target = {
target: 'build',
project: context.target.project
} as Target;

// Set the configuration if set on the options
if (configuration) {
target.configuration = configuration;
}

const build = await context.scheduleTarget(target);
await build.result;

await engine.run(
projectRoot,
options,
Expand Down
14 changes: 10 additions & 4 deletions src/deploy/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
"title": "schema",
"description": "Publish your angular packages to npm by just run `npm deploy your-packages`",
"properties": {
"configuration": {
"type": "string",
"description": "This is a proposal from RFC #1. --- A named build target, as specified in the `configurations` section of angular.json. Each named target is accompanied by a configuration of option defaults for that target. Same as `ng build --configuration=XXX`.",
"alias": "c"
},
"noBuild": {
"type": "boolean",
"default": false,
"description": "This is a proposal from RFC #1. --- Skip build process during deployment."
},
"packageVersion": {
"type": "string",
"description": "The version that your package is going to be published. Ex: '1.3.5' '2.0.0-next.0'"
Expand All @@ -24,10 +34,6 @@
"type": "boolean",
"description": "For testing: Run through without making any changes. Execute with --dry-run and nothing will happen.",
"default": false
},
"configuration": {
"type": "string",
"description": "This is a proposal from RFC #1. --- A named build target, as specified in the `configurations` section of angular.json. Each named target is accompanied by a configuration of option defaults for that target. Same as `ng build --configuration=XXX`."
}
}
}
150 changes: 141 additions & 9 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Publish your angular packages to npm by just run `npm deploy your-packages`",
"main": "index.js",
"scripts": {
"build": "rimraf dist && json2ts deploy/schema.json > deploy/schema.d.ts && tsc && copyfiles README.md builders.json collection.json package.json ngx-deploy-npm deploy/schema.json dist && cp ./LICENSE ./dist/LICENSE",
"build": "rimraf dist && json2ts deploy/schema.json > deploy/schema.d.ts && tsc && copyfiles README.md LICENSE builders.json collection.json package.json ngx-deploy-npm deploy/schema.json dist",
"predeploy": "npm run build",
"deploy": "cd dist && npm publish --access public && cd ..",
"link": "npm run build && cd dist && npm link && cd ..",
Expand Down Expand Up @@ -44,12 +44,12 @@
},
"homepage": "https://github.com/bikecoders/ngx-deploy-npm/#readme",
"devDependencies": {
"@angular-devkit/architect": "^0.803.0-next.0",
"@angular-devkit/core": "^8.3.0-next.0",
"@angular-devkit/schematics": "^8.3.0-next.0",
"@angular-devkit/architect": "^0.803.0",
"@angular-devkit/core": "^8.3.0",
"@angular-devkit/schematics": "^8.3.0",
"@types/jest": "^24.0.18",
"@types/node": "^12.6.9",
"copyfiles": "^2.1.1",
"copyfiles": "^2.4.1",
"jest": "^24.8.0",
"json-schema-to-typescript": "^7.0.0",
"rimraf": "^2.6.3",
Expand Down