@trackunit/iris-app-build-utilities 1.12.45 → 1.12.46
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.md
CHANGED
package/package.json
CHANGED
|
@@ -16,17 +16,13 @@ const updateIndexHtml = ({ manifest, packageJson, devtools, }) => {
|
|
|
16
16
|
const scopeAndModuleNonce = (0, crypto_1.randomBytes)(16).toString("base64");
|
|
17
17
|
const csp = (0, csp_header_1.getCSP)({
|
|
18
18
|
// eslint-disable-next-line local-rules/no-typescript-assertion
|
|
19
|
-
directives: (0, iris_app_api_1.irisAppCspInput)(manifest.validDomains, manifest.cspHeader),
|
|
19
|
+
directives: (0, iris_app_api_1.irisAppCspInput)(manifest.validDomains, manifest.cspHeader ? { ...manifest.cspHeader, sandbox: undefined } : undefined),
|
|
20
20
|
presets: {
|
|
21
21
|
irisAppDefaultCsp: iris_app_api_1.irisAppDefaultCsp,
|
|
22
22
|
localDev: { "connect-src": ["ws://localhost:8097/"], "script-src": [`'nonce-${scopeAndModuleNonce}'`] },
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
.split(";")
|
|
27
|
-
.filter(substring => !substring.trim().startsWith("sandbox"))
|
|
28
|
-
.join(";");
|
|
29
|
-
let html = indexContents.replace("{{cspContent}}", cspWithoutSandbox);
|
|
25
|
+
let html = indexContents.replace("{{cspContent}}", csp);
|
|
30
26
|
html = html.replaceAll("{{devTools}}", devtools ? devtools : "");
|
|
31
27
|
html = html.replaceAll("{{scope}}", JSON.parse(packageJson).name);
|
|
32
28
|
html = html.replaceAll("{{remoteEntryModuleFormat}}", manifest.moduleFormat ?? "cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexHtmlUtil.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app-build-utilities/src/plugin-shared/indexHtmlUtil.ts"],"names":[],"mappings":";;;AAAA,0DAA8F;AAC9F,mCAA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\nimport { randomBytes } from \"crypto\";\nimport { getCSP } from \"csp-header\";\nimport { readFileSync } from \"fs\";\nimport { join } from \"path\";\n\n/**\n * Updates the index.html file with the given manifest and package.json file.\n */\nexport const updateIndexHtml = ({\n manifest,\n packageJson,\n devtools,\n}: {\n manifest: IrisAppManifest;\n packageJson: string;\n devtools?: string;\n}) => {\n // Try to use the existing updateIndexHtml utility\n const indexHtmlPath = join(__dirname, \"index.html\");\n const indexContents = readFileSync(indexHtmlPath, \"utf8\");\n const scopeAndModuleNonce = randomBytes(16).toString(\"base64\");\n\n const csp = getCSP({\n // eslint-disable-next-line local-rules/no-typescript-assertion\n directives: irisAppCspInput(manifest.validDomains, manifest.cspHeader ? {...manifest.cspHeader, sandbox: undefined} : undefined) as import(\"csp-header\").CSPDirectives,\n presets: {\n irisAppDefaultCsp,\n localDev: { \"connect-src\": [\"ws://localhost:8097/\"], \"script-src\": [`'nonce-${scopeAndModuleNonce}'`] },\n },\n });\n \n let html = indexContents.replace(\"{{cspContent}}\", csp);\n\n html = html.replaceAll(\"{{devTools}}\", devtools ? devtools : \"\");\n html = html.replaceAll(\"{{scope}}\", JSON.parse(packageJson).name);\n html = html.replaceAll(\"{{remoteEntryModuleFormat}}\", manifest.moduleFormat ?? \"cjs\");\n if (manifest.scopes) {\n html = html.replaceAll(\"{{manifestScopes}}\", JSON.stringify(manifest.scopes));\n } else {\n html = html.replaceAll(\"{{manifestScopes}}\", \"undefined\");\n }\n // nonce last if anything above injects script tags\n html = html.replaceAll(\"{{nonce}}\", scopeAndModuleNonce);\n return html;\n};\n"]}
|