@lwrjs/core 0.8.0-alpha.0 → 0.8.0-alpha.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.
|
@@ -181,10 +181,17 @@ var SiteGenerator = class {
|
|
|
181
181
|
}
|
|
182
182
|
async handleHtmlResource(url, context, siteConfig, dispatcher) {
|
|
183
183
|
const {outputDir} = siteConfig;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
let fileName = "index.html";
|
|
185
|
+
let directoryPath = url;
|
|
186
|
+
if (url.endsWith(".html")) {
|
|
187
|
+
const lastPathIndex = url.lastIndexOf("/") + 1;
|
|
188
|
+
fileName = url.substring(lastPathIndex, url.length);
|
|
189
|
+
directoryPath = url.substring(0, lastPathIndex);
|
|
190
|
+
}
|
|
191
|
+
const dir = (0, import_dir.createResourceDir)(directoryPath, outputDir);
|
|
192
|
+
const localeDir = (0, import_dir.createResourceDir)(directoryPath, (0, import_path.join)(outputDir, siteConfig.locale));
|
|
193
|
+
const filePath = (0, import_path.join)(dir, fileName);
|
|
194
|
+
const fileLocalePath = (0, import_path.join)(localeDir, fileName);
|
|
188
195
|
if (siteConfig.locale.toLowerCase().startsWith("en")) {
|
|
189
196
|
siteConfig.viewPaths.add(filePath);
|
|
190
197
|
await (0, import_stream.writeResponse)(context, filePath);
|
|
@@ -253,14 +253,24 @@ export default class SiteGenerator {
|
|
|
253
253
|
*/
|
|
254
254
|
async handleHtmlResource(url, context, siteConfig, dispatcher) {
|
|
255
255
|
const { outputDir } = siteConfig;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
//
|
|
259
|
-
//
|
|
260
|
-
|
|
256
|
+
let fileName = 'index.html';
|
|
257
|
+
let directoryPath = url;
|
|
258
|
+
// If we have a route path that ends with a .html file extension,
|
|
259
|
+
// use that last path segment for the file name
|
|
260
|
+
if (url.endsWith('.html')) {
|
|
261
|
+
const lastPathIndex = url.lastIndexOf('/') + 1;
|
|
262
|
+
fileName = url.substring(lastPathIndex, url.length);
|
|
263
|
+
directoryPath = url.substring(0, lastPathIndex);
|
|
264
|
+
}
|
|
265
|
+
const dir = createResourceDir(directoryPath, outputDir);
|
|
266
|
+
const localeDir = createResourceDir(directoryPath, join(outputDir, siteConfig.locale));
|
|
267
|
+
// TODO: Should we handle routes with non-html extensions differently?
|
|
268
|
+
// Example Route: "path": "/mixed_templates.md" (not sure why you would do this)
|
|
261
269
|
// "contentTemplate": "$contentDir/composed_markdown.md"
|
|
262
|
-
|
|
263
|
-
|
|
270
|
+
// Today this will get written to /mixed_templates.md/index.html
|
|
271
|
+
// Which we workaround by setting "renderSingle": true in serve.json
|
|
272
|
+
const filePath = join(dir, fileName);
|
|
273
|
+
const fileLocalePath = join(localeDir, fileName);
|
|
264
274
|
// Default Path (only write once)
|
|
265
275
|
// The default locale is english
|
|
266
276
|
if (siteConfig.locale.toLowerCase().startsWith('en')) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.8.0-alpha.
|
|
7
|
+
"version": "0.8.0-alpha.1",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -33,31 +33,31 @@
|
|
|
33
33
|
"package.cjs"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lwrjs/app-service": "0.8.0-alpha.
|
|
37
|
-
"@lwrjs/asset-registry": "0.8.0-alpha.
|
|
38
|
-
"@lwrjs/asset-transformer": "0.8.0-alpha.
|
|
39
|
-
"@lwrjs/base-template-engine": "0.8.0-alpha.
|
|
40
|
-
"@lwrjs/base-view-provider": "0.8.0-alpha.
|
|
41
|
-
"@lwrjs/base-view-transformer": "0.8.0-alpha.
|
|
42
|
-
"@lwrjs/client-modules": "0.8.0-alpha.
|
|
43
|
-
"@lwrjs/compiler": "0.8.0-alpha.
|
|
44
|
-
"@lwrjs/diagnostics": "0.8.0-alpha.
|
|
45
|
-
"@lwrjs/fs-asset-provider": "0.8.0-alpha.
|
|
46
|
-
"@lwrjs/html-view-provider": "0.8.0-alpha.
|
|
47
|
-
"@lwrjs/loader": "0.8.0-alpha.
|
|
48
|
-
"@lwrjs/lwc-module-provider": "0.8.0-alpha.
|
|
49
|
-
"@lwrjs/lwc-ssr": "0.8.0-alpha.
|
|
50
|
-
"@lwrjs/markdown-view-provider": "0.8.0-alpha.
|
|
51
|
-
"@lwrjs/module-bundler": "0.8.0-alpha.
|
|
52
|
-
"@lwrjs/module-registry": "0.8.0-alpha.
|
|
53
|
-
"@lwrjs/npm-module-provider": "0.8.0-alpha.
|
|
54
|
-
"@lwrjs/nunjucks-view-provider": "0.8.0-alpha.
|
|
55
|
-
"@lwrjs/o11y": "0.8.0-alpha.
|
|
56
|
-
"@lwrjs/resource-registry": "0.8.0-alpha.
|
|
57
|
-
"@lwrjs/router": "0.8.0-alpha.
|
|
58
|
-
"@lwrjs/server": "0.8.0-alpha.
|
|
59
|
-
"@lwrjs/shared-utils": "0.8.0-alpha.
|
|
60
|
-
"@lwrjs/view-registry": "0.8.0-alpha.
|
|
36
|
+
"@lwrjs/app-service": "0.8.0-alpha.1",
|
|
37
|
+
"@lwrjs/asset-registry": "0.8.0-alpha.1",
|
|
38
|
+
"@lwrjs/asset-transformer": "0.8.0-alpha.1",
|
|
39
|
+
"@lwrjs/base-template-engine": "0.8.0-alpha.1",
|
|
40
|
+
"@lwrjs/base-view-provider": "0.8.0-alpha.1",
|
|
41
|
+
"@lwrjs/base-view-transformer": "0.8.0-alpha.1",
|
|
42
|
+
"@lwrjs/client-modules": "0.8.0-alpha.1",
|
|
43
|
+
"@lwrjs/compiler": "0.8.0-alpha.1",
|
|
44
|
+
"@lwrjs/diagnostics": "0.8.0-alpha.1",
|
|
45
|
+
"@lwrjs/fs-asset-provider": "0.8.0-alpha.1",
|
|
46
|
+
"@lwrjs/html-view-provider": "0.8.0-alpha.1",
|
|
47
|
+
"@lwrjs/loader": "0.8.0-alpha.1",
|
|
48
|
+
"@lwrjs/lwc-module-provider": "0.8.0-alpha.1",
|
|
49
|
+
"@lwrjs/lwc-ssr": "0.8.0-alpha.1",
|
|
50
|
+
"@lwrjs/markdown-view-provider": "0.8.0-alpha.1",
|
|
51
|
+
"@lwrjs/module-bundler": "0.8.0-alpha.1",
|
|
52
|
+
"@lwrjs/module-registry": "0.8.0-alpha.1",
|
|
53
|
+
"@lwrjs/npm-module-provider": "0.8.0-alpha.1",
|
|
54
|
+
"@lwrjs/nunjucks-view-provider": "0.8.0-alpha.1",
|
|
55
|
+
"@lwrjs/o11y": "0.8.0-alpha.1",
|
|
56
|
+
"@lwrjs/resource-registry": "0.8.0-alpha.1",
|
|
57
|
+
"@lwrjs/router": "0.8.0-alpha.1",
|
|
58
|
+
"@lwrjs/server": "0.8.0-alpha.1",
|
|
59
|
+
"@lwrjs/shared-utils": "0.8.0-alpha.1",
|
|
60
|
+
"@lwrjs/view-registry": "0.8.0-alpha.1",
|
|
61
61
|
"fs-extra": "^10.1.0",
|
|
62
62
|
"jsonc-parser": "^3.0.0",
|
|
63
63
|
"ms": "^2.1.3",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"qs": "^6.9.4"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@lwrjs/types": "0.8.0-alpha.
|
|
68
|
+
"@lwrjs/types": "0.8.0-alpha.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"lwc": ">= 1.x <= 2.x"
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=14.15.4 <19"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "2718cc5abe11d0d6fd5375cf9205167b6f69e244"
|
|
77
77
|
}
|