You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add support for Angular v11 (follow up) (#120)
* work in progress
* docs: keeping track of all the forks
* chore: migrate from `configuration` to `buildTarget`
- only unit tests are evaluated right now
- no real tests were done yet
* ci: bump node version to see if this fixes the break
cause it works on my machine (tm)
* Revert "ci: bump node version to see if this fixes the break"
This reverts commit b300026.
* tweaking dependencies / peerDependencies
as seen in angularfire: https://github.com/angular/angularfire/blob/2ce41aa0af8c5f42df65f5ac5b2b5a50fb6f4300/package.json#L41-L68
commander has some breaking changes, so let's risk nothing here and rollback
* fixing build and tests, cleanup
see angular-schule/ngx-deploy-starter#10
* minor: docs + removes astronaut emoij
... since 👨🚀 emoij is combined (🧑🚀) and breaks on some cmds
* docs: breaking change, 1.0.0-rc.1
* docs: suggestion from @fmalcher
* Apply suggestions from code review
many thanks to @fmalcher
Co-authored-by: Ferdinand Malcher <ferdinand@malcher.media>
Co-authored-by: Ferdinand Malcher <ferdinand@malcher.media>
Copy file name to clipboardExpand all lines: README.md
+59-19Lines changed: 59 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
4.[🚀 Continuous Delivery](#continuous-delivery)
17
17
5.[📦 Options](#options)
18
18
-[--base-href](#base-href)
19
-
-[--configuration](#configuration)
19
+
-[--build-target](#build-target)
20
20
-[--no-build](#no-build)
21
21
-[--repo](#repo)
22
22
-[--message](#message)
@@ -36,7 +36,29 @@
36
36
37
37
A detailed changelog is available in the [releases](https://github.com/angular-schule/angular-cli-ghpages/releases) section.
38
38
39
-
With this latest release, **GitHub Actions** becomes a first citizen alongside Travis CI and CircleCi. The token `GITHUB_TOKEN` is now supported. Learn everything you need to know in the following article.
39
+
**⚠️ BREAKING CHANGE (v1)**
40
+
41
+
Starting with version 1 the option `--configuration` was renamed to `--build-target`.
42
+
43
+
BEFORE (_does not work_):
44
+
45
+
```
46
+
ng deploy --configuration=test
47
+
```
48
+
49
+
NOW:
50
+
51
+
```
52
+
ng deploy --build-target=test
53
+
```
54
+
55
+
If you use the old syntax, you will probably receive the following error:
56
+
57
+
> An unhandled exception occurred: Configuration 'test' is not set in the workspace.
58
+
59
+
<br>
60
+
61
+
**🐙 GitHub Actions** is now properly supported alongside Travis CI and CircleCi. The token `GITHUB_TOKEN` is also supported. Learn everything you need to know in the following article.
@@ -49,15 +71,15 @@ In this article we show several tools from the GitHub universe to launch a websi
49
71
This command has the following prerequisites:
50
72
51
73
- Git 1.9 or higher (execute `git --version` to check your version)
52
-
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli)v8.3.0 or greater (execute `ng update @angular/cli @angular/core` to upgrade your project if necessary)
74
+
- Angular project created via [Angular CLI](https://github.com/angular/angular-cli)v9.0.0 or greater (execute `ng update` to upgrade your project if necessary)
53
75
- older Angular projects can still use the standalone program. See the documentation at [README_standalone](https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_standalone.md).
This quick start assumes that you are starting from scratch.
58
80
If you already have an existing Angular project on GitHub, skip step 1 and 2.
59
81
60
-
1. Install the latest version of the Angular CLI (v8.3.0 or greater) globally
82
+
1. Install the latest version of the Angular CLI globally
61
83
and create a new Angular project.
62
84
63
85
```sh
@@ -98,7 +120,7 @@ If you already have an existing Angular project on GitHub, skip step 1 and 2.
98
120
```sh
99
121
ng deploy your-angular-project --base-href=/<repositoryname>/
100
122
```
101
-
123
+
102
124
Please be aware of the `--base-href` option. It is necessary when your project will be deployed to a non-root folder. See more details below.
103
125
104
126
5. Your project should be available at `https://<username>.github.io/<repositoryname>`.
@@ -172,19 +194,36 @@ ng deploy --cname=example.org
172
194
173
195
See the option [--cname](#cname) for more information!
174
196
175
-
#### --configuration <aname="configuration"></a>
197
+
#### --build-target <aname="build-target"></a>
176
198
177
199
-**optional**
178
-
- Alias: `-c`
179
-
- Default: `production` (string)
200
+
- Default: `undefined` (string)
180
201
- Example:
181
-
-`ng deploy` – Angular project is build in production mode
182
-
-`ng deploy --configuration=test` – Angular project is using the configuration `test` (this configuration must exist in the `angular.json` file)
202
+
-`ng deploy` – Angular project is built in `production` mode
203
+
-`ng deploy --build-target=test` – Angular project is using the build configuration `test` (this configuration must exist in the `angular.json` file)
204
+
205
+
If no `buildTarget` is set, the `production` build of the default project will be chosen.
206
+
The `buildTarget` simply points to an existing build configuration for your project, as specified in the `configurations` section of `angular.json`.
207
+
Most projects have a default configuration and a production configuration (commonly activated by using the `--prod` flag) but it is possible to specify as many build configurations as needed.
208
+
209
+
This is equivalent to calling the command `ng build --configuration=XXX`.
210
+
This command has no effect if the option `--no-build` is active.
211
+
212
+
**⚠️ BREAKING CHANGE (v1)**
213
+
214
+
This option was called `--configuration` in previous versions.
215
+
216
+
BEFORE (_does not work_):
183
217
184
-
A named build target, as specified in the `configurations` section of `angular.json`.
185
-
Each named target is accompanied by a configuration of option defaults for that target.
186
-
Same as `ng build --configuration=XXX`.
187
-
This command has no effect if the option `--no-build` option is active.
218
+
```
219
+
ng deploy --configuration=test
220
+
```
221
+
222
+
NOW:
223
+
224
+
```
225
+
ng deploy --build-target=test
226
+
```
188
227
189
228
#### --no-build <aname="no-build"></a>
190
229
@@ -196,7 +235,7 @@ This command has no effect if the option `--no-build` option is active.
196
235
197
236
Skip build process during deployment.
198
237
This can be used when you are sure that you haven't changed anything and want to deploy with the latest artifact.
199
-
This command causes the `--configuration` setting to have no effect.
238
+
This command causes the `--build-target` setting to have no effect.
200
239
201
240
#### --repo <aname="repo"></a>
202
241
@@ -313,7 +352,7 @@ This can be very useful because it outputs what would happen without doing anyth
313
352
To avoid all these command-line cmd options, you can write down your configuration in the `angular.json` file in the `options` attribute of your deploy project's architect. Just change the kebab-case to lower camel case. This is the notation of all options in lower camel case:
314
353
315
354
- baseHref
316
-
-configuration
355
+
-buildTarget
317
356
- noBuild
318
357
- repo
319
358
- message
@@ -346,20 +385,21 @@ becomes
346
385
}
347
386
```
348
387
349
-
And just run `ng deploy`😄.
388
+
Now you can just run `ng deploy`without all the options in the command line! 😄
350
389
351
390
> **ℹ️ Hint**
352
391
>
353
392
> You can always use the [--dry-run](#dry-run) option to verify if your configuration is right.
393
+
> The project will build but not deploy.
354
394
355
395
## 🌍 Environments <aname="environments"></a>
356
396
357
397
We have seen `angular-cli-ghpages` running on various environments, like Travis CI, CircleCi or Github Actions.
358
398
Please share your knowledge by writing an article about how to set up the deployment.
359
399
360
400
1.[GitHub Actions](https://github.com/angular-schule/angular-cli-ghpages/blob/master/docs/README_environment_github_actions.md) by [Dharmen Shah](https://github.com/shhdharmen)
Copy file name to clipboardExpand all lines: docs/README_contributors.md
+16-9Lines changed: 16 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,6 @@
8
8
-[4. Testing](#4-testing)
9
9
-[Testing the standalone CLI](#testing-the-standalone-cli)
10
10
-[Publish to NPM](#publish-to-npm)
11
-
-[Usage of Prettier Formatter](#usage-of-prettier-formatter)
12
11
13
12
## How to start
14
13
@@ -28,15 +27,19 @@ This may be useful when you want to try the latest non-published version of this
28
27
29
28
Follow the instructions for [checking and updating the Angular CLI version](#angular-cli) and then link the package.
30
29
31
-
### 1. Angular CLI
30
+
### 1. Optional: Latest Angular version
32
31
33
-
1. Install the next version of the Angular CLI.
32
+
This builder requires the method `getTargetOptions()` from the Angular DevKit which was introduced [here](https://github.com/angular/angular-cli/pull/13825/files).
33
+
All Angular projects with Angular 9 and greater are supposed to be compatible. (Actually it works with some versions of 8.x too, but you want to be up to date anyway, don't you?)
34
+
Execute the next three steps, if your test project is still older.
35
+
36
+
1. Install the latest version of the Angular CLI.
34
37
35
38
```sh
36
39
npm install -g @angular/cli
37
40
```
38
41
39
-
2. Run `ng version`, make sure you have installed Angular CLI v8.3.0 or greater.
42
+
2. Run `ng version`, to make sure you have installed Angular v9.0.0 or greater.
40
43
41
44
3. Update your existing project using the command:
42
45
@@ -154,16 +157,20 @@ Use VSCode and debug the task `Launch Standalone Program`.
154
157
155
158
```
156
159
cd angular-cli-ghpages/src
157
-
npx prettier --write '**/*'
160
+
npm run prettier
158
161
npm run build
159
162
npm run test
160
163
npm publish dist
161
164
npm dist-tag add angular-cli-ghpages@0.6.0-rc.0 next
162
165
```
163
166
164
-
## Usage of Prettier Formatter
167
+
## Keeping track of all the forks
168
+
169
+
[ngx-deploy-starter](https://github.com/angular-schule/ngx-deploy-starter/) and
170
+
[angular-cli-ghpages](https://github.com/angular-schule/angular-cli-ghpages/) (both developed by Johannes Hoppe) are follow-up projects of the deprecated [ngx-gh demo](https://github.com/mgechev/ngx-gh).
171
+
This project was a follow-up of the deploy schematics from the [angularfire](https://github.com/angular/angularfire/) project.
165
172
166
-
Just execute `npx prettier --write '**/*'` and the code is formated automatically.
167
-
Please ignore the errors for now. ([error] No parser could be inferred for file)
173
+
To stay in sync with the stuff the Angular team is doing, you might want to keep an eye on the following files:
168
174
169
-
We are still working on this, see https://github.com/angular-schule/ngx-deploy-starter/issues/10 .
0 commit comments