@travetto/pack 2.0.11 → 2.1.0
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 +20 -20
- package/bin/cli-pack_docker-export.ts +4 -3
- package/bin/operation/pack.ts +1 -0
- package/package.json +5 -5
- package/support/pack.config.ts +19 -17
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ $ trv pack --help
|
|
|
17
17
|
Usage: pack [options] [mode]
|
|
18
18
|
|
|
19
19
|
Options:
|
|
20
|
-
-w, --workspace <workspace> Working directory
|
|
20
|
+
-w, --workspace <workspace> Working directory
|
|
21
21
|
-h, --help display help for command
|
|
22
22
|
|
|
23
23
|
Available Pack Modes:
|
|
@@ -61,13 +61,13 @@ assemble: {
|
|
|
61
61
|
TRV_DYNAMIC: '0'
|
|
62
62
|
},
|
|
63
63
|
add: [
|
|
64
|
-
{ '
|
|
65
|
-
{ '
|
|
64
|
+
{ [mod('@travetto/cli/bin/trv.js')]: mod('.bin/trv') },
|
|
65
|
+
{ [mod('lodash/lodash.min.js')]: mod('lodash/lodash.js') },
|
|
66
66
|
],
|
|
67
67
|
excludeCompile: [
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
68
|
+
mod('@travetto/*/doc/'),
|
|
69
|
+
mod('@travetto/*/e2e/'),
|
|
70
|
+
mod('@travetto/*/test/'),
|
|
71
71
|
],
|
|
72
72
|
exclude: [
|
|
73
73
|
'bower.json',
|
|
@@ -78,7 +78,7 @@ assemble: {
|
|
|
78
78
|
'*.lock',
|
|
79
79
|
'*.html',
|
|
80
80
|
'*.mjs',
|
|
81
|
-
'
|
|
81
|
+
mod('**/*.ts'),
|
|
82
82
|
'*.d.ts',
|
|
83
83
|
```
|
|
84
84
|
|
|
@@ -89,10 +89,10 @@ $ trv pack:assemble --help
|
|
|
89
89
|
Usage: pack:assemble [options] [mode]
|
|
90
90
|
|
|
91
91
|
Options:
|
|
92
|
-
-w, --workspace <workspace>
|
|
93
|
-
-k, --keep-source
|
|
94
|
-
-r, --readonly
|
|
95
|
-
-h, --help
|
|
92
|
+
-w, --workspace <workspace> Working directory
|
|
93
|
+
-k, --keep-source Should source be preserved
|
|
94
|
+
-r, --readonly Build a readonly deployable
|
|
95
|
+
-h, --help display help for command
|
|
96
96
|
|
|
97
97
|
Available Pack Modes:
|
|
98
98
|
* default [support/pack.config.ts]
|
|
@@ -119,8 +119,8 @@ $ trv pack:zip --help
|
|
|
119
119
|
Usage: pack:zip [options] [mode]
|
|
120
120
|
|
|
121
121
|
Options:
|
|
122
|
-
-w, --workspace <workspace> Working directory
|
|
123
|
-
-o, --output <output> Output File
|
|
122
|
+
-w, --workspace <workspace> Working directory
|
|
123
|
+
-o, --output <output> Output File
|
|
124
124
|
-h, --help display help for command
|
|
125
125
|
|
|
126
126
|
Available Pack Modes:
|
|
@@ -148,12 +148,12 @@ $ trv pack:docker --help
|
|
|
148
148
|
Usage: pack:docker [options] [mode]
|
|
149
149
|
|
|
150
150
|
Options:
|
|
151
|
-
-w, --workspace <workspace> Working directory
|
|
152
|
-
-i, --image <image> Docker Image to extend
|
|
153
|
-
-n, --name <name> Image Name
|
|
154
|
-
-t, --tag <tag> Image Tag (default: [
|
|
151
|
+
-w, --workspace <workspace> Working directory
|
|
152
|
+
-i, --image <image> Docker Image to extend
|
|
153
|
+
-n, --name <name> Image Name
|
|
154
|
+
-t, --tag <tag> Image Tag (default: [])
|
|
155
155
|
-p, --port <port> Image Port (default: [])
|
|
156
|
-
-x, --push
|
|
156
|
+
-x, --push Push Tags
|
|
157
157
|
-r, --registry <registry> Registry
|
|
158
158
|
-h, --help display help for command
|
|
159
159
|
|
|
@@ -171,7 +171,7 @@ Various modules may provide customizations to the default `pack.config.ts` to al
|
|
|
171
171
|
import * as fs from 'fs';
|
|
172
172
|
|
|
173
173
|
import { PathUtil } from '@travetto/boot';
|
|
174
|
-
import type { AllConfigPartial
|
|
174
|
+
import type { AllConfigPartial } from '@travetto/pack';
|
|
175
175
|
|
|
176
176
|
export const config: AllConfigPartial = {
|
|
177
177
|
name: 'rest/aws-lambda',
|
|
@@ -185,7 +185,7 @@ export const config: AllConfigPartial = {
|
|
|
185
185
|
NO_COLOR: '1'
|
|
186
186
|
},
|
|
187
187
|
postProcess: [{
|
|
188
|
-
'Lambda Entrypoint':
|
|
188
|
+
['Lambda Entrypoint']: cfg =>
|
|
189
189
|
fs.promises.copyFile(
|
|
190
190
|
PathUtil.resolveUnix(__dirname, 'aws-lambda.handler.js'),
|
|
191
191
|
PathUtil.resolveUnix(cfg.workspace, 'index.js')
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { FsUtil, PathUtil } from '@travetto/boot/src';
|
|
2
|
-
import { BasePlugin } from '@travetto/cli/src/plugin-base';
|
|
3
1
|
import * as fs from 'fs';
|
|
4
2
|
|
|
3
|
+
import { FsUtil, PathUtil } from '@travetto/boot';
|
|
4
|
+
import { BasePlugin } from '@travetto/cli/src/plugin-base';
|
|
5
|
+
|
|
5
6
|
export class PackDockerExportPlugin extends BasePlugin {
|
|
6
7
|
|
|
7
8
|
name = 'pack:docker-export';
|
|
@@ -16,7 +17,7 @@ export class PackDockerExportPlugin extends BasePlugin {
|
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
async action(...args:
|
|
20
|
+
async action(...args: unknown[]) {
|
|
20
21
|
const files = ['src', 'bin', 'support', 'resources', 'package.json', 'package-lock.json', ...this.cmd.add]
|
|
21
22
|
.filter(x => FsUtil.existsSync(PathUtil.resolveUnix(x)));
|
|
22
23
|
|
package/bin/operation/pack.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Zip, ZipConfig } from './zip';
|
|
|
9
9
|
type DeepPartial<T> = {
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
11
|
[P in keyof T]?: (T[P] extends (number | string | boolean | undefined | RegExp | ((...args: any[]) => any)) ?
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
13
|
(T[P] | undefined) : (T[P] extends any[] ? DeepPartial<T[P][number]>[] : DeepPartial<T[P]>));
|
|
13
14
|
};
|
|
14
15
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/pack",
|
|
3
3
|
"displayName": "Pack",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"description": "Code packing utilities",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"travetto",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"directory": "module/pack"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/base": "^2.0
|
|
29
|
-
"@types/picomatch": "^2.
|
|
30
|
-
"picomatch": "^2.3.
|
|
28
|
+
"@travetto/base": "^2.1.0",
|
|
29
|
+
"@types/picomatch": "^2.3.0",
|
|
30
|
+
"picomatch": "^2.3.1"
|
|
31
31
|
},
|
|
32
32
|
"optionalPeerDependencies": {
|
|
33
|
-
"@travetto/cli": "^2.0
|
|
33
|
+
"@travetto/cli": "^2.1.0"
|
|
34
34
|
},
|
|
35
35
|
"docDependencies": {
|
|
36
36
|
"@travetto/rest": true
|
package/support/pack.config.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AllConfigPartial } from '../bin/operation/pack';
|
|
2
2
|
|
|
3
|
+
const mod = (f: string) => `node_modules/${f}`;
|
|
4
|
+
|
|
3
5
|
export const config: AllConfigPartial = {
|
|
4
6
|
name: 'default',
|
|
5
7
|
assemble: {
|
|
@@ -11,13 +13,13 @@ export const config: AllConfigPartial = {
|
|
|
11
13
|
TRV_DYNAMIC: '0'
|
|
12
14
|
},
|
|
13
15
|
add: [
|
|
14
|
-
{ '
|
|
15
|
-
{ '
|
|
16
|
+
{ [mod('@travetto/cli/bin/trv.js')]: mod('.bin/trv') },
|
|
17
|
+
{ [mod('lodash/lodash.min.js')]: mod('lodash/lodash.js') },
|
|
16
18
|
],
|
|
17
19
|
excludeCompile: [
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
20
|
+
mod('@travetto/*/doc/'),
|
|
21
|
+
mod('@travetto/*/e2e/'),
|
|
22
|
+
mod('@travetto/*/test/'),
|
|
21
23
|
],
|
|
22
24
|
exclude: [
|
|
23
25
|
'bower.json',
|
|
@@ -28,7 +30,7 @@ export const config: AllConfigPartial = {
|
|
|
28
30
|
'*.lock',
|
|
29
31
|
'*.html',
|
|
30
32
|
'*.mjs',
|
|
31
|
-
'
|
|
33
|
+
mod('**/*.ts'),
|
|
32
34
|
'*.d.ts',
|
|
33
35
|
'*.tsbuildinfo',
|
|
34
36
|
'*.java',
|
|
@@ -37,17 +39,17 @@ export const config: AllConfigPartial = {
|
|
|
37
39
|
'.npmignore',
|
|
38
40
|
'.*.yml',
|
|
39
41
|
'cache/compiler.*.log',
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
42
|
+
mod('lodash/lodash.min.js'),
|
|
43
|
+
mod('source-map-support/node_modules/source-map'),
|
|
44
|
+
mod('source-map-support/browser-source-map-support.js'),
|
|
45
|
+
mod('bson/browser_build/'),
|
|
46
|
+
mod('**/tsconfig.json'),
|
|
47
|
+
mod('**/tsconfig.*.json'),
|
|
48
|
+
mod('@travetto/*/doc.ts'),
|
|
49
|
+
mod('typescript/'),
|
|
50
|
+
mod('@types/'),
|
|
51
|
+
`^./${mod('@travetto/**/*.ts')}`,
|
|
52
|
+
`^./${mod('@travetto/boot/tsconfig.trv.json')}`,
|
|
51
53
|
'^./resources/',
|
|
52
54
|
'^./src/',
|
|
53
55
|
]
|