Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 6b56afb

Browse files
committed
more README
1 parent 463290b commit 6b56afb

File tree

5 files changed

+56
-34
lines changed

5 files changed

+56
-34
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 John Doe
3+
Copyright (c) 2019 Minko Gechev, Johannes Hoppe
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,48 @@
22

33
## About
44

5-
This is a sample project that helps you to implement your own __deployment builder__ for the Angular CLI.
5+
This is a sample project that helps you to implement your own __deployment builder__ (`ng deploy`) for the Angular CLI.
66
The groundwork of this starter was provided by Minko Gechev's [ngx-gh project](https://github.com/mgechev/ngx-gh).
77

88
This project has the following purposes:
99

1010
1. To promote the adoption of `ng deploy`.
11-
2. To clarify various questions and to standardise the experience of the various builders.
11+
2. To clarify various questions and to standardise the experience of the various builders.
12+
13+
**We hope for an inspiring discussion, pull requests and questions.**
1214

1315
## Essential considerations
1416

1517
These rules are open for discussion, of course.
1618

17-
### 1. A deployment builder should always compile the project before the deployment
19+
### 1. A deployment builder must always compile the project before the deployment
1820

1921
To reduce the chances to deploy corrupted assets, it's important to build the app right before deploying it. ([source](https://github.com/angular-schule/website-articles/pull/3#discussion_r315802100))
2022

23+
**Current state:**
2124
Currently there are existing deployment builders that only build in production mode.
2225
This might be not enough.
2326
There is also the approach not to perform the build step at all.
2427

25-
**Our suggestion:**
26-
By default, a deployment builder compiles in `production` mode, but you can configure an other coniguration using the option `--configuration`.
28+
**Our suggestion:**
29+
By default, a deployment builder **shall** compile in `production` mode, but it **should** be possible to override the default coniguration using the option `--configuration`.
30+
31+
Discussion: https://github.com/angular-schule/ngx-deploy-starter/issues/1
32+
33+
### 2. A deployment builder should have an interactive prompts after the "ng add".
34+
35+
To make it easier for the end user to get started, a deployment builder **should** ask for all the mandatory questions immediately after the `ng add`.
36+
The data should be persisted in the `angular.json` file.
2737

28-
### 2. A deployment builder should have an interactive wizard after the "ng add".
38+
**Note:**
39+
This feature is not implemented for this starter yet, but we are looking forward to your support.
2940

30-
This wizard should ask all necessary questions and should persist the answers in the `angular.json` file.
31-
This feature is not implemented yet, but we are looking forward to your feedback.
41+
Discussion: https://github.com/angular-schule/ngx-deploy-starter/issues/2
3242

33-
### 2. More to come
43+
### 3. More to come
3444

