@ms-cloudpack/overlay 0.19.9 → 0.19.11
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/dist/browser-esm/639.chunk.js +1 -1
- package/dist/browser-esm/639.chunk.js.map +1 -1
- package/dist/browser-esm/lib/index.js +1 -1
- package/dist/browser-esm/lib/index.js.map +1 -1
- package/lib/components/ErrorDialog/useErrorEvents.d.ts.map +1 -1
- package/lib/components/ErrorDialog/useErrorEvents.js +3 -2
- package/lib/components/ErrorDialog/useErrorEvents.js.map +1 -1
- package/lib/components/StatusDialog/TaskStatus.js +1 -1
- package/lib/components/StatusDialog/TaskStatus.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useErrorEvents.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/useErrorEvents.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,
|
|
1
|
+
{"version":3,"file":"useErrorEvents.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/useErrorEvents.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,WAgGjC,CAAC"}
|
|
@@ -60,9 +60,10 @@ export const useErrorEvents = () => {
|
|
|
60
60
|
};
|
|
61
61
|
const subscription = cloudpack.onDataChanged.subscribe(errorEntrySource, {
|
|
62
62
|
onData: (data) => {
|
|
63
|
-
|
|
63
|
+
// should always be a string. empty means no more errors.
|
|
64
|
+
if (data && typeof data === 'string') {
|
|
64
65
|
console.error(data);
|
|
65
|
-
handleUnsupportedError(
|
|
66
|
+
handleUnsupportedError(data);
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useErrorEvents.js","sourceRoot":"","sources":["../../../src/components/ErrorDialog/useErrorEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAYpE,iCAAiC;AACjC,MAAM,cAAc,GAAG,CAAC,KAA4B,EAAyB,EAAE;IAC7E,OAAO,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;AACnG,CAAC,CAAC;AAEF,qDAAqD;AACrD,MAAM,UAAU,GAAG,CAAC,KAA4B,EAAyB,EAAE;IACzE,OAAO,cAAc,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AAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,yCAAyC;QACzC,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,cAAc,EAAE,CAAC;YAC9C,sBAAsB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC;QAED,wCAAwC;QACxC,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,CAAC,KAA4B,EAAE,EAAE;YAC7E,UAAU,CAAC,KAAK,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,6CAA6C;QAC7C,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,kBAAkB,EAAE,CAAC;YAClD,UAAU,CAAC,KAAK,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAE5B,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'preact/hooks';\nimport { parseImportString } from '@ms-cloudpack/path-string-parsing';\nimport { useCloudpack } from '../CloudpackProvider/CloudpackProvider.js';\nimport { errorEntrySource } from '@ms-cloudpack/api-server/browser';\n\n// Interface with reason as a record.\ninterface ReasonRecord extends PromiseRejectionEvent {\n readonly reason: Record<string, unknown>;\n}\n\n// Interface with message as a string.\ninterface ReasonString extends ReasonRecord {\n readonly reason: { message: string };\n}\n\n// Verify the reason is a record.\nconst reasonIsRecord = (event: PromiseRejectionEvent): event is ReasonRecord => {\n return typeof event.reason === 'object' && !Array.isArray(event.reason) && event.reason !== null;\n};\n\n// Verify the reason has a message which is a string.\nconst hasMessage = (event: PromiseRejectionEvent): event is ReasonString => {\n return reasonIsRecord(event) && typeof event.reason.message === 'string';\n};\n\nexport type ErrorEvents = {\n unsupported: UnsupportedErrorEvent[];\n};\n\nexport type UnsupportedErrorEvent = {\n /** Package name being imported */\n packageName: string;\n /** Path within the package being imported (`'.'` for root) */\n importPath: string;\n /**\n * URL that issued the bad request. This will be undefined if the browser didn't set it, or if it\n * was incorrectly set to the current page URL (most browsers except Firefox do this).\n */\n issuerUrl?: string;\n /** True if this is a valid import that can be handled by `addPackageOverride` */\n fixable?: boolean;\n /** True if the package exists in the resolve map (even if the import path wasn't valid) */\n isValidPackage?: boolean;\n};\n\nexport const useErrorEvents = (): ErrorEvents => {\n const [errorEvents, setErrorEvents] = useState<ErrorEvents>({ unsupported: [] });\n const cloudpack = useCloudpack();\n // This should always be set by an inline script\n const pageErrors = window.__pageErrors;\n\n useEffect(() => {\n if (!pageErrors) {\n console.error('[Cloudpack] window.__pageErrors not found (unable to handle unsupported imports)');\n return;\n }\n\n const handleUnsupportedError = (message: string, issuerUrl?: string): void => {\n const errorRegex = /[Mm]odule specifier,? ['\"](.*?)['\"]/;\n const match = message.match(errorRegex);\n\n if (!match) {\n return;\n }\n\n const importString = parseImportString(match[1]);\n const { packageName, importPath } = importString;\n\n (async () => {\n if (issuerUrl && issuerUrl === location.href) {\n // Issuer URL is often incorrectly set to the current page URL, so just remove it\n issuerUrl = undefined;\n }\n\n // Check whether importPath is valid for this package.\n // Unfortunately, due to the lack of issuerUrl support in most browsers, this might not be\n // accurate if there are multiple versions of the same package (it will fall back to\n // whichever version is at the top level of the resolve map, which may not be the version\n // that's actually being imported in context).\n const { fixable } = await cloudpack.validatePackageOverride.query({\n packageName,\n importPath,\n issuerUrl,\n });\n\n // If importPath doesn't appear to be valid, attempt to check whether the package exists\n // elsewhere in the resolve map (to refine the error message). This check isn't perfect\n // since it assumes the path '.' exists for that package, and it's also possible that the\n // package is installed somewhere in the repo but hasn't ended up in the resolve map yet.\n const isValidPackage =\n fixable ||\n (importPath !== '.' &&\n (await cloudpack.validatePackageOverride.query({ packageName, importPath: '.', issuerUrl })).fixable);\n\n setErrorEvents((prev) => ({\n ...prev,\n unsupported: [...prev.unsupported, { packageName, importPath, issuerUrl, fixable, isValidPackage }],\n }));\n })().catch(() => {\n // no-op\n });\n };\n\n const subscription = cloudpack.onDataChanged.subscribe(errorEntrySource, {\n onData: (data) => {\n // should always be a string. empty means no more errors.\n if (data && typeof data === 'string') {\n console.error(data);\n handleUnsupportedError(data);\n }\n },\n });\n\n pageErrors.unregister();\n\n // Append unsupported paths to the list.\n window.addEventListener('error', (event: ErrorEvent) => {\n handleUnsupportedError(event.message, event.filename);\n });\n\n // Handle errors caught before rendering.\n for (const error of pageErrors.uncaughtErrors) {\n handleUnsupportedError(error.message, error.filename);\n }\n\n // Append unsupported paths to the list.\n window.addEventListener('unhandledrejection', (event: PromiseRejectionEvent) => {\n hasMessage(event) && handleUnsupportedError(event.reason.message);\n });\n\n // Handle rejections caught before rendering.\n for (const error of pageErrors.uncaughtRejections) {\n hasMessage(error) && handleUnsupportedError(error.reason.message);\n }\n\n return () => {\n subscription.unsubscribe();\n };\n }, [cloudpack, pageErrors]);\n\n return errorEvents;\n};\n"]}
|
|
@@ -8,7 +8,7 @@ function getCompletion(task) {
|
|
|
8
8
|
return 'Running';
|
|
9
9
|
}
|
|
10
10
|
return [
|
|
11
|
-
`Completed in ${task.
|
|
11
|
+
`Completed in ${task.duration}ms`,
|
|
12
12
|
task.errors?.length && `${task.errors.length} error${task.errors.length > 1 ? 's' : ''}`,
|
|
13
13
|
task.warnings?.length && `${task.warnings.length} warning${task.warnings.length > 1 ? 's' : ''}`,
|
|
14
14
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskStatus.js","sourceRoot":"","sources":["../../../src/components/StatusDialog/TaskStatus.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAA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ACrC,cAAc,EACZ,KAAC,MAAM,IACL,OAAO,EAAC,UAAU,EAClB,QAAQ,EAAC,SAAS,EAClB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAC,wBAAwB,gBACnB,wBAAwB,GACnC,EAEJ,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { FunctionComponent } from 'preact';\nimport type { TaskDescription } from '@ms-cloudpack/api-server/browser';\nimport { TaskResultItem } from './TaskResultItem.js';\nimport { useCloudpack } from '../CloudpackProvider/CloudpackProvider.js';\nimport { Button } from '../Button/Button.js';\nimport {\n ResultsAccordion,\n ResultsAccordionContent,\n type ResultsAccordionProps,\n} from '../ResultsAccordion/ResultsAccordion.js';\n\nexport interface TaskStatusProps extends Pick<ResultsAccordionProps, 'index'> {\n task: TaskDescription;\n}\n\nfunction getCompletion(task: TaskDescription): string {\n if (task.status === 'pending') {\n return 'Running';\n }\n return [\n `Completed in ${task.duration}ms`,\n task.errors?.length && `${task.errors.length} error${task.errors.length > 1 ? 's' : ''}`,\n task.warnings?.length && `${task.warnings.length} warning${task.warnings.length > 1 ? 's' : ''}`,\n ]\n .filter(Boolean)\n .join(', ');\n}\n\n/**\n * Item (collapsible section) in the list of bundle task results in the StatusDialog.\n */\nexport const TaskStatus: FunctionComponent<TaskStatusProps> = (props) => {\n const { task } = props;\n const { name, warnings = [], errors = [], inputPath, outputPath } = task;\n const cloudpack = useCloudpack();\n\n const openPath = (rootPath: string) => void cloudpack.openFilePath.mutate({ rootPath });\n\n const openPackageJson = (): void => {\n if (!inputPath) return; // the button won't be shown in this case\n\n void cloudpack.openCodeEditor.mutate({\n rootPath: inputPath,\n relativePath: 'package.json',\n });\n };\n\n const restartTask = (): void => {\n if (!inputPath) return;\n\n void cloudpack.restartTask.mutate({ id: task.id, inputPath });\n };\n\n // This callback prevents rendering thousands of bundle result details unnecessarily.\n // It could be further optimized with useMemo etc if it's an actual performance issue.\n const getContent = () => (\n <>\n {inputPath ? (\n <ResultsAccordionContent\n itemName=\"Input path\"\n itemValue={\n <>\n <Button variant=\"link\" onClick={() => openPath(inputPath)}>\n {inputPath}\n </Button>{' '}\n (\n <Button variant=\"link\" onClick={openPackageJson}>\n package.json\n </Button>\n )\n </>\n }\n />\n ) : (\n 'No input path found for bundle task. This is a Cloudpack bug. Please report it.'\n )}\n {outputPath && (\n <ResultsAccordionContent\n itemName=\"Output path\"\n itemValue={\n <Button variant=\"link\" onClick={() => openPath(outputPath)}>\n {outputPath}\n </Button>\n }\n />\n )}\n {errors.length > 0 && (\n <ResultsAccordionContent title=\"Errors\">\n {errors.map((item, index) => (\n <TaskResultItem type=\"error\" key={index} item={item} inputPath={inputPath} index={index} />\n ))}\n </ResultsAccordionContent>\n )}\n {warnings.length > 0 && (\n <ResultsAccordionContent title=\"Warnings\">\n {warnings.map((item, index) => (\n <TaskResultItem type=\"warning\" key={index} item={item} inputPath={inputPath} index={index} />\n ))}\n </ResultsAccordionContent>\n )}\n </>\n );\n\n return (\n <ResultsAccordion\n name={name || '<unknown>'}\n index={props.index}\n result={errors.length ? 'error' : warnings.length ? 'warning' : 'success'}\n headerEndContent={getCompletion(task)}\n headerCommands={\n <Button\n variant=\"iconOnly\"\n iconName=\"refresh\"\n onClick={restartTask}\n title=\"Re-bundle this package\"\n aria-label=\"Re-bundle this package\"\n />\n }\n getContent={getContent}\n />\n );\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/overlay",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.11",
|
|
4
4
|
"description": "The Cloudpack overlay ux.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"prepack": "cp .npmignore dist/.npmignore"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ms-cloudpack/api-server": "^0.
|
|
33
|
-
"@ms-cloudpack/common-types": "^0.
|
|
34
|
-
"@ms-cloudpack/common-types-browser": "^0.6.
|
|
32
|
+
"@ms-cloudpack/api-server": "^0.64.1",
|
|
33
|
+
"@ms-cloudpack/common-types": "^0.25.1",
|
|
34
|
+
"@ms-cloudpack/common-types-browser": "^0.6.2",
|
|
35
35
|
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|
|
36
36
|
"@ms-cloudpack/path-string-parsing": "^1.2.7",
|
|
37
37
|
"@ms-cloudpack/scripts": "^0.0.1",
|