@ms-cloudpack/api-server 0.12.2 → 0.13.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/lib/apis/index.d.ts +2 -1
- package/lib/apis/index.d.ts.map +1 -1
- package/lib/apis/index.js +2 -1
- package/lib/apis/index.js.map +1 -1
- package/lib/apis/{sync.d.ts → syncDownload.d.ts} +7 -21
- package/lib/apis/syncDownload.d.ts.map +1 -0
- package/lib/apis/syncDownload.js +12 -0
- package/lib/apis/syncDownload.js.map +1 -0
- package/lib/apis/syncUpload.d.ts +57 -0
- package/lib/apis/syncUpload.d.ts.map +1 -0
- package/lib/apis/syncUpload.js +12 -0
- package/lib/apis/syncUpload.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/trpc/createAppRouter.d.ts +47 -7
- package/lib/trpc/createAppRouter.d.ts.map +1 -1
- package/lib/trpc/createCloudpackServer.d.ts +2 -3
- package/lib/trpc/createCloudpackServer.d.ts.map +1 -1
- package/lib/utilities/ensureRemoteCacheEnabled.d.ts +11 -0
- package/lib/utilities/ensureRemoteCacheEnabled.d.ts.map +1 -0
- package/lib/utilities/ensureRemoteCacheEnabled.js +12 -0
- package/lib/utilities/ensureRemoteCacheEnabled.js.map +1 -0
- package/lib/utilities/findImports.d.ts.map +1 -1
- package/lib/utilities/findImports.js +3 -1
- package/lib/utilities/findImports.js.map +1 -1
- package/package.json +2 -2
- package/lib/apis/sync.d.ts.map +0 -1
- package/lib/apis/sync.js +0 -21
- package/lib/apis/sync.js.map +0 -1
package/lib/apis/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export { openConfigEditor } from './openConfigEditor.js';
|
|
|
7
7
|
export { openFilePath } from './openFilePath.js';
|
|
8
8
|
export { reportMetric } from './reportMetric.js';
|
|
9
9
|
export { validatePackageOverride } from './validatePackageOverride.js';
|
|
10
|
-
export {
|
|
10
|
+
export { syncDownload } from './syncDownload.js';
|
|
11
|
+
export { syncUpload } from './syncUpload.js';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/apis/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
package/lib/apis/index.js
CHANGED
|
@@ -7,5 +7,6 @@ export { openConfigEditor } from './openConfigEditor.js';
|
|
|
7
7
|
export { openFilePath } from './openFilePath.js';
|
|
8
8
|
export { reportMetric } from './reportMetric.js';
|
|
9
9
|
export { validatePackageOverride } from './validatePackageOverride.js';
|
|
10
|
-
export {
|
|
10
|
+
export { syncDownload } from './syncDownload.js';
|
|
11
|
+
export { syncUpload } from './syncUpload.js';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/lib/apis/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { addPackageOverride } from './addPackageOverride.js';\nexport { getData } from './getData.js';\nexport { getSessionId } from './getSessionId.js';\nexport { onDataChanged } from './onDataChanged.js';\nexport { openCodeEditor } from './openCodeEditor.js';\nexport { openConfigEditor } from './openConfigEditor.js';\nexport { openFilePath } from './openFilePath.js';\nexport { reportMetric } from './reportMetric.js';\nexport { validatePackageOverride } from './validatePackageOverride.js';\nexport { syncDownload } from './syncDownload.js';\nexport { syncUpload } from './syncUpload.js';\n"]}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
1
|
import type { Session } from '../types/Session.js';
|
|
3
2
|
import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
|
|
4
|
-
import {
|
|
5
|
-
declare
|
|
6
|
-
isUpload: z.ZodBoolean;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
isUpload: boolean;
|
|
9
|
-
}, {
|
|
10
|
-
isUpload: boolean;
|
|
11
|
-
}>;
|
|
12
|
-
export declare function sync({ input: { isUpload }, ctx: { reporter, session, packages }, }: {
|
|
13
|
-
input: z.infer<typeof ZodSyncInput>;
|
|
3
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
4
|
+
export declare function syncDownload({ ctx: { reporter, session, packages }, }: {
|
|
14
5
|
ctx: {
|
|
15
6
|
reporter: TaskReporter;
|
|
16
7
|
session: Session;
|
|
17
8
|
packages: PackageDefinitionsCache;
|
|
18
9
|
};
|
|
19
10
|
}): Promise<void>;
|
|
20
|
-
export declare namespace
|
|
11
|
+
export declare namespace syncDownload {
|
|
21
12
|
var procedure: import("@trpc/server").BuildProcedure<"mutation", {
|
|
22
13
|
_config: import("@trpc/server").RootConfig<{
|
|
23
14
|
ctx: {
|
|
@@ -40,7 +31,6 @@ export declare namespace sync {
|
|
|
40
31
|
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
41
32
|
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
42
33
|
}>;
|
|
43
|
-
_meta: object;
|
|
44
34
|
_ctx_out: {
|
|
45
35
|
session: Session;
|
|
46
36
|
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
@@ -57,15 +47,11 @@ export declare namespace sync {
|
|
|
57
47
|
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
58
48
|
dispose(): Promise<void>;
|
|
59
49
|
};
|
|
60
|
-
_input_in:
|
|
61
|
-
|
|
62
|
-
};
|
|
63
|
-
_input_out: {
|
|
64
|
-
isUpload: boolean;
|
|
65
|
-
};
|
|
50
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
51
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
66
52
|
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
67
53
|
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
54
|
+
_meta: object;
|
|
68
55
|
}, void>;
|
|
69
56
|
}
|
|
70
|
-
|
|
71
|
-
//# sourceMappingURL=sync.d.ts.map
|
|
57
|
+
//# sourceMappingURL=syncDownload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncDownload.d.ts","sourceRoot":"","sources":["../../src/apis/syncDownload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,wBAAsB,YAAY,CAAC,EACjC,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GACrC,EAAE;IACD,GAAG,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,uBAAuB,CAAA;KAAE,CAAC;CACtF,iBAOA;yBAXqB,YAAY"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { publicProcedure } from '../trpc/common.js';
|
|
2
|
+
import { getBundleDetails } from '../utilities/getBundleDetails.js';
|
|
3
|
+
import { ensureRemoteCacheEnabled } from '../utilities/ensureRemoteCacheEnabled.js';
|
|
4
|
+
export async function syncDownload({ ctx: { reporter, session, packages }, }) {
|
|
5
|
+
const { resolveMap } = session;
|
|
6
|
+
const config = ensureRemoteCacheEnabled(session.config);
|
|
7
|
+
const { syncToLocal } = await import('@ms-cloudpack/remote-cache');
|
|
8
|
+
await syncToLocal({ resolveMap, config, getBundleDetails, packages, reporter });
|
|
9
|
+
}
|
|
10
|
+
// Attach a trpc procedure to the function.
|
|
11
|
+
syncDownload.procedure = publicProcedure.mutation(syncDownload);
|
|
12
|
+
//# sourceMappingURL=syncDownload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncDownload.js","sourceRoot":"","sources":["../../src/apis/syncDownload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAKpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAGrC;IACC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC/B,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAEnE,MAAM,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport { getBundleDetails } from '../utilities/getBundleDetails.js';\n\nimport type { Session } from '../types/Session.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { ensureRemoteCacheEnabled } from '../utilities/ensureRemoteCacheEnabled.js';\n\nexport async function syncDownload({\n ctx: { reporter, session, packages },\n}: {\n ctx: { reporter: TaskReporter; session: Session; packages: PackageDefinitionsCache };\n}) {\n const { resolveMap } = session;\n const config = ensureRemoteCacheEnabled(session.config);\n\n const { syncToLocal } = await import('@ms-cloudpack/remote-cache');\n\n await syncToLocal({ resolveMap, config, getBundleDetails, packages, reporter });\n}\n\n// Attach a trpc procedure to the function.\nsyncDownload.procedure = publicProcedure.mutation(syncDownload);\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Session } from '../types/Session.js';
|
|
2
|
+
import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
|
|
3
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
4
|
+
export declare function syncUpload({ ctx: { reporter, session, packages }, }: {
|
|
5
|
+
ctx: {
|
|
6
|
+
reporter: TaskReporter;
|
|
7
|
+
session: Session;
|
|
8
|
+
packages: PackageDefinitionsCache;
|
|
9
|
+
};
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
export declare namespace syncUpload {
|
|
12
|
+
var procedure: import("@trpc/server").BuildProcedure<"mutation", {
|
|
13
|
+
_config: import("@trpc/server").RootConfig<{
|
|
14
|
+
ctx: {
|
|
15
|
+
session: Session;
|
|
16
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
17
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
18
|
+
reporter: TaskReporter;
|
|
19
|
+
watcher: {
|
|
20
|
+
watch({ path, watchPaths, }: {
|
|
21
|
+
path: string;
|
|
22
|
+
watchPaths?: string[] | undefined;
|
|
23
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
24
|
+
unwatchAll(): Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
packages: PackageDefinitionsCache;
|
|
27
|
+
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
28
|
+
dispose(): Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
meta: object;
|
|
31
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
32
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
33
|
+
}>;
|
|
34
|
+
_ctx_out: {
|
|
35
|
+
session: Session;
|
|
36
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
37
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
38
|
+
reporter: TaskReporter;
|
|
39
|
+
watcher: {
|
|
40
|
+
watch({ path, watchPaths, }: {
|
|
41
|
+
path: string;
|
|
42
|
+
watchPaths?: string[] | undefined;
|
|
43
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
44
|
+
unwatchAll(): Promise<void>;
|
|
45
|
+
};
|
|
46
|
+
packages: PackageDefinitionsCache;
|
|
47
|
+
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
48
|
+
dispose(): Promise<void>;
|
|
49
|
+
};
|
|
50
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
51
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
52
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
53
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
54
|
+
_meta: object;
|
|
55
|
+
}, void>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=syncUpload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncUpload.d.ts","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,wBAAsB,UAAU,CAAC,EAC/B,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GACrC,EAAE;IACD,GAAG,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,uBAAuB,CAAA;KAAE,CAAC;CACtF,iBAOA;yBAXqB,UAAU"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { publicProcedure } from '../trpc/common.js';
|
|
2
|
+
import { getBundleDetails } from '../utilities/getBundleDetails.js';
|
|
3
|
+
import { ensureRemoteCacheEnabled } from '../utilities/ensureRemoteCacheEnabled.js';
|
|
4
|
+
export async function syncUpload({ ctx: { reporter, session, packages }, }) {
|
|
5
|
+
const { resolveMap } = session;
|
|
6
|
+
const config = ensureRemoteCacheEnabled(session.config);
|
|
7
|
+
const { syncToRemote } = await import('@ms-cloudpack/remote-cache');
|
|
8
|
+
await syncToRemote({ resolveMap, config, getBundleDetails, packages, reporter });
|
|
9
|
+
}
|
|
10
|
+
// Attach a trpc procedure to the function.
|
|
11
|
+
syncUpload.procedure = publicProcedure.mutation(syncUpload);
|
|
12
|
+
//# sourceMappingURL=syncUpload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncUpload.js","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAKpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAGrC;IACC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC/B,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAEpE,MAAM,YAAY,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AACnF,CAAC;AAED,2CAA2C;AAC3C,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport { getBundleDetails } from '../utilities/getBundleDetails.js';\n\nimport type { Session } from '../types/Session.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { ensureRemoteCacheEnabled } from '../utilities/ensureRemoteCacheEnabled.js';\n\nexport async function syncUpload({\n ctx: { reporter, session, packages },\n}: {\n ctx: { reporter: TaskReporter; session: Session; packages: PackageDefinitionsCache };\n}) {\n const { resolveMap } = session;\n const config = ensureRemoteCacheEnabled(session.config);\n\n const { syncToRemote } = await import('@ms-cloudpack/remote-cache');\n\n await syncToRemote({ resolveMap, config, getBundleDetails, packages, reporter });\n}\n\n// Attach a trpc procedure to the function.\nsyncUpload.procedure = publicProcedure.mutation(syncUpload);\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { getBundleDetails } from './utilities/getBundleDetails.js';
|
|
|
23
23
|
export { bundleTask } from './utilities/bundleTask.js';
|
|
24
24
|
export { createBundleTask } from './utilities/createBundleTask.js';
|
|
25
25
|
export { createBundleRequestForPackage } from './utilities/createBundleRequestForPackage.js';
|
|
26
|
+
export { findImports } from './utilities/findImports.js';
|
|
26
27
|
export type { BundleRequest } from './types/BundleRequest.js';
|
|
27
28
|
export type { BundleTaskOptions } from './types/BundleTaskOptions.js';
|
|
28
29
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC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SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,kHAAkH;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -12,4 +12,5 @@ export { getBundleDetails } from './utilities/getBundleDetails.js';
|
|
|
12
12
|
export { bundleTask } from './utilities/bundleTask.js';
|
|
13
13
|
export { createBundleTask } from './utilities/createBundleTask.js';
|
|
14
14
|
export { createBundleRequestForPackage } from './utilities/createBundleRequestForPackage.js';
|
|
15
|
+
export { findImports } from './utilities/findImports.js';
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,kHAAkH;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { DevServer } from './types/DevServer.js';\nexport type { PackageOverride } from './types/PackageOverride.js';\nexport type { Session } from './types/Session.js';\nexport type { SessionStats } from './types/SessionStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskError } from './types/TaskError.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\n\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\nexport { startApiServer } from './startApiServer.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskError } from './types/TaskError.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getLocalCachePath } from './utilities/getCachePath.js';\n\n/** Exporting below modules temporarily until we start using ensurePackageBundled api for all bundle operations */\nexport { getBundleDetails } from './utilities/getBundleDetails.js';\nexport { bundleTask } from './utilities/bundleTask.js';\nexport { createBundleTask } from './utilities/createBundleTask.js';\nexport { createBundleRequestForPackage } from './utilities/createBundleRequestForPackage.js';\n\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,kHAAkH;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { DevServer } from './types/DevServer.js';\nexport type { PackageOverride } from './types/PackageOverride.js';\nexport type { Session } from './types/Session.js';\nexport type { SessionStats } from './types/SessionStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskError } from './types/TaskError.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\n\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\nexport { startApiServer } from './startApiServer.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskError } from './types/TaskError.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getLocalCachePath } from './utilities/getCachePath.js';\n\n/** Exporting below modules temporarily until we start using ensurePackageBundled api for all bundle operations */\nexport { getBundleDetails } from './utilities/getBundleDetails.js';\nexport { bundleTask } from './utilities/bundleTask.js';\nexport { createBundleTask } from './utilities/createBundleTask.js';\nexport { createBundleRequestForPackage } from './utilities/createBundleRequestForPackage.js';\nexport { findImports } from './utilities/findImports.js';\n\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\n"]}
|
|
@@ -466,7 +466,7 @@ export declare function createAppRouter(): {
|
|
|
466
466
|
fixable: boolean;
|
|
467
467
|
};
|
|
468
468
|
}, unknown>;
|
|
469
|
-
|
|
469
|
+
syncDownload: import("@trpc/server").BuildProcedure<"mutation", {
|
|
470
470
|
_config: import("@trpc/server").RootConfig<{
|
|
471
471
|
ctx: {
|
|
472
472
|
session: import("../index.js").Session;
|
|
@@ -488,7 +488,6 @@ export declare function createAppRouter(): {
|
|
|
488
488
|
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
489
489
|
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
490
490
|
}>;
|
|
491
|
-
_meta: object;
|
|
492
491
|
_ctx_out: {
|
|
493
492
|
session: import("../index.js").Session;
|
|
494
493
|
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
@@ -505,14 +504,55 @@ export declare function createAppRouter(): {
|
|
|
505
504
|
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
506
505
|
dispose(): Promise<void>;
|
|
507
506
|
};
|
|
508
|
-
_input_in:
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
507
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
508
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
509
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
510
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
511
|
+
_meta: object;
|
|
512
|
+
}, void>;
|
|
513
|
+
syncUpload: import("@trpc/server").BuildProcedure<"mutation", {
|
|
514
|
+
_config: import("@trpc/server").RootConfig<{
|
|
515
|
+
ctx: {
|
|
516
|
+
session: import("../index.js").Session;
|
|
517
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
518
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
519
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
520
|
+
watcher: {
|
|
521
|
+
watch({ path, watchPaths, }: {
|
|
522
|
+
path: string;
|
|
523
|
+
watchPaths?: string[] | undefined;
|
|
524
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
525
|
+
unwatchAll(): Promise<void>;
|
|
526
|
+
};
|
|
527
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
528
|
+
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
529
|
+
dispose(): Promise<void>;
|
|
530
|
+
};
|
|
531
|
+
meta: object;
|
|
532
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
533
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
534
|
+
}>;
|
|
535
|
+
_ctx_out: {
|
|
536
|
+
session: import("../index.js").Session;
|
|
537
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
538
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
539
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
540
|
+
watcher: {
|
|
541
|
+
watch({ path, watchPaths, }: {
|
|
542
|
+
path: string;
|
|
543
|
+
watchPaths?: string[] | undefined;
|
|
544
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
545
|
+
unwatchAll(): Promise<void>;
|
|
546
|
+
};
|
|
547
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
548
|
+
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
549
|
+
dispose(): Promise<void>;
|
|
513
550
|
};
|
|
551
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
552
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
514
553
|
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
515
554
|
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
555
|
+
_meta: object;
|
|
516
556
|
}, void>;
|
|
517
557
|
}>;
|
|
518
558
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAppRouter.d.ts","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAGzC,wBAAgB,eAAe
|
|
1
|
+
{"version":3,"file":"createAppRouter.d.ts","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAGzC,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -60,8 +60,7 @@ export declare function createCloudpackServer(options: {
|
|
|
60
60
|
}) => Promise<{
|
|
61
61
|
fixable: boolean;
|
|
62
62
|
}>;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}) => Promise<void>;
|
|
63
|
+
syncDownload: (options: unknown) => Promise<void>;
|
|
64
|
+
syncUpload: (options: unknown) => Promise<void>;
|
|
66
65
|
}>;
|
|
67
66
|
//# sourceMappingURL=createCloudpackServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,uBAAuB,CAAC;CACnC
|
|
1
|
+
{"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,uBAAuB,CAAC;CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CloudpackConfig } from '@ms-cloudpack/config';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures that the remote cache is enabled in the config.
|
|
4
|
+
* @param config - The cloudpack config.
|
|
5
|
+
* @returns - The remote cache configuration.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureRemoteCacheEnabled({ remoteCache }: CloudpackConfig): {
|
|
8
|
+
storageAccount: string;
|
|
9
|
+
container: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=ensureRemoteCacheEnabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensureRemoteCacheEnabled.d.ts","sourceRoot":"","sources":["../../src/utilities/ensureRemoteCacheEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,WAAW,EAAE,EAAE,eAAe;;;EAMxE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensures that the remote cache is enabled in the config.
|
|
3
|
+
* @param config - The cloudpack config.
|
|
4
|
+
* @returns - The remote cache configuration.
|
|
5
|
+
*/
|
|
6
|
+
export function ensureRemoteCacheEnabled({ remoteCache }) {
|
|
7
|
+
if (!remoteCache) {
|
|
8
|
+
throw new Error('Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file.');
|
|
9
|
+
}
|
|
10
|
+
return remoteCache;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ensureRemoteCacheEnabled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensureRemoteCacheEnabled.js","sourceRoot":"","sources":["../../src/utilities/ensureRemoteCacheEnabled.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,EAAE,WAAW,EAAmB;IACvE,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;KAC/G;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/config';\n\n/**\n * Ensures that the remote cache is enabled in the config.\n * @param config - The cloudpack config.\n * @returns - The remote cache configuration.\n */\nexport function ensureRemoteCacheEnabled({ remoteCache }: CloudpackConfig) {\n if (!remoteCache) {\n throw new Error('Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file.');\n }\n\n return remoteCache;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findImports.d.ts","sourceRoot":"","sources":["../../src/utilities/findImports.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"findImports.d.ts","sourceRoot":"","sources":["../../src/utilities/findImports.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAsE3F"}
|
|
@@ -28,7 +28,9 @@ export async function findImports(filePaths) {
|
|
|
28
28
|
catch (err) {
|
|
29
29
|
// This could happen if the source file isn't valid JS
|
|
30
30
|
// (unlikely after adding the check above to only attempt parsing JS/TS files)
|
|
31
|
-
|
|
31
|
+
const stack = err instanceof Error ? err.stack : '';
|
|
32
|
+
const type = typeof err;
|
|
33
|
+
console.warn(`Failed to parse ${filePath}:`, err, 'Type', type, 'Stack', stack, '\nSource is:\n', source);
|
|
32
34
|
continue;
|
|
33
35
|
}
|
|
34
36
|
const imports = Array.from(new Set(rawImports))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findImports.js","sourceRoot":"","sources":["../../src/utilities/findImports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OA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C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;gBACnG,eAAe,CAAC,WAAW,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;gBAC3C,eAAe,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC;aACrD;SACF;KACF;IAED,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import { parse } from 'es-module-lexer';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport { parseImportString, type ImportStringResult } from '@ms-cloudpack/path-string-parsing';\nimport { sourceExtensions } from '@ms-cloudpack/path-utilities';\nimport { builtinModules } from 'module';\n\n/** Treat files with no extension as JS for purposes below */\nconst allSourceExtensions = [...sourceExtensions, ''];\n\n/**\n * Returns a dictionary where key is the package name and value is a set of required paths.\n * Eg. `{ '@fluentui/react': new Set([ '.', './lib/Button' ]) }`\n */\nexport async function findImports(filePaths: string[]): Promise<Record<string, Set<string>>> {\n const requiredExports: Record<string, Set<string>> = {};\n const visitedPaths = new Set(filePaths);\n const pathsToParse: string[] = [...filePaths];\n\n while (pathsToParse.length) {\n const filePath = pathsToParse.shift();\n // Ignore any non-JS/TS files such as SVGs and sourcemaps\n if (!filePath || !allSourceExtensions.includes(path.extname(filePath))) {\n continue;\n }\n\n const source = await fsPromises.readFile(filePath, 'utf-8');\n let rawImports: ReturnType<typeof parse>[0];\n try {\n [rawImports] = parse(source);\n } catch (err) {\n // This could happen if the source file isn't valid JS\n // (unlikely after adding the check above to only attempt parsing JS/TS files)\n const stack = err instanceof Error ? err.stack : '';\n const type = typeof err;\n console.warn(`Failed to parse ${filePath}:`, err, 'Type', type, 'Stack', stack, '\\nSource is:\\n', source);\n continue;\n }\n const imports = Array.from(new Set(rawImports))\n .map((i) => {\n // The es-module-lexer returns entries where the \"n\" property equals the import source.\n // This includes the package name and path. For example, in this case:\n //\n // import { Button } from '@fluentui/react/lib/Button';\n //\n // The \"n\" property would be \"@fluentui/react/lib/Button\".\n // The \"s\" and \"e\" properties represent the start/end character positions of\n // the import source. The \"ss\" and \"se\" properties represent the start/end\n // character positions of the import specifier starting with \"import\". This\n // may be useful for determining if the import is sync or async.\n //\n // Currently when the import source is a backtick string, the \"n\" property\n // is undefined. This is a bug in es-module-lexer. We may need to handle this\n // at the javascript layer and expand it into multiple potential imports.\n if (!i.n) {\n console.debug(\n `Found an import that didn't parse correctly:\\nFilename:\\n${filePath}\\n\\nImport:\\n${source.slice(\n i.s,\n i.e,\n )}`,\n );\n return undefined;\n }\n\n return parseImportString(i.n);\n })\n .filter(Boolean) as ImportStringResult[];\n\n for (const { packageName, importPath } of imports) {\n if (packageName?.startsWith('.')) {\n const localPath = path.resolve(path.dirname(filePath), packageName, importPath || '');\n\n if (!visitedPaths.has(localPath)) {\n visitedPaths.add(localPath);\n pathsToParse.push(localPath);\n }\n } else if (packageName && !packageName.startsWith('node:') && !builtinModules.includes(packageName)) {\n requiredExports[packageName] ??= new Set();\n requiredExports[packageName].add(importPath || '.');\n }\n }\n }\n\n return requiredExports;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "An implementation of the API server that does interacts with a task scheduler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@lage-run/scheduler": "^1.0.0",
|
|
22
22
|
"@lage-run/target-graph": "^0.8.6",
|
|
23
23
|
"@lage-run/hasher": "^1.0.0",
|
|
24
|
-
"@ms-cloudpack/bundler": "^0.14.
|
|
24
|
+
"@ms-cloudpack/bundler": "^0.14.6",
|
|
25
25
|
"@ms-cloudpack/bundler-types": "^0.17.0",
|
|
26
26
|
"@ms-cloudpack/config": "^0.11.0",
|
|
27
27
|
"@ms-cloudpack/create-express-app": "^1.3.9",
|
package/lib/apis/sync.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/apis/sync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,YAAY;;;;;;EAEhB,CAAC;AAEH,wBAAsB,IAAI,CAAC,EACzB,KAAK,EAAE,EAAE,QAAQ,EAAE,EACnB,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GACrC,EAAE;IACD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IACpC,GAAG,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,uBAAuB,CAAA;KAAE,CAAC;CACtF,iBAaA;yBAnBqB,IAAI"}
|
package/lib/apis/sync.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { publicProcedure } from '../trpc/common.js';
|
|
2
|
-
import { getBundleDetails } from '../utilities/getBundleDetails.js';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
const ZodSyncInput = z.object({
|
|
5
|
-
isUpload: z.boolean(),
|
|
6
|
-
});
|
|
7
|
-
export async function sync({ input: { isUpload }, ctx: { reporter, session, packages }, }) {
|
|
8
|
-
const { resolveMap } = session;
|
|
9
|
-
const config = session.config.remoteCache;
|
|
10
|
-
if (!config) {
|
|
11
|
-
console.warn('Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file.');
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const { syncToRemote, syncToLocal } = await import('@ms-cloudpack/remote-cache');
|
|
15
|
-
const parameters = { resolveMap, reporter, getBundleDetails, config, packages };
|
|
16
|
-
const syncInternal = isUpload ? syncToRemote : syncToLocal;
|
|
17
|
-
await syncInternal(parameters);
|
|
18
|
-
}
|
|
19
|
-
// Attach a trpc procedure to the function.
|
|
20
|
-
sync.procedure = publicProcedure.input(ZodSyncInput).mutation(sync);
|
|
21
|
-
//# sourceMappingURL=sync.js.map
|
package/lib/apis/sync.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/apis/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAKpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,EACzB,KAAK,EAAE,EAAE,QAAQ,EAAE,EACnB,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAIrC;IACC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;IAC1C,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAC;QAC3G,OAAO;KACR;IAED,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAChF,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;IAE3D,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,2CAA2C;AAC3C,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport { getBundleDetails } from '../utilities/getBundleDetails.js';\n\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { Session } from '../types/Session.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { z } from 'zod';\n\nconst ZodSyncInput = z.object({\n isUpload: z.boolean(),\n});\n\nexport async function sync({\n input: { isUpload },\n ctx: { reporter, session, packages },\n}: {\n input: z.infer<typeof ZodSyncInput>;\n ctx: { reporter: TaskReporter; session: Session; packages: PackageDefinitionsCache };\n}) {\n const { resolveMap } = session;\n const config = session.config.remoteCache;\n if (!config) {\n console.warn('Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file.');\n return;\n }\n\n const { syncToRemote, syncToLocal } = await import('@ms-cloudpack/remote-cache');\n const parameters = { resolveMap, reporter, getBundleDetails, config, packages };\n const syncInternal = isUpload ? syncToRemote : syncToLocal;\n\n await syncInternal(parameters);\n}\n\n// Attach a trpc procedure to the function.\nsync.procedure = publicProcedure.input(ZodSyncInput).mutation(sync);\n"]}
|