35-
What's bothers you about this example? We appreciate your feedback!
45+
What's bothers you about this example?
46+
We appreciate your [feedback](https://github.com/angular-schule/ngx-deploy-starter/issues)!
3647

3748

3849
## How to make your own deploy builder
@@ -41,7 +52,8 @@ What's bothers you about this example? We appreciate your feedback!
4152
2. adjust the `package.json`
4253
3. search and replace for the string `ngx-deploy-starter` and choose your own name.
4354
4. search and replace for the string `to the file system` and name your deploy target.
44-
5. add your deployment code to `src/engine/engine.ts`x
55+
5. add your deployment code to `src/engine/engine.ts`, take care of the tests
56+
6. follow the instructions from the [contributors README](docs/README_contributors.md) for build, test and publishing.
4557

4658

4759
You are free to customise this project according to your needs.

docs/README_contributors.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ npm test
1212
```
1313

1414

15-
## Local development <a name="local-dev"></a>
15+
## Local development
1616

1717
If you want to try the latest package locally without installing it from NPM, use the following instructions.
1818
This may be useful when you want to try the latest non-published version of this library or you want to make a contribution.
1919

2020
Follow the instructions for [checking and updating the Angular CLI version](#angular-cli) and then link the package.
2121

2222

23-
### 1. Angular CLI <a name="angular-cli"></a>
23+
### 1. Angular CLI
2424

2525
1. Install the next version of the Angular CLI.
2626

@@ -71,7 +71,7 @@ Use the following instructions to make `ngx-deploy-starter` available locally vi
7171
Read more about the `link` feature in the [official NPM documentation](https://docs.npmjs.com/cli/link).
7272

7373

74-
### 3. Adding to an Angular project -- ng add <a name="local-dev-add"></a>
74+
### 3. Adding to an Angular project -- ng add
7575

7676
Once you have completed the previous steps to `npm link` the local copy of `ngx-deploy-starter`, follow these steps to use it in a local Angular project.
7777

@@ -102,7 +102,7 @@ Once you have completed the previous steps to `npm link` the local copy of `ngx-
102102
5. You can remove the link later by running `npm unlink`
103103

104104

105-
### 4. Testing <a name="testing"></a>
105+
### 4. Testing
106106

107107
Testing is done with [Jest](https://jestjs.io/).
108108
To run the tests:
@@ -114,20 +114,11 @@ npm test
114114

115115

116116

117-
118-
119-
## Testing the standalone CLI
120-
121-
To quickly test the file `engine.ts` directly, the standalone mode is the best option.
122-
Use VSCode and debug the task `Launch Standalone Program`.
123-
124-
125117
## Publish to NPM
126118

127119
```
128120
cd ngx-deploy-starter/src
129121
npm run build
130122
npm run test
131123
npm publish dist
132-
npm dist-tag add [email protected] next
133124
```

src/README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ ng deploy [options]
2222

2323
The following options are also available.
2424

25-
#### --target-dir
26-
* __optional__
27-
* Default: `~/example-folder` (string)
28-
* Example:
29-
* `ng deploy` -- App is "deployed" to the example folder (if existing)
30-
* `ng deploy --target-/var/www/html` -- App is "deployed" to another folder
31-
3225

3326
#### --configuration
3427
* __optional__
@@ -41,3 +34,25 @@ A named build target, as specified in the `configurations` section of `angular.j
4134
Each named target is accompanied by a configuration of option defaults for that target.
4235
Same as `ng build --configuration=XXX`.
4336

37+
> **This is a proposal from [RFC #1](https://github.com/angular-schule/ngx-deploy-starter/issues/1).**
38+
39+
#### --target-dir
40+
* __optional__
41+
* Default: `~/example-folder` (string)
42+
* Example:
43+
* `ng deploy` -- App is "deployed" to the example folder (if existing)
44+
* `ng deploy --target-/var/www/html` -- App is "deployed" to another folder
45+
46+
> **This is one of the options you can freely choose according to your needs.**
47+
48+
#### --base-href <a name="base-href"></a>
49+
* __optional__
50+
* Default: `undefined` (string)
51+
* Example:
52+
* `ng deploy` -- `<base href="/">` remains unchanged in your `index.html`
53+
* `ng deploy --base-href=/the-repositoryname/` -- `<base href="/the-repositoryname/">` is added to your `index.html`
54+
55+
Specifies the base URL for the application being built.
56+
Same as `ng build --base-href=/XXX/`
57+
58+
> **This is an example how to override the workspace set of options.**

src/deploy/schema.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
"title": "schema",
44
"description": "Deployment of Angular CLI applications to GitHub pages (ngx-deploy-starter)",
55
"properties": {
6+
"baseHref": {
7+
"type": "string",
8+
"description": "This is an example how to override the workspace set of options. --- Base url for the application being built. Same as `ng build --base-href=/XXX/`."
9+
},
610
"configuration": {
711
"type": "string",
8-
"description": "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`."
12+
"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`."
913
},
1014
"targetDir": {
1115
"type": "string",
12-
"description": "Only for demonstration: we will 'deploy' to this folder."
16+
"description": "This is one of the options you can freely choose according to your needs. --- We will 'deploy' to this folder."
1317
}
1418
}
1519
}

0 commit comments

Comments
 (0)