@travetto/pack 5.0.0-rc.7 → 5.0.0-rc.9
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": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.9",
|
|
4
4
|
"description": "Code packing utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"travetto",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"@rollup/plugin-json": "^6.1.0",
|
|
30
30
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
31
31
|
"@rollup/plugin-terser": "^0.4.4",
|
|
32
|
-
"@travetto/runtime": "^5.0.0-rc.
|
|
33
|
-
"@travetto/terminal": "^5.0.0-rc.
|
|
32
|
+
"@travetto/runtime": "^5.0.0-rc.9",
|
|
33
|
+
"@travetto/terminal": "^5.0.0-rc.9",
|
|
34
34
|
"rollup": "^4.18.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@travetto/cli": "^5.0.0-rc.
|
|
37
|
+
"@travetto/cli": "^5.0.0-rc.9"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"@travetto/cli": {
|
package/src/config-util.ts
CHANGED
|
@@ -74,7 +74,7 @@ export class PackConfigUtil {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
|
-
* Docker app files copied
|
|
77
|
+
* Docker app files copied with proper permissions
|
|
78
78
|
*/
|
|
79
79
|
static dockerAppFiles(cfg: DockerPackConfig): string {
|
|
80
80
|
const { user, group, folder } = cfg.dockerRuntime;
|
|
@@ -22,8 +22,13 @@ export class DockerPackOperation {
|
|
|
22
22
|
// Read os before writing
|
|
23
23
|
cfg.dockerRuntime.os = await PackUtil.runCommand(
|
|
24
24
|
['docker', 'run', '--entrypoint', '/bin/sh', cfg.dockerImage, '-c', 'cat /etc/*release*']
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
).then(out => {
|
|
26
|
+
const found = out.match(/\b(?:debian|alpine|centos)\b/i)?.[0].toLowerCase();
|
|
27
|
+
switch (found) {
|
|
28
|
+
case 'debian': case 'alpine': case 'centos': return found;
|
|
29
|
+
default: return 'unknown';
|
|
30
|
+
}
|
|
31
|
+
});
|
|
27
32
|
yield* PackOperation.title(cfg, cliTpl`${{ title: 'Detected Image OS' }} ${{ param: cfg.dockerImage }} as ${{ param: cfg.dockerRuntime.os }}`);
|
|
28
33
|
}
|
|
29
34
|
|
package/support/bin/util.ts
CHANGED
package/support/rollup/config.ts
CHANGED
|
@@ -21,9 +21,16 @@ function getFilesFromModule(m: ManifestModule): string[] {
|
|
|
21
21
|
.map(([f]) => ManifestModuleUtil.withOutputExtension(path.resolve(m.outputFolder, f)));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
function getFormat(value: string = 'commonjs'): NodeModuleType {
|
|
25
|
+
switch (value) {
|
|
26
|
+
case 'module':
|
|
27
|
+
case 'commonjs': return value;
|
|
28
|
+
default: return 'commonjs';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
export function getOutput(): OutputOptions {
|
|
25
|
-
|
|
26
|
-
const format = (process.env.BUNDLE_FORMAT ?? 'commonjs') as NodeModuleType;
|
|
33
|
+
const format = getFormat(process.env.BUNDLE_FORMAT);
|
|
27
34
|
const dir = process.env.BUNDLE_OUTPUT!;
|
|
28
35
|
const mainFile = process.env.BUNDLE_MAIN_FILE!;
|
|
29
36
|
return {
|