@travetto/pack 3.4.0-rc.9 → 3.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/pack",
3
- "version": "3.4.0-rc.9",
3
+ "version": "3.4.1",
4
4
  "description": "Code packing utilities",
5
5
  "keywords": [
6
6
  "travetto",
@@ -28,11 +28,11 @@
28
28
  "@rollup/plugin-json": "^6.0.1",
29
29
  "@rollup/plugin-node-resolve": "^15.2.3",
30
30
  "@rollup/plugin-terser": "^0.4.4",
31
- "@travetto/base": "^3.4.0-rc.2",
31
+ "@travetto/base": "^3.4.0",
32
32
  "rollup": "^4.3.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "@travetto/cli": "^3.4.0-rc.3"
35
+ "@travetto/cli": "^3.4.0"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@travetto/cli": {
@@ -55,7 +55,7 @@ export class DockerPackOperation {
55
55
  * Building Docker Container
56
56
  */
57
57
  static async* buildDockerContainer(cfg: DockerPackConfig): AsyncIterable<string[]> {
58
- const cmd = ['docker', 'build', ...DockerPackOperation.getDockerTags(cfg).flatMap(x => ['-t', x]), '.'];
58
+ const cmd = ['docker', 'build', cfg.dockerBuildFlags, ...DockerPackOperation.getDockerTags(cfg).flatMap(x => ['-t', x]), '.'].filter((x): x is string => !!x);
59
59
 
60
60
  yield* PackOperation.title(cfg, cliTpl`${{ title: 'Building Docker Container' }} ${{ param: cfg.dockerTag?.join(',') }}`);
61
61
 
@@ -1,6 +1,6 @@
1
- import { AcornNode, Plugin } from 'rollup';
1
+ import { AstNode, Plugin } from 'rollup';
2
2
  import { walk } from 'estree-walker';
3
- import MagicString from 'magic-string';
3
+ import magicString from 'magic-string';
4
4
 
5
5
  const BRAND = '__imp';
6
6
 
@@ -23,20 +23,20 @@ export function travettoImportPlugin(entry: string, files: string[]): Plugin {
23
23
  transform(code, id) {
24
24
  const parsed = this.parse(code);
25
25
 
26
- let ms: MagicString | undefined;
26
+ let ms: magicString | undefined;
27
27
 
28
28
  if (id.includes(entry)) {
29
- (ms ??= new MagicString(code).append(DYNAMIC_IMPORT(imports)));
29
+ (ms ??= new magicString(code).append(DYNAMIC_IMPORT(imports)));
30
30
  }
31
31
 
32
32
  walk(parsed, {
33
33
  enter: (node) => {
34
34
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
35
- const impNode = node as AcornNode & { source?: { type: string } };
35
+ const impNode = node as AstNode & { source?: { type: string } };
36
36
  if (impNode.type !== 'ImportExpression' || impNode.source?.type === 'Literal') {
37
37
  return;
38
38
  }
39
- (ms ??= new MagicString(code)).overwrite(impNode.start, impNode.start + 6, BRAND);
39
+ (ms ??= new magicString(code)).overwrite(impNode.start, impNode.start + 6, BRAND);
40
40
  }
41
41
  });
42
42
 
@@ -19,6 +19,7 @@ export type CommonPackConfig = {
19
19
 
20
20
  export type DockerPackConfig = {
21
21
  dockerFactory: string;
22
+ dockerBuildFlags?: string;
22
23
  dockerImage: string;
23
24
  dockerName: string;
24
25
  dockerTag?: string[];
@@ -1,7 +1,7 @@
1
1
  import fs from 'fs/promises';
2
2
 
3
3
  import { path, RootIndex } from '@travetto/manifest';
4
- import { AppError, ExecUtil, ExecutionOptions, ExecutionResult } from '@travetto/base';
4
+ import { AppError, ExecUtil, ExecutionOptions } from '@travetto/base';
5
5
 
6
6
  import { ActiveShellCommand } from './shell';
7
7
 
@@ -5,5 +5,5 @@ import { BasePackCommand } from './pack.base';
5
5
  /**
6
6
  * Standard pack support
7
7
  */
8
- @CliCommand({ fields: ['module'] })
8
+ @CliCommand({ addModule: true })
9
9
  export class PackCommand extends BasePackCommand { }
@@ -13,7 +13,7 @@ const DEFAULT_USER = 'app';
13
13
  /**
14
14
  * Standard docker support for pack
15
15
  */
16
- @CliCommand({ fields: ['module'] })
16
+ @CliCommand({ addModule: true })
17
17
  export class PackDockerCommand extends BasePackCommand {
18
18
  @CliFlag({ desc: 'Docker Factory source ', short: 'df', envVars: ['PACK_DOCKER_FACTORY'] })
19
19
  dockerFactory = '@travetto/pack/support/pack.dockerfile';
@@ -27,6 +27,8 @@ export class PackDockerCommand extends BasePackCommand {
27
27
  dockerPort: number[] = [];
28
28
  @CliFlag({ desc: 'Docker Push Tags ', short: 'dx', envVars: ['PACK_DOCKER_PUSH'] })
29
29
  dockerPush = false;
30
+ @CliFlag({ desc: 'Docker Build Flags ', short: 'dr', envVars: ['PACK_DOCKER_BUILD_FLAGS'] })
31
+ dockerBuildFlags?: string;
30
32
  @CliFlag({ desc: 'Docker Registry ', short: 'dr', envVars: ['PACK_DOCKER_REGISTRY'] })
31
33
  dockerRegistry?: string;
32
34
  @CliFlag({ desc: 'Docker Runtime user ', short: 'du', name: 'docker-runtime-user', envVars: ['PACK_DOCKER_RUNTIME_USER'] })
@@ -6,7 +6,7 @@ import { BasePackCommand, PackOperationShape } from './pack.base';
6
6
  /**
7
7
  * Standard zip support for pack
8
8
  */
9
- @CliCommand({ fields: ['module'] })
9
+ @CliCommand({ addModule: true })
10
10
  export class PackZipCommand extends BasePackCommand {
11
11
 
12
12
  initialize(): void {