Skip to content

Commit 5922404

Browse files
committed
include the library build in npm install (postinstall)
1 parent 15d1490 commit 5922404

File tree

7 files changed

+16
-22
lines changed

7 files changed

+16
-22
lines changed

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Please star us!
4040
</p>
4141

4242
---
43-
[![Issues](https://img.shields.io/github/issues-raw/openziti/ziti-console)]()
43+
44+
[![Issues](https://img.shields.io/github/issues-raw/openziti/ziti-console)](https://github.com/openziti/ziti-console/issues)
4445
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4546
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=rounded)](CONTRIBUTING.md)
4647
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
@@ -88,22 +89,14 @@ This repository houses two projects.
8889

8990
From the project root:
9091

91-
1. Install the projects' dependencies.
92+
1. Install both projects' dependencies and build the library.
9293

9394
```bash
9495
npm install
9596
```
9697

97-
1. Build the library project with Angular.
98-
99-
```bash
100-
ng build ziti-console-lib
101-
```
102-
10398
### Build the Single Page Application
10499

105-
This is the recommended approach.
106-
107100
1. Build the console project with Angular.
108101

109102
```bash
@@ -138,7 +131,7 @@ There are two elements to the Angular app.
138131

139132
From the project root:
140133

141-
1. Install dependencies
134+
1. Install dependencies and build the library.
142135

143136
```bash
144137
npm install

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ fi
1212

1313
npm install
1414
npm install -g @angular/[email protected]
15-
ng build ziti-console-lib
1615
# WARN: deployUrl deprecated since Angular 13, pending decommission in future ng CLI
1716
ng build ziti-console --base-href "$1" --deploy-url "$1" --configuration "production"

docker-images/zac/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ COPY package*.json ./
88
COPY version.js ./
99
COPY . .
1010
RUN npm install --omit=optional
11-
RUN ng build ziti-console-lib
1211
RUN ng build ziti-console-node
1312

1413

docker-images/ziti-console-assets/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ COPY . .
1515
RUN --mount=type=cache,target=/usr/src/app/node_modules \
1616
--mount=type=cache,target=/usr/src/app/.angular/cache \
1717
npm install --omit=optional && \
18-
ng build ziti-console-lib && \
1918
ng build ziti-console --base-href ${BASE_HREF} --configuration "production"
2019

2120
ARG NODE_VERSION=${NODE_VERSION}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"docker:debugmessage": "echo Docker Debug Completed Successfully! Hit Ctrl+C to terminate log tailing.",
3333
"predocker:debug": "run-s docker:build docker:run",
3434
"docker:debug": "run-s -cs docker:open:win docker:open:mac docker:debugmessage docker:taillogs",
35-
"postinstall": "ls && node ./version.js"
35+
"postinstall": "ls && node ./version.js && ng build ziti-console-lib"
3636
},
3737
"config": {
3838
"imageRepo": "netfoundry/ziti-console",

projects/ziti-console-lib/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,35 @@ Please star us!
4040
</p>
4141

4242
---
43-
[![Issues](https://img.shields.io/github/issues-raw/openziti/ziti-console)]()
43+
44+
[![Issues](https://img.shields.io/github/issues-raw/openziti/ziti-console)](https://github.com/openziti/ziti-console/issues)
4445
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4546
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=rounded)](CONTRIBUTING.md)
4647
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
4748

4849
---
4950

50-
5151
# ziti-console-lib
5252

5353
ziti-console-lib is a shared Angular library that exports components used to administrate an <a href="https://openziti.io">OpenZiti Network</a>
5454

5555
This library is imported and extended via the <a href="https://github.com/openziti/ziti-console">Ziti Admin Console</a>, but can also be used in other 3rd party Angular applications.
5656

57-
5857
## How to install
5958

6059
To install this library in an angular application, run the following command from your project root:
6160

62-
```
61+
```bash
6362
npm install @openziti/ziti-console-lib
6463
```
6564

6665
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.0.0.
6766

6867
## Building From Source
69-
After checking out the main <a href="https://github.com/openziti/ziti-console">ziti-console</a> github project,
7068

71-
Run `ng build ziti-console-lib` from the project root to build the shared library. The build artifact will be stored in the `dist/` directory.
69+
After checking out the main <a href="https://github.com/openziti/ziti-console">ziti-console</a> github project,
7270

71+
Run `ng build ziti-console-lib` from the project root to build the shared library. The build artifact will be stored in the `dist/ziti-console-lib` directory.
7372

7473
## Code scaffolding
7574

publishSharedLib.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
6+
17
npm install
28
npm install -g @angular/[email protected]
3-
ng build ziti-console-lib
49
cd dist/ziti-console-lib && npm publish --access public

0 commit comments

Comments
 (0)