@travetto/pack 3.0.0-rc.25 → 3.0.0-rc.26
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 +171 -206
- package/package.json +3 -3
- package/support/pack.base.ts +4 -0
package/README.md
CHANGED
|
@@ -1,267 +1,232 @@
|
|
|
1
1
|
<!-- This file was generated by @travetto/doc and should not be modified directly -->
|
|
2
|
-
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/pack/
|
|
2
|
+
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/pack/DOC.ts and execute "npx trv doc" to rebuild -->
|
|
3
3
|
# Pack
|
|
4
4
|
## Code packing utilities
|
|
5
5
|
|
|
6
6
|
**Install: @travetto/pack**
|
|
7
7
|
```bash
|
|
8
8
|
npm install @travetto/pack
|
|
9
|
+
|
|
10
|
+
# or
|
|
11
|
+
|
|
12
|
+
yarn add @travetto/pack
|
|
9
13
|
```
|
|
10
14
|
|
|
15
|
+
This module provides the necessary tools to produce deliverable output for [Travetto](https://travetto.dev) based projects. The main interaction with this module is through the command line interface, and the operations it provides. Under the covers, the code bundling is performed by [Rollup](https://rollupjs.org/), with specific configuration to support the frameworks runtime expectations.
|
|
16
|
+
|
|
17
|
+
There are three primary cli commands for packing your code:
|
|
18
|
+
|
|
19
|
+
* pack
|
|
20
|
+
* pack:zip
|
|
21
|
+
* pack:docker
|
|
22
|
+
|
|
11
23
|
## CLI - pack
|
|
12
24
|
|
|
13
25
|
**Terminal: Pack usage**
|
|
14
26
|
```bash
|
|
15
27
|
$ trv pack --help
|
|
16
28
|
|
|
17
|
-
Usage: pack [options] [
|
|
29
|
+
Usage: pack [options] [args...]
|
|
18
30
|
|
|
19
31
|
Options:
|
|
20
|
-
-w, --workspace <workspace>
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
-w, --workspace <workspace> Workspace for building
|
|
33
|
+
-c, --no-clean Disables: Clean workspace
|
|
34
|
+
-o, --output <output> Output Location
|
|
35
|
+
-e, --entry-point <entry-point> Entry point (default: "node_modules/@travetto/cli/support/cli.js")
|
|
36
|
+
-ec, --entry-command <entry-command> Entry command
|
|
37
|
+
-m, --no-minify Disables: Minify output
|
|
38
|
+
-sm, --sourcemap Bundle source maps
|
|
39
|
+
-is, --include-sources Include source with source maps
|
|
40
|
+
-x, --eject-file <eject-file> Eject commands to file
|
|
41
|
+
-h, --help display help for command
|
|
27
42
|
```
|
|
28
43
|
|
|
29
|
-
This command line operation will compile your project, and produce a ready to use workspace as a deliverable.
|
|
44
|
+
This command line operation will compile your project, and produce a ready to use workspace as a deliverable. Additionally, you can pass in a file to the `eject-file` flag that will allow for a script to be produced (base on the host operating system).
|
|
30
45
|
|
|
31
|
-
|
|
32
|
-
* assemble
|
|
33
|
-
* zip
|
|
34
|
-
* docker
|
|
46
|
+
Specific to this CLI command, the `output` field determines where the final folder is written that contains all the compiled source.
|
|
35
47
|
|
|
36
|
-
###
|
|
48
|
+
### Entry Point Configuration
|
|
49
|
+
Every application requires an entry point to determine execution flow (and in [Rollup](https://rollupjs.org/)'s case, tree-shaking as well.). By default the [Command Line Interface](https://github.com/travetto/travetto/tree/main/module/cli#readme "CLI infrastructure for Travetto framework") acts as the entry point. This bypasses the [Compiler](https://github.com/travetto/travetto/tree/main/module/compiler#readme "The compiler infrastructure for the Travetto framework") intentionally, as the compiler is not available at runtime.
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
Within the command line, the `args` are positional arguments that will be passed to the entry point on application run.
|
|
39
52
|
|
|
40
|
-
|
|
41
|
-
1. Cleaning Workspace - Cleans workspace to start with an empty workspace
|
|
42
|
-
1. Copying Dependencies - Computes the prod dependencies and copies them into the new workspace
|
|
43
|
-
1. Copying App Content - Copies over application content (src/, resources/, support/, bin/)
|
|
44
|
-
1. Excluding Pre-Compile Files - Any files that should be excluded pre-compilation, are removed
|
|
45
|
-
1. Compiling - Compiles the code in the new workspace, isolating it from your local development
|
|
46
|
-
1. Excluding Post-Compile Files - Removes any files that should be excluded, post compilation
|
|
47
|
-
1. Copying Added Content - Adds in any additional content that is not in the standard locations
|
|
48
|
-
1. Removing Empty Folders - Purge all empty folders, recursively
|
|
49
|
-
1. Writing Env.js - Write out the .env.js file with computed any env vars that should be set for the deployed app
|
|
50
|
-
1. Remove Source Maps - If keep source is false, all source maps are purged from your app's code
|
|
51
|
-
1. Emptying .ts Files - If keep source is false, all .ts files are emptied, as compilation will not occur at runtime
|
|
52
|
-
|
|
53
|
-
**Code: Assemble Default Config**
|
|
53
|
+
**Code: Packing an application run**
|
|
54
54
|
```typescript
|
|
55
|
-
|
|
56
|
-
active: true,
|
|
57
|
-
cacheDir: 'cache',
|
|
58
|
-
keepSource: true,
|
|
59
|
-
readonly: true,
|
|
60
|
-
env: {
|
|
61
|
-
TRV_DYNAMIC: '0'
|
|
62
|
-
},
|
|
63
|
-
add: [
|
|
64
|
-
{ [mod('@travetto/cli/bin/trv.js')]: mod('.bin/trv') },
|
|
65
|
-
{ [mod('lodash/lodash.min.js')]: mod('lodash/lodash.js') },
|
|
66
|
-
],
|
|
67
|
-
excludeCompile: [
|
|
68
|
-
mod('@travetto/*/doc/'),
|
|
69
|
-
mod('@travetto/*/e2e/'),
|
|
70
|
-
mod('@travetto/*/test/'),
|
|
71
|
-
],
|
|
72
|
-
exclude: [
|
|
73
|
-
'bower.json',
|
|
74
|
-
'LICENSE',
|
|
75
|
-
'LICENCE',
|
|
76
|
-
'*.map',
|
|
77
|
-
'*.md',
|
|
78
|
-
'*.lock',
|
|
79
|
-
'*.html',
|
|
80
|
-
'*.mjs',
|
|
81
|
-
mod('**/*.ts'),
|
|
82
|
-
'*.d.ts',
|
|
55
|
+
$ npx trv pack run myapp
|
|
83
56
|
```
|
|
84
57
|
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
$ trv pack:assemble --help
|
|
88
|
-
|
|
89
|
-
Usage: pack:assemble [options] [mode]
|
|
58
|
+
Would then produce an executable script, in the output folder, that would look like:
|
|
90
59
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Available Pack Modes:
|
|
98
|
-
* default [support/pack.config.ts]
|
|
99
|
-
* rest/docker [@travetto/rest/support/pack.docker.ts]
|
|
100
|
-
* rest-aws-lambda/main [@travetto/rest-aws-lambda/support/pack.aws-lambda.ts]
|
|
60
|
+
**Code: Entry script for Packed application**
|
|
61
|
+
```typescript
|
|
62
|
+
#!/bin/sh
|
|
63
|
+
cd $(dirname "$0")
|
|
64
|
+
node cli run myapp
|
|
101
65
|
```
|
|
102
66
|
|
|
103
|
-
|
|
67
|
+
And this entry point would be what is executed by [docker](https://www.docker.com/community-edition), or whatever deployment mechanism is being used.
|
|
104
68
|
|
|
105
|
-
|
|
69
|
+
### General Packing Operations
|
|
70
|
+
Every [Pack](https://github.com/travetto/travetto/tree/main/module/pack#readme "Code packing utilities") operation extends from the base command, and that provides some consistent operations that run on every packing command.
|
|
106
71
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
72
|
+
|
|
73
|
+
* `clean` - Empties workspace before beginning, controlled by the `--clean` flag, defaults to on
|
|
74
|
+
* `writeEnv` - Writes the .env.js files that includes the necessary details to start the application. This is primarily to identify the location of the manifest file needed to run.
|
|
75
|
+
* `writePackageJson` - Generates the [Package JSON](https://docs.npmjs.com/cli/v9/configuring-npm/package-json) with the appropriate module type ([CommonJS](https://nodejs.org/api/modules.html) or [Ecmascript Module](https://nodejs.org/api/esm.html)) for interpreting plain `.js` files
|
|
76
|
+
* `writeEntryScript` - Create the entry script based on the `--entry-command`, `args`
|
|
77
|
+
* `copyResources` - Will pull in local `resources/**` files into the final output
|
|
78
|
+
* `primeAppCache` - Runs `trv run` to ensure the appropriate files are generated to allow for running the application. This only applies if the entry point is equivalent to `trv run`
|
|
79
|
+
* `writeManifest` - Produces the `prod`-ready manifest that is used at runtime. Removes all devDependencies from the manifest.json
|
|
80
|
+
* `bundle` - Invokes [Rollup](https://rollupjs.org/) with the appropriate file set to produce a single output .js file. Depending on the module type ([CommonJS](https://nodejs.org/api/modules.html) or [Ecmascript Module](https://nodejs.org/api/esm.html)) the build process differs to handle the dynamic loading that application does at runtime.
|
|
81
|
+
|
|
82
|
+
## CLI - pack:zip
|
|
114
83
|
|
|
115
|
-
|
|
84
|
+
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.
|
|
85
|
+
|
|
86
|
+
**Terminal: Pack:zip usage**
|
|
116
87
|
```bash
|
|
117
88
|
$ trv pack:zip --help
|
|
118
89
|
|
|
119
|
-
Usage: pack:zip [options] [
|
|
90
|
+
Usage: pack:zip [options] [args...]
|
|
120
91
|
|
|
121
92
|
Options:
|
|
122
|
-
-w, --workspace <workspace>
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
93
|
+
-w, --workspace <workspace> Workspace for building
|
|
94
|
+
-c, --no-clean Disables: Clean workspace
|
|
95
|
+
-o, --output <output> Output Location (default: "travetto_pack.zip")
|
|
96
|
+
-e, --entry-point <entry-point> Entry point (default: "node_modules/@travetto/cli/support/cli.js")
|
|
97
|
+
-ec, --entry-command <entry-command> Entry command
|
|
98
|
+
-m, --no-minify Disables: Minify output
|
|
99
|
+
-sm, --sourcemap Bundle source maps
|
|
100
|
+
-is, --include-sources Include source with source maps
|
|
101
|
+
-x, --eject-file <eject-file> Eject commands to file
|
|
102
|
+
-h, --help display help for command
|
|
130
103
|
```
|
|
131
104
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
Docker support is an optional step, that can run post assembly. This allows for building a docker image, and currently only supports the base images as the only configuration options.
|
|
105
|
+
## CLI - pack:docker
|
|
135
106
|
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
docker: {
|
|
139
|
-
active: false,
|
|
140
|
-
image: 'node:16-alpine'
|
|
141
|
-
}
|
|
142
|
-
```
|
|
107
|
+
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.
|
|
143
108
|
|
|
144
|
-
**Terminal:
|
|
109
|
+
**Terminal: Pack:docker usage**
|
|
145
110
|
```bash
|
|
146
111
|
$ trv pack:docker --help
|
|
147
112
|
|
|
148
|
-
Usage: pack:docker [options] [
|
|
113
|
+
Usage: pack:docker [options] [args...]
|
|
149
114
|
|
|
150
115
|
Options:
|
|
151
|
-
-w, --workspace <workspace>
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
116
|
+
-w, --workspace <workspace> Workspace for building
|
|
117
|
+
-c, --no-clean Disables: Clean workspace
|
|
118
|
+
-o, --output <output> Output Location
|
|
119
|
+
-e, --entry-point <entry-point> Entry point (default: "node_modules/@travetto/cli/support/cli.js")
|
|
120
|
+
-ec, --entry-command <entry-command> Entry command
|
|
121
|
+
-m, --no-minify Disables: Minify output
|
|
122
|
+
-sm, --sourcemap Bundle source maps
|
|
123
|
+
-is, --include-sources Include source with source maps
|
|
124
|
+
-x, --eject-file <eject-file> Eject commands to file
|
|
125
|
+
-df, --docker-factory <docker-factory> Docker Factory source (default: "@travetto/pack/support/pack.dockerfile")
|
|
126
|
+
-di, --docker-image <docker-image> Docker Image to extend (default: "node:18-alpine3.16")
|
|
127
|
+
-dn, --docker-name <docker-name> Docker Image Name (default: "travetto_pack")
|
|
128
|
+
-dt, --docker-tag <docker-tag> Docker Image Tag (default: ["latest"])
|
|
129
|
+
-dp, --docker-port <docker-port> Docker Image Port (default: [])
|
|
130
|
+
-dx, --docker-push Docker Push Tags
|
|
131
|
+
-dr, --docker-registry <docker-registry> Docker Registry
|
|
132
|
+
-h, --help display help for command
|
|
164
133
|
```
|
|
165
134
|
|
|
166
|
-
|
|
167
|
-
Various modules may provide customizations to the default `pack.config.ts` to allow for easy integration with the packing process. A simple example of this is via the [RESTful API](https://github.com/travetto/travetto/tree/main/module/rest#readme "Declarative api for RESTful APIs with support for the dependency injection module.") module, for how to publish lambda packages.
|
|
135
|
+
The additional flags provided are allow for specifying the base image, the final docker image name (and tags), and which registry to push to (if any). Additionally, there are flags for exposing which ports the image should expect to open as well. When using the `--eject-file` flag, the output script will produce the entire Dockerfile output inline, so that it can be easily modified as needed.
|
|
168
136
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
active: true,
|
|
180
|
-
keepSource: false,
|
|
181
|
-
exclude: [
|
|
182
|
-
'node_modules/node-forge'
|
|
183
|
-
],
|
|
184
|
-
env: {
|
|
185
|
-
NO_COLOR: '1'
|
|
186
|
-
},
|
|
187
|
-
postProcess: [{
|
|
188
|
-
['Lambda Entrypoint']: cfg =>
|
|
189
|
-
fs.copyFile(
|
|
190
|
-
PathUtil.resolveUnix(__dirname, 'aws-lambda.handler.js'),
|
|
191
|
-
PathUtil.resolveUnix(cfg.workspace, 'index.js')
|
|
192
|
-
)
|
|
193
|
-
}],
|
|
194
|
-
},
|
|
195
|
-
zip: {
|
|
196
|
-
active: true,
|
|
197
|
-
output: 'dist/lambda.zip'
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
```
|
|
137
|
+
In addition to the standard operations, this command adds the following steps:
|
|
138
|
+
|
|
139
|
+
* `writeDockerFile` - Generate the docker file contents
|
|
140
|
+
* `pullDockerBaseImage` - Pull base image, to ensure its available and primed
|
|
141
|
+
* `buildDockerContainer` - Build final container
|
|
142
|
+
* `pushDockerContainer` - Push container with appropriate tags. Only applies if `--docker-push` is specified
|
|
143
|
+
|
|
144
|
+
## Ejected File
|
|
145
|
+
|
|
146
|
+
As indicated, any of the pack operations can be ejected, and produce an output that can be run independent of the pack command. This is helpful when integrating with more complicated build processes.
|
|
201
147
|
|
|
202
|
-
**Terminal:
|
|
148
|
+
**Terminal: Sample Ejected File**
|
|
203
149
|
```bash
|
|
204
|
-
|
|
205
|
-
```
|
|
150
|
+
$ trv pack:docker -x /dev/stdout run rest
|
|
206
151
|
|
|
207
|
-
|
|
152
|
+
#!/bin/sh
|
|
153
|
+
export DIST=/tmp/_home_tim_Code_travetto_related_todo-app
|
|
154
|
+
export TRV_OUT=<workspace-root>/.trv_output
|
|
155
|
+
export ROOT=<workspace-root>/related/todo-app
|
|
156
|
+
export MOD=@travetto/todo-app
|
|
208
157
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
* The default config in `support/pack.config.ts` and
|
|
212
|
-
* The config selected to execute from the cli
|
|
158
|
+
# Cleaning Output $DIST
|
|
213
159
|
|
|
214
|
-
|
|
160
|
+
rm -rf $DIST
|
|
161
|
+
mkdir -p $DIST
|
|
215
162
|
|
|
216
|
-
|
|
217
|
-
```typescript
|
|
218
|
-
import type { AllConfigPartial } from '@travetto/pack';
|
|
219
|
-
|
|
220
|
-
export const config: AllConfigPartial = {
|
|
221
|
-
workspace: 'dist/alt',
|
|
222
|
-
assemble: {
|
|
223
|
-
active: true,
|
|
224
|
-
add: [
|
|
225
|
-
{ assets: 'assets' },
|
|
226
|
-
{ '/secret/location/key.pem': 'resources/key.pem' }
|
|
227
|
-
]
|
|
228
|
-
},
|
|
229
|
-
zip: {
|
|
230
|
-
active: true,
|
|
231
|
-
output: 'dist/build.zip'
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
```
|
|
163
|
+
# Writing .env.js
|
|
235
164
|
|
|
236
|
-
|
|
165
|
+
echo "process.env.TRV_MANIFEST = 'node_modules/$MOD';" > $DIST/.env.js
|
|
166
|
+
echo "process.env.TRV_CLI_IPC = '';" >> $DIST/.env.js
|
|
237
167
|
|
|
238
|
-
|
|
239
|
-
allow their key parameters to be overridden via environment variables.
|
|
168
|
+
# Writing package.json
|
|
240
169
|
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
overrides: {
|
|
244
|
-
keepSource: CliUtil.toBool(process.env.PACK_ASSEMBLE_KEEP_SOURCE),
|
|
245
|
-
readonly: CliUtil.toBool(process.env.PACK_ASSEMBLE_READONLY)
|
|
246
|
-
},
|
|
247
|
-
```
|
|
170
|
+
echo "{\"type\":\"commonjs\"}" > $DIST/package.json
|
|
248
171
|
|
|
249
|
-
|
|
250
|
-
```typescript
|
|
251
|
-
overrides: {
|
|
252
|
-
image: process.env.PACK_DOCKER_IMAGE || undefined,
|
|
253
|
-
name: process.env.PACK_DOCKER_NAME || undefined,
|
|
254
|
-
app: process.env.PACK_DOCKER_APP || undefined,
|
|
255
|
-
port: process.env.PACK_DOCKER_PORT ? [process.env.PACK_DOCKER_PORT] : undefined,
|
|
256
|
-
registry: process.env.PACK_DOCKER_REGISTRY || undefined,
|
|
257
|
-
push: CliUtil.toBool(process.env.PACK_DOCKER_PUSH),
|
|
258
|
-
tag: process.env.PACK_DOCKER_TAG ? [process.env.PACK_DOCKER_TAG] : undefined
|
|
259
|
-
},
|
|
260
|
-
```
|
|
172
|
+
# Writing entry scripts cli.sh args=(run rest)
|
|
261
173
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
174
|
+
echo "#!/bin/sh" > $DIST/cli.sh
|
|
175
|
+
echo "cd \$(dirname \"\$0\")" >> $DIST/cli.sh
|
|
176
|
+
echo "node cli run rest \$@" >> $DIST/cli.sh
|
|
177
|
+
chmod 755 $DIST/cli.sh
|
|
178
|
+
|
|
179
|
+
# Writing entry scripts cli.cmd args=(run rest)
|
|
180
|
+
|
|
181
|
+
echo "" > $DIST/cli.cmd
|
|
182
|
+
echo "cd %~p0" >> $DIST/cli.cmd
|
|
183
|
+
echo "node cli run rest %*" >> $DIST/cli.cmd
|
|
184
|
+
chmod 755 $DIST/cli.cmd
|
|
185
|
+
|
|
186
|
+
# Copying over resources
|
|
187
|
+
|
|
188
|
+
mkdir -p $DIST/node_modules/$MOD
|
|
189
|
+
cp $TRV_OUT/node_modules/$MOD/package.json $DIST/node_modules/$MOD/package.json
|
|
190
|
+
mkdir -p $DIST/node_modules/@travetto/manifest
|
|
191
|
+
cp $TRV_OUT/node_modules/@travetto/manifest/package.json $DIST/node_modules/@travetto/manifest/package.json
|
|
192
|
+
cp -r -p $ROOT/resources $DIST/resources
|
|
193
|
+
|
|
194
|
+
# Generating App Cache node_modules/$MOD/trv-app-cache.json
|
|
195
|
+
|
|
196
|
+
mkdir -p $DIST/node_modules/$MOD
|
|
197
|
+
DEBUG=0 TRV_MODULE=$MOD npx trv main @travetto/app/support/bin/list > $DIST/node_modules/$MOD/trv-app-cache.json
|
|
198
|
+
|
|
199
|
+
# Writing Manifest node_modules/$MOD
|
|
200
|
+
|
|
201
|
+
TRV_MODULE=$MOD npx trv manifest $DIST/node_modules/$MOD prod
|
|
202
|
+
|
|
203
|
+
# Bundling Output minify=true sourcemap= entryPoint=node_modules/@travetto/cli/support/cli.js
|
|
204
|
+
|
|
205
|
+
export BUNDLE_ENTRY=node_modules/@travetto/cli/support/cli.js
|
|
206
|
+
export BUNDLE_ENTRY_NAME=cli
|
|
207
|
+
export BUNDLE_COMPRESS=true
|
|
208
|
+
export BUNDLE_OUTPUT=$DIST
|
|
209
|
+
export BUNDLE_FORMAT=commonjs
|
|
210
|
+
export TRV_MANIFEST=$TRV_OUT/node_modules/$MOD
|
|
211
|
+
cd $TRV_OUT
|
|
212
|
+
npx rollup -c node_modules/@travetto/pack/support/bin/rollup.js
|
|
213
|
+
cd $ROOT
|
|
214
|
+
|
|
215
|
+
# Generating Docker File $DIST/Dockerfile @travetto/pack/support/pack.dockerfile
|
|
216
|
+
|
|
217
|
+
echo "FROM node:18-alpine3.16" > $DIST/Dockerfile
|
|
218
|
+
echo "WORKDIR /app" >> $DIST/Dockerfile
|
|
219
|
+
echo "COPY . ." >> $DIST/Dockerfile
|
|
220
|
+
echo "" >> $DIST/Dockerfile
|
|
221
|
+
echo "ENTRYPOINT [\"/app/cli.sh\"]" >> $DIST/Dockerfile
|
|
222
|
+
|
|
223
|
+
# Pulling Docker Base Image node:18-alpine3.16
|
|
224
|
+
|
|
225
|
+
docker pull node:18-alpine3.16
|
|
226
|
+
|
|
227
|
+
# Building Docker Container latest
|
|
228
|
+
|
|
229
|
+
cd $DIST
|
|
230
|
+
docker build -t travetto_todo-app:latest .
|
|
231
|
+
cd $ROOT
|
|
267
232
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/pack",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.26",
|
|
4
4
|
"description": "Code packing utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"travetto",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"@rollup/plugin-json": "^6.0.0",
|
|
29
29
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
30
30
|
"@rollup/plugin-terser": "^0.4.0",
|
|
31
|
-
"@travetto/base": "^3.0.0-rc.
|
|
31
|
+
"@travetto/base": "^3.0.0-rc.21",
|
|
32
32
|
"rollup": "^3.17.2",
|
|
33
33
|
"rollup-plugin-sourcemaps": "^0.6.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@travetto/cli": "^3.0.0-rc.
|
|
36
|
+
"@travetto/cli": "^3.0.0-rc.24"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@travetto/cli": {
|
package/support/pack.base.ts
CHANGED
|
@@ -95,6 +95,10 @@ export abstract class BasePackCommand<T extends CommonPackOptions, S extends Com
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
async action(module: string, args: string[]): Promise<void> {
|
|
98
|
+
if (Array.isArray(module)) {
|
|
99
|
+
args = module;
|
|
100
|
+
module = RootIndex.mainModule.name;
|
|
101
|
+
}
|
|
98
102
|
const start = Date.now();
|
|
99
103
|
if (!module && this.monoRoot) {
|
|
100
104
|
return this.showHelp(new Error('The module needs to specified when running from a monorepo root'));
|