@travetto/pack 3.0.2-rc.1 → 3.0.2

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
@@ -33,7 +33,7 @@ Options:
33
33
  -c, --no-clean Disables: Clean workspace
34
34
  -o, --output <output> Output location
35
35
  -es, --main-scripts <main-scripts> Create entry scripts
36
- -f, --main-name <main-name> Main name for build artifact (default: "cli")
36
+ -f, --main-name <main-name> Main name for build artifact
37
37
  -e, --entry-point <entry-point> Entry point (default: "@travetto/cli/support/entry.cli")
38
38
  -m, --no-minify Disables: Minify output
39
39
  -sm, --sourcemap Bundle source maps
@@ -95,7 +95,7 @@ Options:
95
95
  -c, --no-clean Disables: Clean workspace
96
96
  -o, --output <output> Output location (default: "travetto_pack.zip")
97
97
  -es, --main-scripts <main-scripts> Create entry scripts
98
- -f, --main-name <main-name> Main name for build artifact (default: "cli")
98
+ -f, --main-name <main-name> Main name for build artifact
99
99
  -e, --entry-point <entry-point> Entry point (default: "@travetto/cli/support/entry.cli")
100
100
  -m, --no-minify Disables: Minify output
101
101
  -sm, --sourcemap Bundle source maps
@@ -119,7 +119,7 @@ Options:
119
119
  -c, --no-clean Disables: Clean workspace
120
120
  -o, --output <output> Output location
121
121
  -es, --main-scripts <main-scripts> Create entry scripts
122
- -f, --main-name <main-name> Main name for build artifact (default: "cli")
122
+ -f, --main-name <main-name> Main name for build artifact
123
123
  -e, --entry-point <entry-point> Entry point (default: "@travetto/cli/support/entry.cli")
124
124
  -m, --no-minify Disables: Minify output
125
125
  -sm, --sourcemap Bundle source maps
@@ -178,23 +178,23 @@ echo "Writing package.json
178
178
  "
179
179
  echo "{\"type\":\"commonjs\"}" > $DIST/package.json
180
180
 
181
- # Writing entry scripts cli.sh args=(run rest)
181
+ # Writing entry scripts entry.cli.sh args=(run rest)
182
182
 
183
- echo "Writing entry scripts cli.sh args=(run rest)
183
+ echo "Writing entry scripts entry.cli.sh args=(run rest)
184
184
  "
185
- echo "#!/bin/sh" > $DIST/cli.sh
186
- echo "cd \$(dirname \"\$0\")" >> $DIST/cli.sh
187
- echo "node cli.js run rest \$@" >> $DIST/cli.sh
188
- chmod 755 $DIST/cli.sh
185
+ echo "#!/bin/sh" > $DIST/entry.cli.sh
186
+ echo "cd \$(dirname \"\$0\")" >> $DIST/entry.cli.sh
187
+ echo "node entry.cli.js run rest \$@" >> $DIST/entry.cli.sh
188
+ chmod 755 $DIST/entry.cli.sh
189
189
 
190
- # Writing entry scripts cli.cmd args=(run rest)
190
+ # Writing entry scripts entry.cli.cmd args=(run rest)
191
191
 
192
- echo "Writing entry scripts cli.cmd args=(run rest)
192
+ echo "Writing entry scripts entry.cli.cmd args=(run rest)
193
193
  "
194
- echo "" > $DIST/cli.cmd
195
- echo "cd %~p0" >> $DIST/cli.cmd
196
- echo "node cli.js run rest %*" >> $DIST/cli.cmd
197
- chmod 755 $DIST/cli.cmd
194
+ echo "" > $DIST/entry.cli.cmd
195
+ echo "cd %~p0" >> $DIST/entry.cli.cmd
196
+ echo "node entry.cli.js run rest %*" >> $DIST/entry.cli.cmd
197
+ chmod 755 $DIST/entry.cli.cmd
198
198
 
199
199
  # Copying over resources
200
200
 
@@ -224,7 +224,7 @@ TRV_MODULE=$MOD npx trv manifest $DIST/node_modules/$MOD prod
224
224
  echo "Bundling Output minify=true sourcemap= entryPoint=@travetto/cli/support/entry.cli
225
225
  "
226
226
  export BUNDLE_ENTRY=node_modules/@travetto/cli/support/entry.cli.js
227
- export BUNDLE_MAIN_FILE=cli.js
227
+ export BUNDLE_MAIN_FILE=entry.cli.js
228
228
  export BUNDLE_COMPRESS=true
229
229
  export BUNDLE_OUTPUT=$DIST
230
230
  export BUNDLE_FORMAT=commonjs
@@ -241,7 +241,7 @@ echo "FROM node:18-alpine3.16" > $DIST/Dockerfile
241
241
  echo "WORKDIR /app" >> $DIST/Dockerfile
242
242
  echo "COPY . ." >> $DIST/Dockerfile
243
243
  echo "" >> $DIST/Dockerfile
244
- echo "ENTRYPOINT [\"/app/cli.sh\"]" >> $DIST/Dockerfile
244
+ echo "ENTRYPOINT [\"/app/entry.cli.sh\"]" >> $DIST/Dockerfile
245
245
 
246
246
  # Pulling Docker Base Image node:18-alpine3.16
247
247
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/pack",
3
- "version": "3.0.2-rc.1",
3
+ "version": "3.0.2",
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.2-rc.1",
31
+ "@travetto/base": "^3.0.2",
32
32
  "rollup": "^3.17.2",
33
33
  "rollup-plugin-sourcemaps": "^0.6.3"
34
34
  },
35
35
  "peerDependencies": {
36
- "@travetto/cli": "^3.0.2-rc.1"
36
+ "@travetto/cli": "^3.0.2"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@travetto/cli": {
@@ -44,7 +44,7 @@ export abstract class BasePackCommand<T extends CommonPackOptions, S extends Com
44
44
  clean: this.boolOption({ short: 'c', desc: 'Clean workspace', def: true }),
45
45
  output: this.option({ short: 'o', desc: 'Output location' }),
46
46
  mainScripts: this.option({ short: 'es', desc: 'Create entry scripts' }),
47
- mainName: this.option({ short: 'f', desc: 'Main name for build artifact', def: path.basename(mainEntry).replace(/entry[.]/, '') }),
47
+ mainName: this.option({ short: 'f', desc: 'Main name for build artifact' }),
48
48
  entryPoint: this.option({ short: 'e', desc: 'Entry point', def: mainEntry }),
49
49
  minify: this.boolOption({ short: 'm', desc: 'Minify output', def: true }),
50
50
  sourcemap: this.boolOption({ short: 'sm', desc: 'Bundle source maps' }),
@@ -96,6 +96,7 @@ export abstract class BasePackCommand<T extends CommonPackOptions, S extends Com
96
96
  async buildConfig(): Promise<S> {
97
97
  this.cmd.workspace ??= path.resolve(os.tmpdir(), RootIndex.mainModule.sourcePath.replace(/[\/\\: ]/g, '_'));
98
98
  this.cmd.module = RootIndex.mainModule.name;
99
+ this.cmd.mainName ??= path.basename(this.cmd.entryPoint);
99
100
  return this.cmd;
100
101
  }
101
102