@quintype/framework 7.31.0-tiktok-task.0 → 7.31.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/.vscode/settings.json +1 -1
- package/CHANGELOG.md +40 -0
- package/package.json +3 -3
- package/server/amp/handlers/story-page.js +16 -4
- package/server/data-loader-helpers.js +5 -1
- package/server/generate-routes.js +22 -0
- package/server/routes.js +1 -0
- package/test/integration/sketches-proxy-test.js +13 -0
- package/test/unit/generate-routes-test.js +325 -7
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [7.31.0](https://github.com/quintype/quintype-node-framework/compare/v7.30.9...v7.31.0) (2024-11-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **Preview:** support home & collection preview route ([#450](https://github.com/quintype/quintype-node-framework/issues/450)) ([0c34ec4](https://github.com/quintype/quintype-node-framework/commit/0c34ec406fbe8d9ee56de1215c2100b2bb3e6896))
|
|
11
|
+
|
|
12
|
+
### [7.30.9](https://github.com/quintype/quintype-node-framework/compare/v7.30.8...v7.30.9) (2024-11-22)
|
|
13
|
+
|
|
14
|
+
### [7.30.8](https://github.com/quintype/quintype-node-framework/compare/v7.30.7...v7.30.8) (2024-11-05)
|
|
15
|
+
|
|
16
|
+
### [7.30.7](https://github.com/quintype/quintype-node-framework/compare/v7.30.6...v7.30.7) (2024-10-30)
|
|
17
|
+
|
|
18
|
+
### [7.30.6](https://github.com/quintype/quintype-node-framework/compare/v7.30.5...v7.30.6) (2024-10-30)
|
|
19
|
+
|
|
20
|
+
### [7.30.5](https://github.com/quintype/quintype-node-framework/compare/v7.30.4...v7.30.5) (2024-10-22)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **cache-tags:** fix amp cache tags ([#443](https://github.com/quintype/quintype-node-framework/issues/443)) ([009bbca](https://github.com/quintype/quintype-node-framework/commit/009bbcab7d42e70626d541ca80def10625ca021e))
|
|
26
|
+
|
|
27
|
+
### [7.30.4](https://github.com/quintype/quintype-node-framework/compare/v7.30.3...v7.30.4) (2024-10-22)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **publish time:** fix amp publish time ([#441](https://github.com/quintype/quintype-node-framework/issues/441)) ([fe22c6b](https://github.com/quintype/quintype-node-framework/commit/fe22c6b78e435b32a03da79bdf616197d4ecdb39))
|
|
33
|
+
|
|
34
|
+
### [7.30.3](https://github.com/quintype/quintype-node-framework/compare/v7.30.2...v7.30.3) (2024-09-30)
|
|
35
|
+
|
|
36
|
+
### [7.30.2](https://github.com/quintype/quintype-node-framework/compare/v7.30.1...v7.30.2) (2024-09-13)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* **Amp story:** pass amp optimizer toggle to preload hero image ([#439](https://github.com/quintype/quintype-node-framework/issues/439)) ([c943095](https://github.com/quintype/quintype-node-framework/commit/c943095a25000377f94b709df1b75ccfed3983df))
|
|
42
|
+
|
|
43
|
+
### [7.30.1](https://github.com/quintype/quintype-node-framework/compare/v7.30.0...v7.30.1) (2024-08-14)
|
|
44
|
+
|
|
5
45
|
## [7.30.0](https://github.com/quintype/quintype-node-framework/compare/v7.29.1...v7.30.0) (2024-07-30)
|
|
6
46
|
|
|
7
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/framework",
|
|
3
|
-
"version": "7.31.0
|
|
3
|
+
"version": "7.31.0",
|
|
4
4
|
"description": "Libraries to help build Quintype Node.js apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"homepage": "https://github.com/quintype/quintype-node-framework#readme",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
|
34
|
-
"@quintype/amp": "^2.20.0
|
|
35
|
-
"@quintype/backend": "2.
|
|
34
|
+
"@quintype/amp": "^2.20.0",
|
|
35
|
+
"@quintype/backend": "^2.6.0",
|
|
36
36
|
"@quintype/components": "^3.5.0",
|
|
37
37
|
"@quintype/prerender-node": "^3.2.26",
|
|
38
38
|
"@quintype/seo": "^1.46.1",
|
|
@@ -141,26 +141,38 @@ async function ampStoryPageHandler(
|
|
|
141
141
|
});
|
|
142
142
|
merge(mergedAdditionalConfig, additionalConfig, fetchedAdditionalConfig);
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
const optimizeAmpHtml = get(domainSpecificOpts, ["featureConfig", "optimizeAmpHtml"], true);
|
|
145
145
|
const ampHtml = ampifyStory({
|
|
146
146
|
story,
|
|
147
147
|
publisherConfig: config.config,
|
|
148
148
|
ampConfig: ampConfig.ampConfig,
|
|
149
149
|
additionalConfig: isEmpty(mergedAdditionalConfig) ? additionalConfig : mergedAdditionalConfig,
|
|
150
|
-
opts: { ...domainSpecificOpts, domainSlug },
|
|
150
|
+
opts: { ...domainSpecificOpts, domainSlug, optimizeAmpHtml },
|
|
151
151
|
seo: seoTags ? seoTags.toString() : "",
|
|
152
152
|
});
|
|
153
153
|
if (ampHtml instanceof Error) return next(ampHtml);
|
|
154
154
|
|
|
155
155
|
res.set("Content-Type", "text/html");
|
|
156
|
+
|
|
157
|
+
const pageCacheKey = `page/${config["publisher-id"]}/story-page`;
|
|
158
|
+
let cacheKeys = [storyToCacheKey(config["publisher-id"], story), pageCacheKey];
|
|
159
|
+
|
|
160
|
+
/* To cdn purge amp stories through custom tags, use getAdditionalCacheKeys function
|
|
161
|
+
to generate one or more cache tags, it should return cache tags as an array of strings. */
|
|
162
|
+
const getAdditionalCacheKeys = get(opts, ["featureConfig", "getAdditionalCacheKeys"]);
|
|
163
|
+
if (getAdditionalCacheKeys) {
|
|
164
|
+
const additionalCacheKeys = getAdditionalCacheKeys(config);
|
|
165
|
+
cacheKeys = cacheKeys.concat(additionalCacheKeys);
|
|
166
|
+
}
|
|
167
|
+
|
|
156
168
|
addCacheHeadersToResult({
|
|
157
169
|
res,
|
|
158
|
-
cacheKeys
|
|
170
|
+
cacheKeys,
|
|
159
171
|
cdnProvider,
|
|
160
172
|
config,
|
|
173
|
+
sMaxAge: "86400",
|
|
161
174
|
});
|
|
162
175
|
|
|
163
|
-
const optimizeAmpHtml = get(domainSpecificOpts, ["featureConfig", "optimizeAmpHtml"], true);
|
|
164
176
|
const finalResponse = optimizeAmpHtml ? await optimize(ampHtml) : ampHtml;
|
|
165
177
|
|
|
166
178
|
return res.send(finalResponse);
|
|
@@ -23,16 +23,20 @@ exports.homeCollectionOrStories = function homeCollectionOrStories(
|
|
|
23
23
|
customLayouts = [],
|
|
24
24
|
defaultNestedLimit = null
|
|
25
25
|
) {
|
|
26
|
+
const {qtInternalAppsKey = "", previewId = "", ...rest} = params || {};
|
|
27
|
+
|
|
26
28
|
return Collection.getCollectionBySlug(
|
|
27
29
|
client,
|
|
28
30
|
"home",
|
|
29
|
-
{ "item-type": "collection", ...
|
|
31
|
+
{ "item-type": "collection", ...rest },
|
|
30
32
|
{
|
|
31
33
|
depth,
|
|
32
34
|
...(getStoryLimits && { storyLimits: getStoryLimits() }),
|
|
33
35
|
collectionOfCollectionsIndexes,
|
|
34
36
|
customLayouts,
|
|
35
37
|
defaultNestedLimit,
|
|
38
|
+
qtInternalAppsKey,
|
|
39
|
+
previewId
|
|
36
40
|
}
|
|
37
41
|
).then((collection) => {
|
|
38
42
|
if (collection) return collection;
|
|
@@ -165,6 +165,28 @@ exports.generateCommonRoutes = function generateSectionPageRoutes(
|
|
|
165
165
|
},
|
|
166
166
|
]
|
|
167
167
|
: [],
|
|
168
|
+
[
|
|
169
|
+
{
|
|
170
|
+
path: '/preview/:previewId/collection/home',
|
|
171
|
+
pageType: 'home-page-preview',
|
|
172
|
+
exact: true,
|
|
173
|
+
skipPWA: true,
|
|
174
|
+
params: {
|
|
175
|
+
collectionSlug: config.getHomeCollectionSlug(domainSlug)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
[
|
|
180
|
+
{
|
|
181
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
182
|
+
pageType: 'collection-page-preview',
|
|
183
|
+
exact: true,
|
|
184
|
+
skipPWA: skipPWA.home || false,
|
|
185
|
+
params: {
|
|
186
|
+
collectionSlug: config.getHomeCollectionSlug(domainSlug)
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
],
|
|
168
190
|
sectionPageRoutes ? sectionRoutes : [],
|
|
169
191
|
storyPageRoutes ? storyRoutes : []
|
|
170
192
|
);
|
package/server/routes.js
CHANGED
|
@@ -115,6 +115,7 @@ exports.upstreamQuintypeRoutes = function upstreamQuintypeRoutes(
|
|
|
115
115
|
];
|
|
116
116
|
|
|
117
117
|
app.all("/api/*", sketchesProxy);
|
|
118
|
+
app.all("*/api/*", sketchesProxy);
|
|
118
119
|
app.all("/login", sketchesProxy);
|
|
119
120
|
app.all("/qlitics.js", sketchesProxy);
|
|
120
121
|
app.all("/auth.form", sketchesProxy);
|
|
@@ -49,6 +49,19 @@ describe("Sketches Proxy", function () {
|
|
|
49
49
|
.then(done);
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
it("forwards subdirectory api requests to sketches", function (done) {
|
|
53
|
+
supertest(buildApp())
|
|
54
|
+
.get("/anything/api/v1/config")
|
|
55
|
+
.expect(200)
|
|
56
|
+
.then((res) => {
|
|
57
|
+
const { method, url, host } = JSON.parse(res.text);
|
|
58
|
+
assert.equal("GET", method);
|
|
59
|
+
assert.equal("/anything/api/v1/config", url);
|
|
60
|
+
assert.equal("127.0.0.1", host);
|
|
61
|
+
})
|
|
62
|
+
.then(done);
|
|
63
|
+
});
|
|
64
|
+
|
|
52
65
|
it("forwards custom routes to sketches", function (done) {
|
|
53
66
|
supertest(buildApp())
|
|
54
67
|
.get("/custom-route")
|
|
@@ -375,7 +375,24 @@ describe("generateCommonRoutes", function () {
|
|
|
375
375
|
});
|
|
376
376
|
|
|
377
377
|
assert.deepEqual(
|
|
378
|
-
[
|
|
378
|
+
[{
|
|
379
|
+
exact: true,
|
|
380
|
+
pageType: 'home-page-preview',
|
|
381
|
+
params: {
|
|
382
|
+
collectionSlug: 'home'
|
|
383
|
+
},
|
|
384
|
+
path: '/preview/:previewId/collection/home',
|
|
385
|
+
skipPWA: true
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
exact: true,
|
|
389
|
+
pageType: 'collection-page-preview',
|
|
390
|
+
params: {
|
|
391
|
+
collectionSlug: 'home'
|
|
392
|
+
},
|
|
393
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
394
|
+
skipPWA: false
|
|
395
|
+
},
|
|
379
396
|
{
|
|
380
397
|
path: "/photos",
|
|
381
398
|
pageType: "section-page",
|
|
@@ -391,7 +408,24 @@ describe("generateCommonRoutes", function () {
|
|
|
391
408
|
);
|
|
392
409
|
|
|
393
410
|
assert.deepEqual(
|
|
394
|
-
[
|
|
411
|
+
[{
|
|
412
|
+
exact: true,
|
|
413
|
+
pageType: 'home-page-preview',
|
|
414
|
+
params: {
|
|
415
|
+
collectionSlug: 'home'
|
|
416
|
+
},
|
|
417
|
+
path: '/preview/:previewId/collection/home',
|
|
418
|
+
skipPWA: true
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
exact: true,
|
|
422
|
+
pageType: 'collection-page-preview',
|
|
423
|
+
params: {
|
|
424
|
+
collectionSlug: 'home'
|
|
425
|
+
},
|
|
426
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
427
|
+
skipPWA: false
|
|
428
|
+
},
|
|
395
429
|
{
|
|
396
430
|
path: "/photos(/.*)?/:storySlug",
|
|
397
431
|
pageType: "story-page",
|
|
@@ -415,6 +449,24 @@ describe("generateCommonRoutes", function () {
|
|
|
415
449
|
|
|
416
450
|
assert.deepEqual(
|
|
417
451
|
[
|
|
452
|
+
{
|
|
453
|
+
exact: true,
|
|
454
|
+
pageType: 'home-page-preview',
|
|
455
|
+
params: {
|
|
456
|
+
collectionSlug: 'home'
|
|
457
|
+
},
|
|
458
|
+
path: '/preview/:previewId/collection/home',
|
|
459
|
+
skipPWA: true
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
exact: true,
|
|
463
|
+
pageType: 'collection-page-preview',
|
|
464
|
+
params: {
|
|
465
|
+
collectionSlug: 'home'
|
|
466
|
+
},
|
|
467
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
468
|
+
skipPWA: false
|
|
469
|
+
},
|
|
418
470
|
{
|
|
419
471
|
path: "/photos",
|
|
420
472
|
pageType: "section-page",
|
|
@@ -438,6 +490,23 @@ describe("generateCommonRoutes", function () {
|
|
|
438
490
|
params: { collectionSlug: "home" },
|
|
439
491
|
exact: true,
|
|
440
492
|
skipPWA: true,
|
|
493
|
+
},{
|
|
494
|
+
exact: true,
|
|
495
|
+
pageType: 'home-page-preview',
|
|
496
|
+
params: {
|
|
497
|
+
collectionSlug: 'home'
|
|
498
|
+
},
|
|
499
|
+
path: '/preview/:previewId/collection/home',
|
|
500
|
+
skipPWA: true
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
exact: true,
|
|
504
|
+
pageType: 'collection-page-preview',
|
|
505
|
+
params: {
|
|
506
|
+
collectionSlug: 'home'
|
|
507
|
+
},
|
|
508
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
509
|
+
skipPWA: true
|
|
441
510
|
},
|
|
442
511
|
],
|
|
443
512
|
generateCommonRoutes(config, undefined, {
|
|
@@ -448,7 +517,24 @@ describe("generateCommonRoutes", function () {
|
|
|
448
517
|
);
|
|
449
518
|
|
|
450
519
|
assert.deepEqual(
|
|
451
|
-
[
|
|
520
|
+
[{
|
|
521
|
+
exact: true,
|
|
522
|
+
pageType: 'home-page-preview',
|
|
523
|
+
params: {
|
|
524
|
+
collectionSlug: 'home'
|
|
525
|
+
},
|
|
526
|
+
path: '/preview/:previewId/collection/home',
|
|
527
|
+
skipPWA: true
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
exact: true,
|
|
531
|
+
pageType: 'collection-page-preview',
|
|
532
|
+
params: {
|
|
533
|
+
collectionSlug: 'home'
|
|
534
|
+
},
|
|
535
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
536
|
+
skipPWA: false
|
|
537
|
+
},
|
|
452
538
|
{
|
|
453
539
|
path: "/photos(/.*)?/:storySlug",
|
|
454
540
|
pageType: "story-page",
|
|
@@ -477,6 +563,24 @@ describe("generateCommonRoutes", function () {
|
|
|
477
563
|
|
|
478
564
|
assert.deepEqual(
|
|
479
565
|
[
|
|
566
|
+
{
|
|
567
|
+
exact: true,
|
|
568
|
+
pageType: 'home-page-preview',
|
|
569
|
+
params: {
|
|
570
|
+
collectionSlug: 'home'
|
|
571
|
+
},
|
|
572
|
+
path: '/preview/:previewId/collection/home',
|
|
573
|
+
skipPWA: true
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
exact: true,
|
|
577
|
+
pageType: 'collection-page-preview',
|
|
578
|
+
params: {
|
|
579
|
+
collectionSlug: 'home'
|
|
580
|
+
},
|
|
581
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
582
|
+
skipPWA: false
|
|
583
|
+
},
|
|
480
584
|
{
|
|
481
585
|
path: "/photos",
|
|
482
586
|
pageType: "section-page",
|
|
@@ -504,7 +608,24 @@ describe("generateCommonRoutes", function () {
|
|
|
504
608
|
});
|
|
505
609
|
|
|
506
610
|
assert.deepEqual(
|
|
507
|
-
[
|
|
611
|
+
[{
|
|
612
|
+
exact: true,
|
|
613
|
+
pageType: 'home-page-preview',
|
|
614
|
+
params: {
|
|
615
|
+
collectionSlug: 'home'
|
|
616
|
+
},
|
|
617
|
+
path: '/preview/:previewId/collection/home',
|
|
618
|
+
skipPWA: true
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
exact: true,
|
|
622
|
+
pageType: 'collection-page-preview',
|
|
623
|
+
params: {
|
|
624
|
+
collectionSlug: 'home'
|
|
625
|
+
},
|
|
626
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
627
|
+
skipPWA: false
|
|
628
|
+
}],
|
|
508
629
|
generateCommonRoutes(config, null, {
|
|
509
630
|
allRoutes: false,
|
|
510
631
|
sectionPageRoutes: true,
|
|
@@ -513,6 +634,24 @@ describe("generateCommonRoutes", function () {
|
|
|
513
634
|
|
|
514
635
|
assert.deepEqual(
|
|
515
636
|
[
|
|
637
|
+
{
|
|
638
|
+
exact: true,
|
|
639
|
+
pageType: 'home-page-preview',
|
|
640
|
+
params: {
|
|
641
|
+
collectionSlug: 'home'
|
|
642
|
+
},
|
|
643
|
+
path: '/preview/:previewId/collection/home',
|
|
644
|
+
skipPWA: true
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
exact: true,
|
|
648
|
+
pageType: 'collection-page-preview',
|
|
649
|
+
params: {
|
|
650
|
+
collectionSlug: 'home'
|
|
651
|
+
},
|
|
652
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
653
|
+
skipPWA: false
|
|
654
|
+
},
|
|
516
655
|
{
|
|
517
656
|
path: "/photos",
|
|
518
657
|
pageType: "section-page",
|
|
@@ -541,6 +680,24 @@ describe("generateCommonRoutes", function () {
|
|
|
541
680
|
|
|
542
681
|
assert.deepEqual(
|
|
543
682
|
[
|
|
683
|
+
{
|
|
684
|
+
exact: true,
|
|
685
|
+
pageType: 'home-page-preview',
|
|
686
|
+
params: {
|
|
687
|
+
collectionSlug: 'home'
|
|
688
|
+
},
|
|
689
|
+
path: '/preview/:previewId/collection/home',
|
|
690
|
+
skipPWA: true
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
exact: true,
|
|
694
|
+
pageType: 'collection-page-preview',
|
|
695
|
+
params: {
|
|
696
|
+
collectionSlug: 'home'
|
|
697
|
+
},
|
|
698
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
699
|
+
skipPWA: false
|
|
700
|
+
},
|
|
544
701
|
{
|
|
545
702
|
path: "/photos",
|
|
546
703
|
pageType: "section-page",
|
|
@@ -588,6 +745,24 @@ describe("generateCommonRoutes", function () {
|
|
|
588
745
|
|
|
589
746
|
assert.deepEqual(
|
|
590
747
|
[
|
|
748
|
+
{
|
|
749
|
+
exact: true,
|
|
750
|
+
pageType: 'home-page-preview',
|
|
751
|
+
params: {
|
|
752
|
+
collectionSlug: 'home'
|
|
753
|
+
},
|
|
754
|
+
path: '/preview/:previewId/collection/home',
|
|
755
|
+
skipPWA: true
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
exact: true,
|
|
759
|
+
pageType: 'collection-page-preview',
|
|
760
|
+
params: {
|
|
761
|
+
collectionSlug: 'home'
|
|
762
|
+
},
|
|
763
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
764
|
+
skipPWA: false
|
|
765
|
+
},
|
|
591
766
|
{
|
|
592
767
|
path: "/section/photos",
|
|
593
768
|
pageType: "section-page",
|
|
@@ -604,6 +779,24 @@ describe("generateCommonRoutes", function () {
|
|
|
604
779
|
|
|
605
780
|
assert.deepEqual(
|
|
606
781
|
[
|
|
782
|
+
{
|
|
783
|
+
exact: true,
|
|
784
|
+
pageType: 'home-page-preview',
|
|
785
|
+
params: {
|
|
786
|
+
collectionSlug: 'home'
|
|
787
|
+
},
|
|
788
|
+
path: '/preview/:previewId/collection/home',
|
|
789
|
+
skipPWA: true
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
exact: true,
|
|
793
|
+
pageType: 'collection-page-preview',
|
|
794
|
+
params: {
|
|
795
|
+
collectionSlug: 'home'
|
|
796
|
+
},
|
|
797
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
798
|
+
skipPWA: false
|
|
799
|
+
},
|
|
607
800
|
{
|
|
608
801
|
path: "/photos(/.*)?/:storySlug",
|
|
609
802
|
pageType: "story-page",
|
|
@@ -623,6 +816,24 @@ describe("generateCommonRoutes", function () {
|
|
|
623
816
|
|
|
624
817
|
assert.deepEqual(
|
|
625
818
|
[
|
|
819
|
+
{
|
|
820
|
+
exact: true,
|
|
821
|
+
pageType: 'home-page-preview',
|
|
822
|
+
params: {
|
|
823
|
+
collectionSlug: 'home'
|
|
824
|
+
},
|
|
825
|
+
path: '/preview/:previewId/collection/home',
|
|
826
|
+
skipPWA: true
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
exact: true,
|
|
830
|
+
pageType: 'collection-page-preview',
|
|
831
|
+
params: {
|
|
832
|
+
collectionSlug: 'home'
|
|
833
|
+
},
|
|
834
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
835
|
+
skipPWA: false
|
|
836
|
+
},
|
|
626
837
|
{
|
|
627
838
|
path: "/photos(/.*)?/:storySlug",
|
|
628
839
|
pageType: "story-page",
|
|
@@ -638,6 +849,24 @@ describe("generateCommonRoutes", function () {
|
|
|
638
849
|
|
|
639
850
|
assert.deepEqual(
|
|
640
851
|
[
|
|
852
|
+
{
|
|
853
|
+
exact: true,
|
|
854
|
+
pageType: 'home-page-preview',
|
|
855
|
+
params: {
|
|
856
|
+
collectionSlug: 'home'
|
|
857
|
+
},
|
|
858
|
+
path: '/preview/:previewId/collection/home',
|
|
859
|
+
skipPWA: true
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
exact: true,
|
|
863
|
+
pageType: 'collection-page-preview',
|
|
864
|
+
params: {
|
|
865
|
+
collectionSlug: 'home'
|
|
866
|
+
},
|
|
867
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
868
|
+
skipPWA: false
|
|
869
|
+
},
|
|
641
870
|
{
|
|
642
871
|
path: "/photos",
|
|
643
872
|
pageType: "section-page",
|
|
@@ -655,7 +884,7 @@ describe("generateCommonRoutes", function () {
|
|
|
655
884
|
|
|
656
885
|
it("generates the home page route", function () {
|
|
657
886
|
const config = Config.build({
|
|
658
|
-
domains: [{ slug: "sub", "home-collection-id":
|
|
887
|
+
domains: [{ slug: "sub", "home-collection-id": "home" }],
|
|
659
888
|
sections: [],
|
|
660
889
|
});
|
|
661
890
|
|
|
@@ -668,6 +897,24 @@ describe("generateCommonRoutes", function () {
|
|
|
668
897
|
params: { collectionSlug: "home" },
|
|
669
898
|
skipPWA: false,
|
|
670
899
|
},
|
|
900
|
+
{
|
|
901
|
+
exact: true,
|
|
902
|
+
pageType: 'home-page-preview',
|
|
903
|
+
params: {
|
|
904
|
+
collectionSlug: 'home'
|
|
905
|
+
},
|
|
906
|
+
path: '/preview/:previewId/collection/home',
|
|
907
|
+
skipPWA: true
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
exact: true,
|
|
911
|
+
pageType: 'collection-page-preview',
|
|
912
|
+
params: {
|
|
913
|
+
collectionSlug: 'home'
|
|
914
|
+
},
|
|
915
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
916
|
+
skipPWA: false
|
|
917
|
+
},
|
|
671
918
|
],
|
|
672
919
|
generateCommonRoutes(config, undefined, {
|
|
673
920
|
allRoutes: false,
|
|
@@ -684,6 +931,24 @@ describe("generateCommonRoutes", function () {
|
|
|
684
931
|
params: { collectionSlug: "home" },
|
|
685
932
|
skipPWA: false,
|
|
686
933
|
},
|
|
934
|
+
{
|
|
935
|
+
exact: true,
|
|
936
|
+
pageType: 'home-page-preview',
|
|
937
|
+
params: {
|
|
938
|
+
collectionSlug: 'home'
|
|
939
|
+
},
|
|
940
|
+
path: '/preview/:previewId/collection/home',
|
|
941
|
+
skipPWA: true
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
exact: true,
|
|
945
|
+
pageType: 'collection-page-preview',
|
|
946
|
+
params: {
|
|
947
|
+
collectionSlug: 'home'
|
|
948
|
+
},
|
|
949
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
950
|
+
skipPWA: false
|
|
951
|
+
},
|
|
687
952
|
],
|
|
688
953
|
generateCommonRoutes(config, null, {
|
|
689
954
|
allRoutes: false,
|
|
@@ -697,9 +962,27 @@ describe("generateCommonRoutes", function () {
|
|
|
697
962
|
path: "/",
|
|
698
963
|
pageType: "home-page",
|
|
699
964
|
exact: true,
|
|
700
|
-
params: { collectionSlug: "
|
|
965
|
+
params: { collectionSlug: "home" },
|
|
701
966
|
skipPWA: false,
|
|
702
967
|
},
|
|
968
|
+
{
|
|
969
|
+
exact: true,
|
|
970
|
+
pageType: 'home-page-preview',
|
|
971
|
+
params: {
|
|
972
|
+
collectionSlug: 'home'
|
|
973
|
+
},
|
|
974
|
+
path: '/preview/:previewId/collection/home',
|
|
975
|
+
skipPWA: true
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
exact: true,
|
|
979
|
+
pageType: 'collection-page-preview',
|
|
980
|
+
params: {
|
|
981
|
+
collectionSlug: 'home'
|
|
982
|
+
},
|
|
983
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
984
|
+
skipPWA: false
|
|
985
|
+
},
|
|
703
986
|
],
|
|
704
987
|
generateCommonRoutes(config, "sub", {
|
|
705
988
|
allRoutes: false,
|
|
@@ -721,6 +1004,24 @@ describe("generateCommonRoutes", function () {
|
|
|
721
1004
|
|
|
722
1005
|
assert.deepEqual(
|
|
723
1006
|
[
|
|
1007
|
+
{
|
|
1008
|
+
exact: true,
|
|
1009
|
+
pageType: 'home-page-preview',
|
|
1010
|
+
params: {
|
|
1011
|
+
collectionSlug: 'home'
|
|
1012
|
+
},
|
|
1013
|
+
path: '/preview/:previewId/collection/home',
|
|
1014
|
+
skipPWA: true
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
exact: true,
|
|
1018
|
+
pageType: 'collection-page-preview',
|
|
1019
|
+
params: {
|
|
1020
|
+
collectionSlug: 'home'
|
|
1021
|
+
},
|
|
1022
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
1023
|
+
skipPWA: false
|
|
1024
|
+
},
|
|
724
1025
|
{
|
|
725
1026
|
path: "/photos",
|
|
726
1027
|
pageType: "section-page",
|
|
@@ -736,7 +1037,24 @@ describe("generateCommonRoutes", function () {
|
|
|
736
1037
|
);
|
|
737
1038
|
|
|
738
1039
|
assert.deepEqual(
|
|
739
|
-
[
|
|
1040
|
+
[{
|
|
1041
|
+
exact: true,
|
|
1042
|
+
pageType: 'home-page-preview',
|
|
1043
|
+
params: {
|
|
1044
|
+
collectionSlug: 'home'
|
|
1045
|
+
},
|
|
1046
|
+
path: '/preview/:previewId/collection/home',
|
|
1047
|
+
skipPWA: true
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
exact: true,
|
|
1051
|
+
pageType: 'collection-page-preview',
|
|
1052
|
+
params: {
|
|
1053
|
+
collectionSlug: 'home'
|
|
1054
|
+
},
|
|
1055
|
+
path: '/preview/:previewId/collection/:collectionSlug',
|
|
1056
|
+
skipPWA: false
|
|
1057
|
+
},
|
|
740
1058
|
{
|
|
741
1059
|
path: "/photos(/.*)?/:storySlug",
|
|
742
1060
|
pageType: "story-page",
|