@ms-cloudpack/cli 0.42.4 → 0.43.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/lib/commands/bundle/bundle.d.ts.map +1 -1
- package/lib/commands/bundle/bundle.js +12 -24
- package/lib/commands/bundle/bundle.js.map +1 -1
- package/lib/commands/init/InitSummaryData.d.ts +18 -0
- package/lib/commands/init/InitSummaryData.d.ts.map +1 -0
- package/lib/commands/init/InitSummaryData.js +57 -0
- package/lib/commands/init/InitSummaryData.js.map +1 -0
- package/lib/commands/init/bundleAndGetImports.d.ts +4 -4
- package/lib/commands/init/bundleAndGetImports.d.ts.map +1 -1
- package/lib/commands/init/bundleAndGetImports.js +12 -7
- package/lib/commands/init/bundleAndGetImports.js.map +1 -1
- package/lib/commands/init/evaluateImportsForOverrides.d.ts +3 -1
- package/lib/commands/init/evaluateImportsForOverrides.d.ts.map +1 -1
- package/lib/commands/init/evaluateImportsForOverrides.js +34 -22
- package/lib/commands/init/evaluateImportsForOverrides.js.map +1 -1
- package/lib/commands/init/formatInitSummary.d.ts +7 -0
- package/lib/commands/init/formatInitSummary.d.ts.map +1 -0
- package/lib/commands/init/formatInitSummary.js +77 -0
- package/lib/commands/init/formatInitSummary.js.map +1 -0
- package/lib/commands/init/init.d.ts +3 -7
- package/lib/commands/init/init.d.ts.map +1 -1
- package/lib/commands/init/init.js +58 -83
- package/lib/commands/init/init.js.map +1 -1
- package/lib/commands/init/types/GeneratedChange.d.ts +6 -0
- package/lib/commands/init/types/GeneratedChange.d.ts.map +1 -0
- package/lib/commands/init/types/GeneratedChange.js +2 -0
- package/lib/commands/init/types/GeneratedChange.js.map +1 -0
- package/lib/commands/init/types/GeneratedPackageChanges.d.ts +6 -0
- package/lib/commands/init/types/GeneratedPackageChanges.d.ts.map +1 -0
- package/lib/commands/init/types/GeneratedPackageChanges.js +2 -0
- package/lib/commands/init/types/GeneratedPackageChanges.js.map +1 -0
- package/lib/commands/init/types/InitPackageIdentifier.d.ts +6 -0
- package/lib/commands/init/types/InitPackageIdentifier.d.ts.map +1 -0
- package/lib/commands/init/types/InitPackageIdentifier.js +2 -0
- package/lib/commands/init/types/InitPackageIdentifier.js.map +1 -0
- package/lib/commands/init/types/InitPackageResult.d.ts +7 -0
- package/lib/commands/init/types/InitPackageResult.d.ts.map +1 -0
- package/lib/commands/init/types/InitPackageResult.js +2 -0
- package/lib/commands/init/types/InitPackageResult.js.map +1 -0
- package/lib/commands/init/types/InitPackageResultErrors.d.ts +6 -0
- package/lib/commands/init/types/InitPackageResultErrors.d.ts.map +1 -0
- package/lib/commands/init/types/InitPackageResultErrors.js +2 -0
- package/lib/commands/init/types/InitPackageResultErrors.js.map +1 -0
- package/lib/commands/init/types/InitPackageResultWarnings.d.ts +6 -0
- package/lib/commands/init/types/InitPackageResultWarnings.d.ts.map +1 -0
- package/lib/commands/init/types/InitPackageResultWarnings.js +2 -0
- package/lib/commands/init/types/InitPackageResultWarnings.js.map +1 -0
- package/lib/commands/init/types/InitSummary.d.ts +14 -0
- package/lib/commands/init/types/InitSummary.d.ts.map +1 -0
- package/lib/commands/init/types/InitSummary.js +2 -0
- package/lib/commands/init/types/InitSummary.js.map +1 -0
- package/lib/commands/start/start.js +1 -1
- package/lib/commands/start/start.js.map +1 -1
- package/lib/commands/sync/sync.d.ts.map +1 -1
- package/lib/commands/sync/sync.js +3 -13
- package/lib/commands/sync/sync.js.map +1 -1
- package/lib/common/createApiServer.d.ts +122 -0
- package/lib/common/createApiServer.d.ts.map +1 -0
- package/lib/common/createApiServer.js +18 -0
- package/lib/common/createApiServer.js.map +1 -0
- package/lib/common/createSession.d.ts.map +1 -0
- package/lib/{commands/start → common}/createSession.js +1 -1
- package/lib/common/createSession.js.map +1 -0
- package/package.json +5 -5
- package/lib/commands/start/createSession.d.ts.map +0 -1
- package/lib/commands/start/createSession.js.map +0 -1
- /package/lib/{commands/start → common}/createSession.d.ts +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { TaskContext } from '../types/TaskContext.js';
|
|
2
|
+
export declare function createApiServer(context: TaskContext): Promise<{
|
|
3
|
+
apiServer: {
|
|
4
|
+
url: string;
|
|
5
|
+
port: number;
|
|
6
|
+
ctx: {
|
|
7
|
+
session: import("@ms-cloudpack/api-server").Session;
|
|
8
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
9
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
10
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
11
|
+
watcher: {
|
|
12
|
+
watch({ path, watchPaths, }: {
|
|
13
|
+
path: string;
|
|
14
|
+
watchPaths?: string[] | undefined;
|
|
15
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
16
|
+
unwatchAll(): Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
19
|
+
taskRunner: import("@ms-cloudpack/api-server").TaskRunner;
|
|
20
|
+
dispose(): Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
close: () => Promise<void>;
|
|
23
|
+
addPackageOverride: (options: {
|
|
24
|
+
packageName: string;
|
|
25
|
+
importPath: string;
|
|
26
|
+
filename?: string | undefined;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
getData: (options: {
|
|
29
|
+
path: string[];
|
|
30
|
+
}) => any;
|
|
31
|
+
getSessionId: (options: unknown) => string | undefined;
|
|
32
|
+
onDataChanged: (options: {
|
|
33
|
+
path: string[];
|
|
34
|
+
}) => any;
|
|
35
|
+
openCodeEditor: (options: {
|
|
36
|
+
rootPath: string;
|
|
37
|
+
relativePath?: string | undefined;
|
|
38
|
+
line?: number | undefined;
|
|
39
|
+
column?: number | undefined;
|
|
40
|
+
}) => Promise<void>;
|
|
41
|
+
openConfigEditor: (options: unknown) => Promise<void>;
|
|
42
|
+
openFilePath: (options: {
|
|
43
|
+
rootPath: string;
|
|
44
|
+
relativePath?: string | undefined;
|
|
45
|
+
}) => Promise<void>;
|
|
46
|
+
reportMetric: (options: {
|
|
47
|
+
metric: string;
|
|
48
|
+
value: number;
|
|
49
|
+
}) => void;
|
|
50
|
+
validatePackageOverride: (options: {
|
|
51
|
+
packageName: string;
|
|
52
|
+
importPath: string;
|
|
53
|
+
}) => Promise<{
|
|
54
|
+
fixable: boolean;
|
|
55
|
+
}>;
|
|
56
|
+
syncDownload: (options: unknown) => Promise<void>;
|
|
57
|
+
syncUpload: (options: unknown) => Promise<void>;
|
|
58
|
+
ensurePackageBundled: (options: {
|
|
59
|
+
name: string;
|
|
60
|
+
version: string;
|
|
61
|
+
outputPath?: string | undefined;
|
|
62
|
+
bundlerType?: string | undefined;
|
|
63
|
+
disableSourceMaps?: boolean | undefined;
|
|
64
|
+
shouldRerun?: boolean | undefined;
|
|
65
|
+
shouldWatch?: boolean | undefined;
|
|
66
|
+
shouldForce?: boolean | undefined;
|
|
67
|
+
}) => Promise<{
|
|
68
|
+
bundlerName?: string | undefined;
|
|
69
|
+
inputPath?: string | undefined;
|
|
70
|
+
outputPath?: string | undefined;
|
|
71
|
+
entries?: Record<string, string> | undefined;
|
|
72
|
+
dependencies?: string[] | undefined;
|
|
73
|
+
hash?: string | undefined;
|
|
74
|
+
outputFiles?: {
|
|
75
|
+
outputPath: string;
|
|
76
|
+
entryPoint?: string | undefined;
|
|
77
|
+
exports?: string[] | undefined;
|
|
78
|
+
}[] | undefined;
|
|
79
|
+
errors?: {
|
|
80
|
+
text: string;
|
|
81
|
+
pluginName?: string | undefined;
|
|
82
|
+
type?: string | undefined;
|
|
83
|
+
location?: {
|
|
84
|
+
line: number;
|
|
85
|
+
column: number;
|
|
86
|
+
file: string;
|
|
87
|
+
} | undefined;
|
|
88
|
+
notes?: {
|
|
89
|
+
text?: string | undefined;
|
|
90
|
+
location?: {
|
|
91
|
+
line: number;
|
|
92
|
+
column: number;
|
|
93
|
+
file: string;
|
|
94
|
+
} | undefined;
|
|
95
|
+
}[] | undefined;
|
|
96
|
+
}[] | undefined;
|
|
97
|
+
warnings?: {
|
|
98
|
+
text: string;
|
|
99
|
+
pluginName?: string | undefined;
|
|
100
|
+
type?: string | undefined;
|
|
101
|
+
location?: {
|
|
102
|
+
line: number;
|
|
103
|
+
column: number;
|
|
104
|
+
file: string;
|
|
105
|
+
} | undefined;
|
|
106
|
+
notes?: {
|
|
107
|
+
text?: string | undefined;
|
|
108
|
+
location?: {
|
|
109
|
+
line: number;
|
|
110
|
+
column: number;
|
|
111
|
+
file: string;
|
|
112
|
+
} | undefined;
|
|
113
|
+
}[] | undefined;
|
|
114
|
+
}[] | undefined;
|
|
115
|
+
rawInput?: Record<string, unknown> | undefined;
|
|
116
|
+
rawOutput?: Record<string, unknown> | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
120
|
+
session: import("@ms-cloudpack/api-server").Session;
|
|
121
|
+
}>;
|
|
122
|
+
//# sourceMappingURL=createApiServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApiServer.d.ts","sourceRoot":"","sources":["../../src/common/createApiServer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,wBAAsB,eAAe,CAAC,OAAO,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkBzD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { rootSpan } from '../initTelemetry.js';
|
|
2
|
+
import { createPackageDefinitions } from '@ms-cloudpack/config';
|
|
3
|
+
import { createSession } from './createSession.js';
|
|
4
|
+
export async function createApiServer(context) {
|
|
5
|
+
const { appPath, config, reporter } = context;
|
|
6
|
+
// Initialize package overrides.
|
|
7
|
+
const packages = createPackageDefinitions({ config });
|
|
8
|
+
// Initialize session definition.
|
|
9
|
+
const session = await createSession({ appPath, config }, { reporter, packages });
|
|
10
|
+
const { createCloudpackServer } = await import('@ms-cloudpack/api-server');
|
|
11
|
+
const apiServer = await createCloudpackServer({ session, rootSpan, reporter, packages });
|
|
12
|
+
return {
|
|
13
|
+
apiServer,
|
|
14
|
+
packages,
|
|
15
|
+
session,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=createApiServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApiServer.js","sourceRoot":"","sources":["../../src/common/createApiServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAoB;IACxD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE9C,gCAAgC;IAChC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtD,iCAAiC;IACjC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEjF,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;IAE3E,MAAM,SAAS,GAAG,MAAM,qBAAqB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEzF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import { rootSpan } from '../initTelemetry.js';\nimport { createPackageDefinitions } from '@ms-cloudpack/config';\nimport type { TaskContext } from '../types/TaskContext.js';\nimport { createSession } from './createSession.js';\n\nexport async function createApiServer(context: TaskContext) {\n const { appPath, config, reporter } = context;\n\n // Initialize package overrides.\n const packages = createPackageDefinitions({ config });\n\n // Initialize session definition.\n const session = await createSession({ appPath, config }, { reporter, packages });\n\n const { createCloudpackServer } = await import('@ms-cloudpack/api-server');\n\n const apiServer = await createCloudpackServer({ session, rootSpan, reporter, packages });\n\n return {\n apiServer,\n packages,\n session,\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAO3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAK5D,wBAAsB,aAAa,CACjC,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,CAAC;CACzB,EACD,OAAO,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,uBAAuB,CAAA;CAAE,GACrE,OAAO,CAAC,OAAO,CAAC,CA0DlB"}
|
|
@@ -5,7 +5,7 @@ import fs from 'fs';
|
|
|
5
5
|
import fsExtra from 'fs-extra';
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
|
-
import { resolveDependenciesTask } from '
|
|
8
|
+
import { resolveDependenciesTask } from '../tasks/resolveDependenciesTask.js';
|
|
9
9
|
const dashboardPackageName = '@ms-cloudpack/overlay';
|
|
10
10
|
const dashboardPackagePath = (await resolve(dashboardPackageName, path.dirname(fileURLToPath(import.meta.url)))) || '';
|
|
11
11
|
export async function createSession(options, context) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAgB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAkB,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAK9E,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AACrD,MAAM,oBAAoB,GAAG,CAAC,MAAM,OAAO,CAAC,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAEvH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAGC,EACD,OAAsE;IAEtE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEpC,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IAClB,MAAM,UAAU,GAAG,MAAM,uBAAuB,CAC9C;QACE,OAAO;QACP,eAAe,EAAE,CAAC,oBAAoB,CAAC;KACxC,EACD,OAAO,CACR,CAAC;IAEF,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;KACpD;IAED,IAAI,SAAS,GAA0B,SAAS,CAAC;IACjD,IAAI,cAAc,GAA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EAAE,CAAC,SAAS;QAC7B,YAAY,EAAE,CAAC,YAAuB,EAAE,EAAE;YACxC,SAAS,GAAG,YAAY,CAAC;YACzB,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { v4 as uuid } from 'uuid';\nimport { getLocalCachePath, type Session } from '@ms-cloudpack/api-server';\nimport { resolve, type ImportMap } from '@ms-cloudpack/package-utilities';\nimport fs from 'fs';\nimport fsExtra from 'fs-extra';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { resolveDependenciesTask } from '../tasks/resolveDependenciesTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { CloudpackConfig } from '@ms-cloudpack/config';\n\nconst dashboardPackageName = '@ms-cloudpack/overlay';\nconst dashboardPackagePath = (await resolve(dashboardPackageName, path.dirname(fileURLToPath(import.meta.url)))) || '';\n\nexport async function createSession(\n options: {\n appPath: string;\n config: CloudpackConfig;\n },\n context: { reporter: TaskReporter; packages: PackageDefinitionsCache },\n): Promise<Session> {\n const { appPath, config } = options;\n\n const projectName = path.basename(appPath);\n const id = uuid();\n const resolveMap = await resolveDependenciesTask(\n {\n appPath,\n additionalPaths: [dashboardPackagePath],\n },\n context,\n );\n\n if (!resolveMap) {\n throw new Error('Could not resolve dependencies.');\n }\n\n let importMap: ImportMap | undefined = undefined;\n let sessionVersion = 0;\n\n await fsExtra.ensureDir(getLocalCachePath(appPath));\n const targetVersionsPath = path.join(getLocalCachePath(appPath), 'targetVersions.json');\n const fileExists = await fsExtra.pathExists(targetVersionsPath);\n if (!fileExists) {\n await fsExtra.writeJson(targetVersionsPath, {}, { spaces: 2 });\n }\n const targetVersions = (await fsExtra.readJSON(targetVersionsPath)) as Record<string, number>;\n\n return {\n id,\n appPath,\n config,\n projectName,\n type: 'web-app',\n mode: 'library',\n resolveMap,\n sequence: 0,\n targetVersions,\n getSessionVersion: () => sessionVersion,\n incrementSessionVersion: (version?: number) => {\n if (version === undefined || version > sessionVersion) {\n sessionVersion = version ?? sessionVersion + 1;\n importMap = undefined;\n }\n },\n incrementTargetVersion: (inputPath: string) => {\n targetVersions[inputPath] ??= 0;\n targetVersions[inputPath]++;\n importMap = undefined;\n // eslint-disable-next-line no-restricted-syntax -- this function can't be async\n fs.writeFileSync(targetVersionsPath, JSON.stringify(targetVersions, null, 2));\n },\n getImportMap: () => importMap,\n setImportMap: (newImportMap: ImportMap) => {\n importMap = newImportMap;\n return importMap;\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.1",
|
|
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",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@lage-run/target-graph": "^0.8.6",
|
|
14
|
-
"@ms-cloudpack/api-server": "^0.13.
|
|
15
|
-
"@ms-cloudpack/bundler": "^0.14.
|
|
14
|
+
"@ms-cloudpack/api-server": "^0.13.3",
|
|
15
|
+
"@ms-cloudpack/bundler": "^0.14.8",
|
|
16
16
|
"@ms-cloudpack/config": "^0.11.1",
|
|
17
17
|
"@ms-cloudpack/create-express-app": "^1.3.9",
|
|
18
18
|
"@ms-cloudpack/json-utilities": "^0.0.7",
|
|
19
|
-
"@ms-cloudpack/overlay": "^0.14.
|
|
19
|
+
"@ms-cloudpack/overlay": "^0.14.7",
|
|
20
20
|
"@ms-cloudpack/package-utilities": "^5.1.1",
|
|
21
21
|
"@ms-cloudpack/path-string-parsing": "^1.0.3",
|
|
22
22
|
"@ms-cloudpack/path-utilities": "^2.3.2",
|
|
23
|
-
"@ms-cloudpack/task-reporter": "^0.7.
|
|
23
|
+
"@ms-cloudpack/task-reporter": "^0.7.2",
|
|
24
24
|
"@ms-cloudpack/telemetry": "^0.3.6",
|
|
25
25
|
"commander": "^11.0.0",
|
|
26
26
|
"cross-spawn": "^7.0.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../src/commands/start/createSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAO3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAK5D,wBAAsB,aAAa,CACjC,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,CAAC;CACzB,EACD,OAAO,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,uBAAuB,CAAA;CAAE,GACrE,OAAO,CAAC,OAAO,CAAC,CA0DlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../../src/commands/start/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAgB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAkB,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAKjF,MAAM,oBAAoB,GAAG,uBAAuB,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ACX,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,UAAU;QACV,QAAQ,EAAE,CAAC;QACX,cAAc;QACd,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc;QACvC,uBAAuB,EAAE,CAAC,OAAgB,EAAE,EAAE;YAC5C,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,cAAc,EAAE;gBACrD,cAAc,GAAG,OAAO,IAAI,cAAc,GAAG,CAAC,CAAC;gBAC/C,SAAS,GAAG,SAAS,CAAC;aACvB;QACH,CAAC;QACD,sBAAsB,EAAE,CAAC,SAAiB,EAAE,EAAE;YAC5C,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAChC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5B,SAAS,GAAG,SAAS,CAAC;YACtB,gFAAgF;YAChF,EAAE,CAAC,aAAa,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAChF,CAAC;QACD,YAAY,EAAE,GAAG,EAAE,CAAC,SAAS;QAC7B,YAAY,EAAE,CAAC,YAAuB,EAAE,EAAE;YACxC,SAAS,GAAG,YAAY,CAAC;YACzB,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { v4 as uuid } from 'uuid';\nimport { getLocalCachePath, type Session } from '@ms-cloudpack/api-server';\nimport { resolve, type ImportMap } from '@ms-cloudpack/package-utilities';\nimport fs from 'fs';\nimport fsExtra from 'fs-extra';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { resolveDependenciesTask } from '../../tasks/resolveDependenciesTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { CloudpackConfig } from '@ms-cloudpack/config';\n\nconst dashboardPackageName = '@ms-cloudpack/overlay';\nconst dashboardPackagePath = (await resolve(dashboardPackageName, path.dirname(fileURLToPath(import.meta.url)))) || '';\n\nexport async function createSession(\n options: {\n appPath: string;\n config: CloudpackConfig;\n },\n context: { reporter: TaskReporter; packages: PackageDefinitionsCache },\n): Promise<Session> {\n const { appPath, config } = options;\n\n const projectName = path.basename(appPath);\n const id = uuid();\n const resolveMap = await resolveDependenciesTask(\n {\n appPath,\n additionalPaths: [dashboardPackagePath],\n },\n context,\n );\n\n if (!resolveMap) {\n throw new Error('Could not resolve dependencies.');\n }\n\n let importMap: ImportMap | undefined = undefined;\n let sessionVersion = 0;\n\n await fsExtra.ensureDir(getLocalCachePath(appPath));\n const targetVersionsPath = path.join(getLocalCachePath(appPath), 'targetVersions.json');\n const fileExists = await fsExtra.pathExists(targetVersionsPath);\n if (!fileExists) {\n await fsExtra.writeJson(targetVersionsPath, {}, { spaces: 2 });\n }\n const targetVersions = (await fsExtra.readJSON(targetVersionsPath)) as Record<string, number>;\n\n return {\n id,\n appPath,\n config,\n projectName,\n type: 'web-app',\n mode: 'library',\n resolveMap,\n sequence: 0,\n targetVersions,\n getSessionVersion: () => sessionVersion,\n incrementSessionVersion: (version?: number) => {\n if (version === undefined || version > sessionVersion) {\n sessionVersion = version ?? sessionVersion + 1;\n importMap = undefined;\n }\n },\n incrementTargetVersion: (inputPath: string) => {\n targetVersions[inputPath] ??= 0;\n targetVersions[inputPath]++;\n importMap = undefined;\n // eslint-disable-next-line no-restricted-syntax -- this function can't be async\n fs.writeFileSync(targetVersionsPath, JSON.stringify(targetVersions, null, 2));\n },\n getImportMap: () => importMap,\n setImportMap: (newImportMap: ImportMap) => {\n importMap = newImportMap;\n return importMap;\n },\n };\n}\n"]}
|
|
File without changes
|