@ms-cloudpack/cli 0.1.2 → 0.2.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/CHANGELOG.json +88 -1
- package/CHANGELOG.md +33 -2
- package/lib/commands/start/start.js +1 -1
- package/lib/commands/start/start.js.map +1 -1
- package/lib/commands/start/startAppServer.js +17 -12
- package/lib/commands/start/startAppServer.js.map +1 -1
- package/lib/commands/start/startBundleServer.js +45 -27
- package/lib/commands/start/startBundleServer.js.map +1 -1
- package/lib/getVersion.js +2 -2
- package/lib/getVersion.js.map +1 -1
- package/lib/tsdoc-metadata.json +11 -0
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,94 @@
|
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 08 Jun 2022 20:06:34 GMT",
|
|
6
|
+
"tag": "@ms-cloudpack/cli_v0.2.2",
|
|
7
|
+
"version": "0.2.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "dzearing@microsoft.com",
|
|
12
|
+
"package": "@ms-cloudpack/cli",
|
|
13
|
+
"commit": "0e78dd2f1cf4d366f04d52d54996418c4febcfb6",
|
|
14
|
+
"comment": "Integrating type-fest to address typings, fixing a few edge cases."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@ms-cloudpack/cli",
|
|
19
|
+
"comment": "Bump @ms-cloudpack/bundler to v0.1.5",
|
|
20
|
+
"commit": "0e78dd2f1cf4d366f04d52d54996418c4febcfb6"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@ms-cloudpack/cli",
|
|
25
|
+
"comment": "Bump @ms-cloudpack/package-utilities to v0.5.0",
|
|
26
|
+
"commit": "0e78dd2f1cf4d366f04d52d54996418c4febcfb6"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@ms-cloudpack/cli",
|
|
31
|
+
"comment": "Bump @ms-cloudpack/path-utilities to v0.3.1",
|
|
32
|
+
"commit": "0e78dd2f1cf4d366f04d52d54996418c4febcfb6"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"date": "Thu, 26 May 2022 02:50:21 GMT",
|
|
39
|
+
"tag": "@ms-cloudpack/cli_v0.2.1",
|
|
40
|
+
"version": "0.2.1",
|
|
41
|
+
"comments": {
|
|
42
|
+
"patch": [
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@ms-cloudpack/cli",
|
|
46
|
+
"comment": "Bump @ms-cloudpack/bundler to v0.1.4",
|
|
47
|
+
"commit": "c6d1b54c1b196b6e22437f80e46433984d822d53"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@ms-cloudpack/cli",
|
|
52
|
+
"comment": "Bump @ms-cloudpack/package-utilities to v0.4.1",
|
|
53
|
+
"commit": "c6d1b54c1b196b6e22437f80e46433984d822d53"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"date": "Wed, 25 May 2022 21:40:45 GMT",
|
|
60
|
+
"tag": "@ms-cloudpack/cli_v0.2.0",
|
|
61
|
+
"version": "0.2.0",
|
|
62
|
+
"comments": {
|
|
63
|
+
"minor": [
|
|
64
|
+
{
|
|
65
|
+
"author": "dzearing@microsoft.com",
|
|
66
|
+
"package": "@ms-cloudpack/cli",
|
|
67
|
+
"commit": "c81fea1af8bedcd81366fbddb199dd2c0e6cbaa7",
|
|
68
|
+
"comment": "Updating the page to emit the right script url."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "beachball",
|
|
72
|
+
"package": "@ms-cloudpack/cli",
|
|
73
|
+
"comment": "Bump @ms-cloudpack/bundler to v0.1.3",
|
|
74
|
+
"commit": "c81fea1af8bedcd81366fbddb199dd2c0e6cbaa7"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "@ms-cloudpack/cli",
|
|
79
|
+
"comment": "Bump @ms-cloudpack/package-utilities to v0.4.0",
|
|
80
|
+
"commit": "c81fea1af8bedcd81366fbddb199dd2c0e6cbaa7"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"author": "beachball",
|
|
84
|
+
"package": "@ms-cloudpack/cli",
|
|
85
|
+
"comment": "Bump @ms-cloudpack/path-utilities to v0.3.0",
|
|
86
|
+
"commit": "c81fea1af8bedcd81366fbddb199dd2c0e6cbaa7"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"date": "Mon, 23 May 2022 23:22:13 GMT",
|
|
6
93
|
"tag": "@ms-cloudpack/cli_v0.1.2",
|
|
7
94
|
"version": "0.1.2",
|
|
8
95
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
# Change Log - @ms-cloudpack/cli
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 08 Jun 2022 20:06:34 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.2.2
|
|
8
|
+
|
|
9
|
+
Wed, 08 Jun 2022 20:06:34 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Integrating type-fest to address typings, fixing a few edge cases. (dzearing@microsoft.com)
|
|
14
|
+
- Bump @ms-cloudpack/bundler to v0.1.5
|
|
15
|
+
- Bump @ms-cloudpack/package-utilities to v0.5.0
|
|
16
|
+
- Bump @ms-cloudpack/path-utilities to v0.3.1
|
|
17
|
+
|
|
18
|
+
## 0.2.1
|
|
19
|
+
|
|
20
|
+
Thu, 26 May 2022 02:50:21 GMT
|
|
21
|
+
|
|
22
|
+
### Patches
|
|
23
|
+
|
|
24
|
+
- Bump @ms-cloudpack/bundler to v0.1.4
|
|
25
|
+
- Bump @ms-cloudpack/package-utilities to v0.4.1
|
|
26
|
+
|
|
27
|
+
## 0.2.0
|
|
28
|
+
|
|
29
|
+
Wed, 25 May 2022 21:40:45 GMT
|
|
30
|
+
|
|
31
|
+
### Minor changes
|
|
32
|
+
|
|
33
|
+
- Updating the page to emit the right script url. (dzearing@microsoft.com)
|
|
34
|
+
- Bump @ms-cloudpack/bundler to v0.1.3
|
|
35
|
+
- Bump @ms-cloudpack/package-utilities to v0.4.0
|
|
36
|
+
- Bump @ms-cloudpack/path-utilities to v0.3.0
|
|
37
|
+
|
|
7
38
|
## 0.1.2
|
|
8
39
|
|
|
9
|
-
Mon, 23 May 2022 23:22:
|
|
40
|
+
Mon, 23 May 2022 23:22:13 GMT
|
|
10
41
|
|
|
11
42
|
### Patches
|
|
12
43
|
|
|
@@ -17,7 +17,7 @@ export async function start() {
|
|
|
17
17
|
appServer.close();
|
|
18
18
|
process.exit(0);
|
|
19
19
|
});
|
|
20
|
-
//
|
|
20
|
+
// Open the browser.
|
|
21
21
|
openBrowser(`http://localhost:${appServer.port}`);
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=start.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/commands/start/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAk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C9B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK;QACxB,YAAY,CAAC,KAAK,EAAE,CAAC;QACrB,SAAS,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,oBAAoB;IACpB,WAAW,CAAC,oBAAoB,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// import type { Session } from './types.js';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { slash } from '@ms-cloudpack/path-utilities';
|
|
4
|
-
import { createImportMap } from '@ms-cloudpack/package-utilities';
|
|
4
|
+
import { createImportMap, getPackageDefinition } from '@ms-cloudpack/package-utilities';
|
|
5
5
|
import { createExpressApp } from '@ms-cloudpack/create-express-app';
|
|
6
6
|
/**
|
|
7
7
|
* The app server hosts the appropriate routes for the web app, primarily returning html content
|
|
@@ -13,25 +13,30 @@ import { createExpressApp } from '@ms-cloudpack/create-express-app';
|
|
|
13
13
|
*/
|
|
14
14
|
export async function startAppServer(session, bundleServerUrl) {
|
|
15
15
|
const importMap = await createImportMap(session.resolveMap, bundleServerUrl);
|
|
16
|
+
const definition = await getPackageDefinition(session.appPath, true);
|
|
16
17
|
const { server, port } = await createExpressApp([5000, 5001, 5002, 5003], (app) => {
|
|
17
18
|
// Set up the express app routes.
|
|
18
19
|
app.get('*', async (req, res) => {
|
|
20
|
+
if (!definition) {
|
|
21
|
+
res.status(500).send(`There was no package.json located at "${session.appPath}".`);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
19
24
|
const requestPath = slash(req.path.substring(1));
|
|
20
25
|
const requestExt = path.extname(requestPath);
|
|
21
|
-
|
|
26
|
+
// TODO: this should derive which scripts load for each route. getEntryScript(requestPath);
|
|
27
|
+
const entryScript = `${bundleServerUrl}/${definition.name}@${definition.version}/lib/index.js`;
|
|
22
28
|
console.log(`App server: Request: ${requestPath}, ext: ${requestExt}, ${port}`);
|
|
23
29
|
res.cookie('cloudpack-session-id', session.id);
|
|
24
30
|
res.set('Content-Security-Policy', `connect-src 'self' ws:;`);
|
|
25
|
-
res.send(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`);
|
|
31
|
+
res.send(`<!DOCTYPE html>
|
|
32
|
+
<html>
|
|
33
|
+
<head>
|
|
34
|
+
<script type="importmap">${JSON.stringify(importMap, null, 2)}</script>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<script type="module" src="${entryScript}"></script>
|
|
38
|
+
</body>
|
|
39
|
+
</html>`);
|
|
35
40
|
});
|
|
36
41
|
});
|
|
37
42
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startAppServer.js","sourceRoot":"","sources":["../../../src/commands/start/startAppServer.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"startAppServer.js","sourceRoot":"","sources":["../../../src/commands/start/startAppServer.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAgB,EAAE,eAAuB;IAC5E,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,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G,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;QAC3B,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { bundlePackage } from '@ms-cloudpack/bundler';
|
|
|
2
2
|
import { createExpressApp } from '@ms-cloudpack/create-express-app';
|
|
3
3
|
import { readJson, writeJsonSync } from '@ms-cloudpack/json-utilities';
|
|
4
4
|
import { isExternalPackage } from '@ms-cloudpack/package-utilities';
|
|
5
|
-
import { slash } from '@ms-cloudpack/path-utilities';
|
|
5
|
+
import { isFolder, slash } from '@ms-cloudpack/path-utilities';
|
|
6
6
|
import filenamify from 'filenamify';
|
|
7
7
|
import fsExtra from 'fs-extra';
|
|
8
8
|
import hash from 'object-hash';
|
|
@@ -20,9 +20,11 @@ export async function startBundleServer(session) {
|
|
|
20
20
|
app.get('*', async (req, res) => {
|
|
21
21
|
const requestPath = slash(req.path.substring(1));
|
|
22
22
|
const { packageName, version, filePath } = parseRequestInfo(requestPath);
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
const packageEntry = resolveMap[packageName];
|
|
24
|
+
const packagePath = !!version && packageEntry?.version === version
|
|
25
|
+
? packageEntry?.path
|
|
26
|
+
: packageEntry?.scopedVersions?.[version]?.path;
|
|
27
|
+
const force = req.query.force !== undefined;
|
|
26
28
|
console.log(`BundleServer: Request: "${packageName}@${version}${filePath}"`);
|
|
27
29
|
// If the package is missing, invalid arguments.
|
|
28
30
|
if (!requestPath || !packageName) {
|
|
@@ -38,24 +40,32 @@ export async function startBundleServer(session) {
|
|
|
38
40
|
res.status(404).send(`Unrecognized package "${packageName}".`);
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
|
-
res.redirect(`/${packageName}@${resolvedPackage.version}
|
|
43
|
+
res.redirect(`/${packageName}@${resolvedPackage.version}${filePath}`);
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
44
46
|
// If it's an unrecognized package, 404.
|
|
45
47
|
if (!packagePath) {
|
|
46
48
|
console.log(`BundleServer: Response (404): "${packageName}@${version}${filePath}"`);
|
|
47
|
-
res
|
|
49
|
+
res
|
|
50
|
+
.status(404)
|
|
51
|
+
.send(`The requested package "${packageName}@${version}${filePath}" was not found in the resolve map.`);
|
|
48
52
|
return;
|
|
49
53
|
}
|
|
50
54
|
// Create an identifier for the bundle.
|
|
55
|
+
const isExternal = isExternalPackage(packagePath);
|
|
51
56
|
const bundleId = hash({
|
|
52
57
|
name: packageName,
|
|
53
58
|
version: isExternal ? version : packagePath,
|
|
54
59
|
mode: session.mode,
|
|
55
60
|
});
|
|
56
61
|
// Derive where the output should be.
|
|
57
|
-
const outputPath = path.join(os.tmpdir(), 'cloudpack-output', `${filenamify(packageName)}-${
|
|
62
|
+
const outputPath = path.join(os.tmpdir(), 'cloudpack-output', `${filenamify(packageName)}-${version}-${bundleId}`);
|
|
58
63
|
let action = createdBundles[bundleId];
|
|
64
|
+
// Clear the created bundle if the folder doesn't exist.
|
|
65
|
+
if (action && !isFolder(outputPath)) {
|
|
66
|
+
action = undefined;
|
|
67
|
+
delete createdBundles[bundleId];
|
|
68
|
+
}
|
|
59
69
|
// If we haven't completed this bundle, enqueue it or piggyback on an existing run.
|
|
60
70
|
if (!action || force) {
|
|
61
71
|
let pendingAction = pendingBundles[bundleId];
|
|
@@ -64,25 +74,33 @@ export async function startBundleServer(session) {
|
|
|
64
74
|
pendingAction = pendingBundles[bundleId] = new Promise((resolve) => {
|
|
65
75
|
// Async helper so that we can await and call resolve.
|
|
66
76
|
async function createBundle() {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
packagePath,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
try {
|
|
78
|
+
console.log(`BundleServer: No previous action found, bundling: "${packageName}@${version}${filePath}"`);
|
|
79
|
+
await ensureDir(outputPath);
|
|
80
|
+
// This check shouldn't be required because we throw above if packagePath is undefined,
|
|
81
|
+
// but TypeScript insists it is necessary.
|
|
82
|
+
if (packagePath) {
|
|
83
|
+
const bundlerResult = await bundlePackage({
|
|
84
|
+
packagePath,
|
|
85
|
+
outputPath,
|
|
86
|
+
outputType: 'library',
|
|
87
|
+
});
|
|
88
|
+
console.log(`BundleServer: Bundle complete: ${outputPath}`);
|
|
89
|
+
createdBundles[bundleId] = {
|
|
90
|
+
id: bundleId,
|
|
91
|
+
packageName: packageName,
|
|
92
|
+
packageVersion: version,
|
|
93
|
+
packagePath,
|
|
94
|
+
outputPath,
|
|
95
|
+
result: bundlerResult.errors?.length == 0 ? 'success' : 'errors',
|
|
96
|
+
errors: bundlerResult.errors,
|
|
97
|
+
warnings: bundlerResult.warnings,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
delete pendingBundles[bundleId];
|
|
103
|
+
}
|
|
86
104
|
return createdBundles[bundleId];
|
|
87
105
|
}
|
|
88
106
|
// Call the async function and tie it in with the promise.
|
|
@@ -108,7 +126,7 @@ export async function startBundleServer(session) {
|
|
|
108
126
|
}
|
|
109
127
|
});
|
|
110
128
|
});
|
|
111
|
-
console.log(`
|
|
129
|
+
console.log(`BundleServer: started (http://localhost:${port})`);
|
|
112
130
|
return {
|
|
113
131
|
close: () => {
|
|
114
132
|
writeJsonSync(bundleLookupPath, createdBundles);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startBundleServer.js","sourceRoot":"","sources":["../../../src/commands/start/startBundleServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC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ACrG;gBAED,MAAM,GAAG,MAAM,aAAa,CAAC;aAC9B;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,4CAA4C,WAAW,IAAI,OAAO,GAAG,QAAQ,GAAG,CAAC,CAAC;aAC/F;YAED,qDAAqD;YACrD,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE;gBAC9B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC3C;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,oCAAoC,WAAW,IAAI,OAAO,GAAG,QAAQ,GAAG,CAAC,CAAC;gBACtF,4BAA4B;gBAC5B,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;aAC/C;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,2CAA2C,IAAI,GAAG,CAAC,CAAC;IAEhE,OAAO;QACL,KAAK,EAAE,GAAG,EAAE;YACV,aAAa,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;YAChD,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;QACD,IAAI;KACL,CAAC;AACJ,CAAC"}
|
package/lib/getVersion.js
CHANGED
|
@@ -4,7 +4,7 @@ import { findPackageRoot } from '@ms-cloudpack/path-utilities';
|
|
|
4
4
|
import { readJsonSync } from '@ms-cloudpack/json-utilities';
|
|
5
5
|
export function getVersion() {
|
|
6
6
|
const packageJSONpath = path.join(findPackageRoot(path.dirname(fileURLToPath(import.meta.url))), 'package.json');
|
|
7
|
-
const
|
|
8
|
-
return
|
|
7
|
+
const { version = 'dev' } = readJsonSync(packageJSONpath);
|
|
8
|
+
return version;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=getVersion.js.map
|
package/lib/getVersion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVersion.js","sourceRoot":"","sources":["../src/getVersion.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,MAAM,UAAU,UAAU;IACxB,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IACjH,MAAM,
|
|
1
|
+
{"version":3,"file":"getVersion.js","sourceRoot":"","sources":["../src/getVersion.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,MAAM,UAAU,UAAU;IACxB,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IACjH,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC,eAAe,CAAgB,CAAC;IAEzE,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.25.0"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "The Cloudpack command line interface - a tool for managing fast inner and outer looping in web apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"cloudpack": "./lib/cloudpack.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ms-cloudpack/bundler": "^0.1.
|
|
19
|
+
"@ms-cloudpack/bundler": "^0.1.5",
|
|
20
20
|
"@ms-cloudpack/create-express-app": "^0.1.0",
|
|
21
21
|
"@ms-cloudpack/json-utilities": "^0.0.3",
|
|
22
|
-
"@ms-cloudpack/package-utilities": "^0.
|
|
23
|
-
"@ms-cloudpack/path-utilities": "^0.
|
|
22
|
+
"@ms-cloudpack/package-utilities": "^0.5.0",
|
|
23
|
+
"@ms-cloudpack/path-utilities": "^0.3.1",
|
|
24
24
|
"commander": "^9.1.0",
|
|
25
25
|
"filenamify": "^5.1.0",
|
|
26
26
|
"fs-extra": "^10.1.0",
|