@travetto/pack 3.1.2 → 3.1.4

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 CHANGED
@@ -29,18 +29,19 @@ $ trv pack --help
29
29
  Usage: pack [options]
30
30
 
31
31
  Options:
32
- -w, --workspace <string> Workspace for building (default: "/tmp/<temp-folder>")
33
- --clean, --no-clean Clean workspace (default: true)
34
- -o, --output <string> Output location
35
- --main-scripts, --no-main-scripts Create entry scripts (default: true)
36
- -f, --main-name <string> Main name for build artifact
37
- -e, --entry-point <string> Entry point (default: "@travetto/cli/support/entry.cli")
38
- --minify, --no-minify Minify output (default: true)
39
- -sm, --sourcemap Bundle source maps (default: false)
40
- -is, --include-sources Include source with source maps (default: false)
41
- -x, --eject-file <string> Eject commands to file
42
- -m, --module <string> Module to run for
43
- -h, --help display help for command
32
+ -w, --workspace <string> Workspace for building (default: "/tmp/<temp-folder>")
33
+ --clean, --no-clean Clean workspace (default: true)
34
+ -o, --output <string> Output location
35
+ --main-scripts, --no-main-scripts Create entry scripts (default: true)
36
+ -f, --main-name <string> Main name for build artifact
37
+ -e, --entry-point <string> Entry point (default: "@travetto/cli/support/entry.cli")
38
+ --minify, --no-minify Minify output (default: true)
39
+ -sm, --sourcemap Bundle source maps (default: false)
40
+ -is, --include-sources Include source with source maps (default: false)
41
+ -x, --eject-file <string> Eject commands to file
42
+ -r, --rollup-configuration <string> Rollup configuration file (default: "@travetto/pack/support/bin/rollup")
43
+ -m, --module <string> Module to run for
44
+ -h, --help display help for command
44
45
  ```
45
46
 
46
47
  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).
@@ -90,18 +91,19 @@ $ trv pack:zip --help
90
91
  Usage: pack:zip [options]
91
92
 
92
93
  Options:
93
- -w, --workspace <string> Workspace for building (default: "/tmp/<temp-folder>")
94
- --clean, --no-clean Clean workspace (default: true)
95
- -o, --output <string> Output location (default: "travetto_pack.zip")
96
- --main-scripts, --no-main-scripts Create entry scripts (default: true)
97
- -f, --main-name <string> Main name for build artifact
98
- -e, --entry-point <string> Entry point (default: "@travetto/cli/support/entry.cli")
99
- --minify, --no-minify Minify output (default: true)
100
- -sm, --sourcemap Bundle source maps (default: false)
101
- -is, --include-sources Include source with source maps (default: false)
102
- -x, --eject-file <string> Eject commands to file
103
- -m, --module <string> Module to run for
104
- -h, --help display help for command
94
+ -w, --workspace <string> Workspace for building (default: "/tmp/<temp-folder>")
95
+ --clean, --no-clean Clean workspace (default: true)
96
+ -o, --output <string> Output location (default: "travetto_pack.zip")
97
+ --main-scripts, --no-main-scripts Create entry scripts (default: true)
98
+ -f, --main-name <string> Main name for build artifact
99
+ -e, --entry-point <string> Entry point (default: "@travetto/cli/support/entry.cli")
100
+ --minify, --no-minify Minify output (default: true)
101
+ -sm, --sourcemap Bundle source maps (default: false)
102
+ -is, --include-sources Include source with source maps (default: false)
103
+ -x, --eject-file <string> Eject commands to file
104
+ -r, --rollup-configuration <string> Rollup configuration file (default: "@travetto/pack/support/bin/rollup")
105
+ -m, --module <string> Module to run for
106
+ -h, --help display help for command
105
107
  ```
106
108
 
107
109
  ## CLI - pack:docker
@@ -114,25 +116,26 @@ $ trv pack:docker --help
114
116
  Usage: pack:docker [options]
115
117
 
116
118
  Options:
