@travetto/pack 8.0.0-alpha.17 → 8.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -10
- package/package.json +6 -6
- package/support/cli.pack.ts +4 -1
- package/support/cli.pack_docker.ts +4 -1
- package/support/cli.pack_zip.ts +4 -1
package/README.md
CHANGED
|
@@ -22,12 +22,18 @@ There are three primary cli commands for packing your code:
|
|
|
22
22
|
|
|
23
23
|
## CLI - pack
|
|
24
24
|
|
|
25
|
-
**Terminal:
|
|
25
|
+
**Terminal: Help for pack**
|
|
26
26
|
```bash
|
|
27
27
|
$ trv pack --help
|
|
28
28
|
|
|
29
29
|
Usage: pack [options] [args...:string]
|
|
30
30
|
|
|
31
|
+
Build a standard module package artifact.
|
|
32
|
+
|
|
33
|
+
This base command produces the default packaged output and serves as the
|
|
34
|
+
common entry point for module packaging workflows.
|
|
35
|
+
Example Usage:
|
|
36
|
+
|
|
31
37
|
Options:
|
|
32
38
|
-b, --buildDir <string> Workspace for building (default: "/tmp/<temp-folder>")
|
|
33
39
|
--clean, --no-clean Clean workspace (default: true)
|
|
@@ -88,12 +94,18 @@ Every [Pack](https://github.com/travetto/travetto/tree/main/module/pack#readme "
|
|
|
88
94
|
## CLI - pack:zip
|
|
89
95
|
This command is nearly identical to the standard `pack` operation, except for the `output` flag. In this scenario, the `output` flag determines the location and name of the final zip file.
|
|
90
96
|
|
|
91
|
-
**Terminal:
|
|
97
|
+
**Terminal: Help for pack:zip**
|
|
92
98
|
```bash
|
|
93
99
|
$ trv pack:zip --help
|
|
94
100
|
|
|
95
101
|
Usage: pack:zip [options] [args...:string]
|
|
96
102
|
|
|
103
|
+
Build a deployable zip artifact using the standard pack pipeline.
|
|
104
|
+
|
|
105
|
+
This command runs base packing operations and then compresses the generated
|
|
106
|
+
output into a single archive file.
|
|
107
|
+
Example Usage:
|
|
108
|
+
|
|
97
109
|
Options:
|
|
98
110
|
-b, --buildDir <string> Workspace for building (default: "/tmp/<temp-folder>")
|
|
99
111
|
--clean, --no-clean Clean workspace (default: true)
|
|
@@ -117,12 +129,18 @@ Options:
|
|
|
117
129
|
## CLI - pack:docker
|
|
118
130
|
This command starts off identical to the standard `pack` operation, but it contains a few additional flags, and ultimately a few additional operations to support creating of the final [docker](https://www.docker.com/community-edition) image.
|
|
119
131
|
|
|
120
|
-
**Terminal:
|
|
132
|
+
**Terminal: Help for pack:docker**
|
|
121
133
|
```bash
|
|
122
134
|
$ trv pack:docker --help
|
|
123
135
|
|
|
124
136
|
Usage: pack:docker [options] [args...:string]
|
|
125
137
|
|
|
138
|
+
Build container-ready artifacts and optionally publish Docker images.
|
|
139
|
+
|
|
140
|
+
Extends the core pack pipeline with Dockerfile generation and image build/
|
|
141
|
+
push operations, including runtime user and registry customization.
|
|
142
|
+
Example Usage:
|
|
143
|
+
|
|
126
144
|
Options:
|
|
127
145
|
-b, --buildDir <string> Workspace for building (default: "/tmp/<temp-folder>")
|
|
128
146
|
--clean, --no-clean Clean workspace (default: true)
|
|
@@ -141,7 +159,7 @@ Options:
|
|
|
141
159
|
-np, --npm-package <string> External NPM Packages (default: [])
|
|
142
160
|
-m, --module <module> Module to run for
|
|
143
161
|
-df, --docker-factory <string> Docker Factory source (default: "@travetto/pack/support/pack.dockerfile.ts")
|
|
144
|
-
-di, --docker-image <string> Docker Image to extend (default: "node:
|
|
162
|
+
-di, --docker-image <string> Docker Image to extend (default: "node:26-alpine")
|
|
145
163
|
-dn, --docker-name <string> Docker Image Name (default: "<module>")
|
|
146
164
|
-ru, --runtime-user <string> Docker Runtime user
|
|
147
165
|
-rp, --runtime-package <string> Docker Runtime Packages (default: [])
|
|
@@ -244,21 +262,21 @@ cd $TRV_OUT
|
|
|
244
262
|
node $REPO_ROOT/node_modules/.bin/rollup -c $TRV_OUT/node_modules/@travetto/pack/support/rollup/build.js
|
|
245
263
|
cd $ROOT
|
|
246
264
|
|
|
247
|
-
# Pulling Docker Base Image node:
|
|
265
|
+
# Pulling Docker Base Image node:26-alpine
|
|
248
266
|
|
|
249
|
-
echo "Pulling Docker Base Image node:
|
|
267
|
+
echo "Pulling Docker Base Image node:26-alpine"
|
|
250
268
|
|
|
251
|
-
docker pull node:
|
|
269
|
+
docker pull node:26-alpine
|
|
252
270
|
|
|
253
|
-
# Detected Image OS node:
|
|
271
|
+
# Detected Image OS node:26-alpine as alpine
|
|
254
272
|
|
|
255
|
-
echo "Detected Image OS node:
|
|
273
|
+
echo "Detected Image OS node:26-alpine as alpine"
|
|
256
274
|
|
|
257
275
|
# Generating Docker File $DIST/Dockerfile @travetto/pack/support/pack.dockerfile.ts
|
|
258
276
|
|
|
259
277
|
echo "Generating Docker File $DIST/Dockerfile @travetto/pack/support/pack.dockerfile.ts"
|
|
260
278
|
|
|
261
|
-
echo "FROM node:
|
|
279
|
+
echo "FROM node:26-alpine" > $DIST/Dockerfile
|
|
262
280
|
echo "RUN addgroup -g 2000 app && adduser -D -G app -u 2000 app" >> $DIST/Dockerfile
|
|
263
281
|
echo "RUN mkdir /app && chown app:app /app" >> $DIST/Dockerfile
|
|
264
282
|
echo "COPY --chown=\"app:app\" . /app" >> $DIST/Dockerfile
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/pack",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Code packing utilities",
|
|
6
6
|
"keywords": [
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"directory": "module/pack"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@rollup/plugin-commonjs": "^29.0.
|
|
29
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
30
30
|
"@rollup/plugin-json": "^6.1.0",
|
|
31
31
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
32
32
|
"@rollup/plugin-terser": "^1.0.0",
|
|
33
|
-
"@travetto/runtime": "^8.0.0-alpha.
|
|
34
|
-
"@travetto/terminal": "^8.0.0-alpha.
|
|
35
|
-
"rollup": "^4.
|
|
33
|
+
"@travetto/runtime": "^8.0.0-alpha.16",
|
|
34
|
+
"@travetto/terminal": "^8.0.0-alpha.16",
|
|
35
|
+
"rollup": "^4.61.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@travetto/cli": "^8.0.0-alpha.
|
|
38
|
+
"@travetto/cli": "^8.0.0-alpha.22"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"@travetto/cli": {
|
package/support/cli.pack.ts
CHANGED
|
@@ -3,7 +3,10 @@ import { CliCommand } from '@travetto/cli';
|
|
|
3
3
|
import { BasePackCommand } from './pack.base.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Build a standard module package artifact.
|
|
7
|
+
*
|
|
8
|
+
* This base command produces the default packaged output and serves as the
|
|
9
|
+
* common entry point for module packaging workflows.
|
|
7
10
|
*/
|
|
8
11
|
@CliCommand()
|
|
9
12
|
export class PackCommand extends BasePackCommand { }
|
|
@@ -13,7 +13,10 @@ const asNumber = (input?: string): number | undefined => (!input || isNaN(+input
|
|
|
13
13
|
const asString = (input?: string): string | undefined => (input && asNumber(input)) ? input : undefined;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Build container-ready artifacts and optionally publish Docker images.
|
|
17
|
+
*
|
|
18
|
+
* Extends the core pack pipeline with Dockerfile generation and image build/
|
|
19
|
+
* push operations, including runtime user and registry customization.
|
|
17
20
|
*/
|
|
18
21
|
@CliCommand()
|
|
19
22
|
export class PackDockerCommand extends BasePackCommand {
|
package/support/cli.pack_zip.ts
CHANGED
|
@@ -4,7 +4,10 @@ import { PackOperation } from './bin/operation.ts';
|
|
|
4
4
|
import { BasePackCommand, type PackOperationShape } from './pack.base.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Build a deployable zip artifact using the standard pack pipeline.
|
|
8
|
+
*
|
|
9
|
+
* This command runs base packing operations and then compresses the generated
|
|
10
|
+
* output into a single archive file.
|
|
8
11
|
*/
|
|
9
12
|
@CliCommand()
|
|
10
13
|
export class PackZipCommand extends BasePackCommand {
|