@ms-cloudpack/overlay 0.17.85 → 0.17.87
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.
|
@@ -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,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"useErrorEvents.js","sourceRoot":"","sources":["../../../src/components/ErrorDialog/useErrorEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,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,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC;AAC3E,CAAC,CAAC;AAIF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,CAAC,WAA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AAC,IAAI,CAAC,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;QAEvC,UAAU,CAAC,UAAU,EAAE,CAAC;QAExB,wCAAwC;QACxC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,KAAiB,EAAE,EAAE;YACrD,sBAAsB,CAAC,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,CAAC,CAAC,CAAC;IAEhB,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\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 UnsupportedErrorEvent = { packageName: string; importPath: string; issuerUrl?: string; fixable?: boolean };\n\nexport const useErrorEvents = () => {\n const [errorEvents, setErrorEvents] = useState<{ unsupported: UnsupportedErrorEvent[] }>({ unsupported: [] });\n const cloudpack = useCloudpack();\n\n useEffect(() => {\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 const importString = parseImportString(match[1]);\n const { packageName, importPath } = importString;\n\n (async () => {\n const { fixable } = await cloudpack.validatePackageOverride.query({ packageName, importPath, issuerUrl });\n setErrorEvents((prev) => ({\n ...prev,\n unsupported: [...prev.unsupported, { packageName, importPath, issuerUrl: issuerUrl, fixable }],\n }));\n })().catch(() => {\n // no-op\n });\n }\n };\n\n const subscription = cloudpack.onDataChanged.subscribe(errorEntrySource, {\n onData: (data) => {\n if (data) {\n console.error(data);\n handleUnsupportedError(String(data));\n }\n },\n });\n\n const pageErrors = window.__pageErrors;\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]);\n\n return errorEvents;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/overlay",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.87",
|
|
4
4
|
"description": "The Cloudpack overlay ux.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"prepack": "cp .npmignore dist/.npmignore"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@ms-cloudpack/api-server": "^0.
|
|
32
|
+
"@ms-cloudpack/api-server": "^0.55.0",
|
|
33
33
|
"@ms-cloudpack/common-types": "^0.23.1",
|
|
34
34
|
"@ms-cloudpack/common-types-browser": "^0.5.2",
|
|
35
35
|
"@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
|