117
- -w, --workspace <string> Workspace for building (default: "/tmp/<temp-folder>")
118
- --clean, --no-clean Clean workspace (default: true)
119
- -o, --output <string> Output location
120
- --main-scripts, --no-main-scripts Create entry scripts (default: true)
121
- -f, --main-name <string> Main name for build artifact
122
- -e, --entry-point <string> Entry point (default: "@travetto/cli/support/entry.cli")
123
- --minify, --no-minify Minify output (default: true)
124
- -sm, --sourcemap Bundle source maps (default: false)
125
- -is, --include-sources Include source with source maps (default: false)
126
- -x, --eject-file <string> Eject commands to file
127
- -df, --docker-factory <string> Docker Factory source (default: "@travetto/pack/support/pack.dockerfile")
128
- -di, --docker-image <string> Docker Image to extend (default: "node:18-alpine3.16")
129
- -dn, --docker-name <string> Docker Image Name (default: "travetto_pack")
130
- -dt, --docker-tag <string> Docker Image Tag (default: ["latest"])
131
- -dp, --docker-port <number> Docker Image Port (default: [])
132
- -dx, --docker-push Docker Push Tags (default: false)
133
- -dr, --docker-registry <string> Docker Registry
134
- -m, --module <string> Module to run for
135
- -h, --help display help for command
119
+ -w, --workspace <string> Workspace for building (default: "/tmp/<temp-folder>")
120
+ --clean, --no-clean Clean workspace (default: true)
121
+ -o, --output <string> Output location
122
+ --main-scripts, --no-main-scripts Create entry scripts (default: true)
123
+ -f, --main-name <string> Main name for build artifact
124
+ -e, --entry-point <string> Entry point (default: "@travetto/cli/support/entry.cli")
125
+ --minify, --no-minify Minify output (default: true)
126
+ -sm, --sourcemap Bundle source maps (default: false)
127
+ -is, --include-sources Include source with source maps (default: false)
128
+ -x, --eject-file <string> Eject commands to file
129
+ -r, --rollup-configuration <string> Rollup configuration file (default: "@travetto/pack/support/bin/rollup")
130
+ -df, --docker-factory <string> Docker Factory source (default: "@travetto/pack/support/pack.dockerfile")
131
+ -di, --docker-image <string> Docker Image to extend (default: "node:18-alpine3.16")
132
+ -dn, --docker-name <string> Docker Image Name (default: "travetto_pack")
133
+ -dt, --docker-tag <string> Docker Image Tag (default: ["latest"])
134
+ -dp, --docker-port <number> Docker Image Port (default: [])
135
+ -dx, --docker-push Docker Push Tags (default: false)
136
+ -dr, --docker-registry <string> Docker Registry
137
+ -m, --module <string> Module to run for
138
+ -h, --help display help for command
136
139
  ```
137
140
 
138
141
  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.
@@ -220,7 +223,7 @@ export BUNDLE_OUTPUT=$DIST
220
223
  export BUNDLE_FORMAT=commonjs
221
224
  export TRV_MANIFEST=$TRV_OUT/node_modules/$MOD
222
225
  cd $TRV_OUT
223
- npx rollup -c node_modules/@travetto/pack/support/bin/rollup.js
226
+ npx rollup -c $TRV_OUT/node_modules/@travetto/pack/support/bin/rollup.js
224
227
  cd $ROOT
225
228
 
226
229
  # Generating Docker File $DIST/Dockerfile @travetto/pack/support/pack.dockerfile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/pack",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "Code packing utilities",
5
5
  "keywords": [
6
6
  "travetto",
@@ -24,16 +24,16 @@
24
24
  "directory": "module/pack"
25
25
  },
26
26
  "dependencies": {
27
- "@rollup/plugin-commonjs": "^24.0.1",
27
+ "@rollup/plugin-commonjs": "^24.1.0",
28
28
  "@rollup/plugin-json": "^6.0.0",
29
- "@rollup/plugin-node-resolve": "^15.0.1",
30
- "@rollup/plugin-terser": "^0.4.0",
29
+ "@rollup/plugin-node-resolve": "^15.0.2",
30
+ "@rollup/plugin-terser": "^0.4.3",
31
31
  "@travetto/base": "^3.1.1",
32
- "rollup": "^3.17.2",
32
+ "rollup": "^3.22.0",
33
33
  "rollup-plugin-sourcemaps": "^0.6.3"
34
34
  },
35
35
  "peerDependencies": {
36
- "@travetto/cli": "^3.1.1"
36
+ "@travetto/cli": "^3.1.5"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@travetto/cli": {
@@ -57,7 +57,7 @@ export class PackOperation {
57
57
  static async * bundle(cfg: CommonPackConfig): AsyncIterable<string[]> {
58
58
  const cwd = RootIndex.outputRoot;
59
59
 
60
- const bundleCommand = ['npx', 'rollup', '-c', 'node_modules/@travetto/pack/support/bin/rollup.js'];
60
+ const bundleCommand = ['npx', 'rollup', '-c', RootIndex.resolveFileImport(cfg.rollupConfiguration)];
61
61
 
62
62
  const entryPointFile = RootIndex.getFromImport(cfg.entryPoint)!.outputFile.split(`${RootIndex.manifest.outputFolder}/`)[1];
63
63
 
@@ -8,6 +8,7 @@ export type CommonPackConfig = {
8
8
  module: string;
9
9
 
10
10
  // Bundle
11
+ rollupConfiguration: string;
11
12
  entryPoint: string;
12
13
  entryArguments: string[];
13
14
  minify: boolean;
@@ -54,6 +54,9 @@ export abstract class BasePackCommand implements CliCommandShape {
54
54
  @CliFlag({ desc: 'Eject commands to file', short: 'x' })
55
55
  ejectFile?: string;
56
56
 
57
+ @CliFlag({ desc: 'Rollup configuration file', short: 'r' })
58
+ rollupConfiguration = '@travetto/pack/support/bin/rollup';
59
+
57
60
  @Ignore()
58
61
  module: string;
59
62