@sitecore-content-sdk/nextjs 2.0.0-canary.6 → 2.0.0-canary.8
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/cjs/tools/codegen/import-map.js +2 -2
- package/dist/cjs/tools/index.js +6 -6
- package/dist/cjs/tools/templating/utils.js +5 -6
- package/dist/esm/tools/codegen/import-map.js +1 -1
- package/dist/esm/tools/index.js +2 -2
- package/dist/esm/tools/templating/utils.js +1 -2
- package/package.json +5 -5
- package/types/editing/editing-config-middleware.d.ts +1 -1
- package/types/editing/editing-config-middleware.d.ts.map +1 -1
- package/types/route-handler/editing-config-route-handler.d.ts +1 -1
- package/types/route-handler/editing-config-route-handler.d.ts.map +1 -1
- package/types/tools/codegen/import-map.d.ts +1 -1
- package/types/tools/codegen/import-map.d.ts.map +1 -1
- package/types/tools/index.d.ts +3 -2
- package/types/tools/index.d.ts.map +1 -1
- package/types/tools/templating/utils.d.ts +1 -1
- package/types/tools/templating/utils.d.ts.map +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeImportMap = exports.__mockDependencies = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_tools_1 = require("@sitecore-content-sdk/content/node-tools");
|
|
5
5
|
const utils_1 = require("../templating/utils");
|
|
6
|
-
let writeImportMapCore =
|
|
6
|
+
let writeImportMapCore = node_tools_1.writeImportMap;
|
|
7
7
|
const __mockDependencies = (mocks) => {
|
|
8
8
|
if (mocks.writeImportMapCore) {
|
|
9
9
|
writeImportMapCore = mocks.writeImportMapCore;
|
package/dist/cjs/tools/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeImportMap = exports.generateMap = exports.generateMetadata = exports.extractFiles = exports.getComponentList = exports.generateSites = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "generateSites", { enumerable: true, get: function () { return
|
|
6
|
-
Object.defineProperty(exports, "getComponentList", { enumerable: true, get: function () { return
|
|
7
|
-
Object.defineProperty(exports, "extractFiles", { enumerable: true, get: function () { return
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "generateMetadata", { enumerable: true, get: function () { return
|
|
4
|
+
var node_tools_1 = require("@sitecore-content-sdk/content/node-tools");
|
|
5
|
+
Object.defineProperty(exports, "generateSites", { enumerable: true, get: function () { return node_tools_1.generateSites; } });
|
|
6
|
+
Object.defineProperty(exports, "getComponentList", { enumerable: true, get: function () { return node_tools_1.getComponentList; } });
|
|
7
|
+
Object.defineProperty(exports, "extractFiles", { enumerable: true, get: function () { return node_tools_1.extractFiles; } });
|
|
8
|
+
var node_tools_2 = require("@sitecore-content-sdk/core/node-tools");
|
|
9
|
+
Object.defineProperty(exports, "generateMetadata", { enumerable: true, get: function () { return node_tools_2.generateMetadata; } });
|
|
10
10
|
var generate_map_1 = require("./generate-map");
|
|
11
11
|
Object.defineProperty(exports, "generateMap", { enumerable: true, get: function () { return generate_map_1.generateMap; } });
|
|
12
12
|
var import_map_1 = require("./codegen/import-map");
|
|
@@ -9,10 +9,9 @@ exports.getComponentListWithTypes = getComponentListWithTypes;
|
|
|
9
9
|
exports.nextjsClientMapTemplate = nextjsClientMapTemplate;
|
|
10
10
|
exports.nextjsServertMapTemplate = nextjsServertMapTemplate;
|
|
11
11
|
exports.nextjsDefaultMapTemplate = nextjsDefaultMapTemplate;
|
|
12
|
-
const
|
|
12
|
+
const node_tools_1 = require("@sitecore-content-sdk/content/node-tools");
|
|
13
13
|
const typescript_1 = __importDefault(require("typescript"));
|
|
14
14
|
const fs_1 = __importDefault(require("fs"));
|
|
15
|
-
const tools_2 = require("@sitecore-content-sdk/content/tools");
|
|
16
15
|
/**
|
|
17
16
|
* Detects the Next.js router type (App Router or Pages Router) based on directory structure.
|
|
18
17
|
* @param {string} projectRoot - The project root directory. Defaults to current working directory.
|
|
@@ -178,7 +177,7 @@ function detectComponentType(filePath, routerType) {
|
|
|
178
177
|
* @internal
|
|
179
178
|
*/
|
|
180
179
|
function getComponentListWithTypes(paths, exclude, includeVariants, routerType) {
|
|
181
|
-
const components = (0,
|
|
180
|
+
const components = (0, node_tools_1.getComponentList)(paths, exclude, includeVariants);
|
|
182
181
|
const detectedRouterType = routerType || detectRouterType();
|
|
183
182
|
return components.map((component) => (Object.assign(Object.assign({}, component), { componentType: detectComponentType(component.filePath, detectedRouterType) })));
|
|
184
183
|
}
|
|
@@ -189,7 +188,7 @@ function getComponentListWithTypes(paths, exclude, includeVariants, routerType)
|
|
|
189
188
|
*/
|
|
190
189
|
function nextjsClientMapTemplate(indexedImportMap) {
|
|
191
190
|
return `'use client';
|
|
192
|
-
${(0,
|
|
191
|
+
${(0, node_tools_1.defaultImportMapTemplate)(indexedImportMap, 'nextjs')}`;
|
|
193
192
|
}
|
|
194
193
|
/**
|
|
195
194
|
* React-specific import map template for server side imports only. Used in App Router.
|
|
@@ -197,7 +196,7 @@ function nextjsClientMapTemplate(indexedImportMap) {
|
|
|
197
196
|
* @returns {string} contents for resulting import map file
|
|
198
197
|
*/
|
|
199
198
|
function nextjsServertMapTemplate(indexedImportMap) {
|
|
200
|
-
return (0,
|
|
199
|
+
return (0, node_tools_1.defaultImportMapTemplate)(indexedImportMap, 'nextjs', 'defaultServerImportEntries');
|
|
201
200
|
}
|
|
202
201
|
/**
|
|
203
202
|
* React-specific import map template. Used in Pages Router.
|
|
@@ -205,5 +204,5 @@ function nextjsServertMapTemplate(indexedImportMap) {
|
|
|
205
204
|
* @returns {string} contents for resulting import map file
|
|
206
205
|
*/
|
|
207
206
|
function nextjsDefaultMapTemplate(indexedImportMap) {
|
|
208
|
-
return (0,
|
|
207
|
+
return (0, node_tools_1.defaultImportMapTemplate)(indexedImportMap, 'nextjs');
|
|
209
208
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeImportMap as writeImportMapCoreImpl, } from '@sitecore-content-sdk/content/tools';
|
|
1
|
+
import { writeImportMap as writeImportMapCoreImpl, } from '@sitecore-content-sdk/content/node-tools';
|
|
2
2
|
import { detectRouterType, nextjsClientMapTemplate, nextjsServertMapTemplate, nextjsDefaultMapTemplate, } from '../templating/utils';
|
|
3
3
|
let writeImportMapCore = writeImportMapCoreImpl;
|
|
4
4
|
export const __mockDependencies = (mocks) => {
|
package/dist/esm/tools/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { generateSites, getComponentList, extractFiles, } from '@sitecore-content-sdk/content/tools';
|
|
2
|
-
export { generateMetadata } from '@sitecore-content-sdk/core/tools';
|
|
1
|
+
export { generateSites, getComponentList, extractFiles, } from '@sitecore-content-sdk/content/node-tools';
|
|
2
|
+
export { generateMetadata } from '@sitecore-content-sdk/core/node-tools';
|
|
3
3
|
export { generateMap } from './generate-map';
|
|
4
4
|
export { writeImportMap } from './codegen/import-map';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { getComponentList, } from '@sitecore-content-sdk/content/tools';
|
|
1
|
+
import { getComponentList, defaultImportMapTemplate, } from '@sitecore-content-sdk/content/node-tools';
|
|
2
2
|
import ts from 'typescript';
|
|
3
3
|
import fs from 'fs';
|
|
4
|
-
import { defaultImportMapTemplate } from '@sitecore-content-sdk/content/tools';
|
|
5
4
|
/**
|
|
6
5
|
* Detects the Next.js router type (App Router or Pages Router) based on directory structure.
|
|
7
6
|
* @param {string} projectRoot - The project root directory. Defaults to current working directory.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/nextjs",
|
|
3
|
-
"version": "2.0.0-canary.
|
|
3
|
+
"version": "2.0.0-canary.8",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -91,9 +91,9 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@babel/parser": "^7.27.2",
|
|
94
|
-
"@sitecore-content-sdk/content": "2.0.0-canary.
|
|
95
|
-
"@sitecore-content-sdk/core": "2.0.0-canary.
|
|
96
|
-
"@sitecore-content-sdk/react": "2.0.0-canary.
|
|
94
|
+
"@sitecore-content-sdk/content": "2.0.0-canary.8",
|
|
95
|
+
"@sitecore-content-sdk/core": "2.0.0-canary.8",
|
|
96
|
+
"@sitecore-content-sdk/react": "2.0.0-canary.8",
|
|
97
97
|
"recast": "^0.23.11",
|
|
98
98
|
"regex-parser": "^2.3.1",
|
|
99
99
|
"sync-disk-cache": "^2.1.0"
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
},
|
|
178
178
|
"description": "",
|
|
179
179
|
"types": "types/index.d.ts",
|
|
180
|
-
"gitHead": "
|
|
180
|
+
"gitHead": "c8a8944d642f6c97020be92e09544b502d8c0ea9",
|
|
181
181
|
"files": [
|
|
182
182
|
"dist",
|
|
183
183
|
"types",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { Metadata } from '@sitecore-content-sdk/core/tools';
|
|
2
|
+
import { Metadata } from '@sitecore-content-sdk/core/node-tools';
|
|
3
3
|
import { ComponentMap } from '@sitecore-content-sdk/react';
|
|
4
4
|
import { NextjsContentSdkComponent } from '../sharedTypes/component-props';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing-config-middleware.d.ts","sourceRoot":"","sources":["../../src/editing/editing-config-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAMvD,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"editing-config-middleware.d.ts","sourceRoot":"","sources":["../../src/editing/editing-config-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAMvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAIjE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;IACpD;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,uBAAuB;IAItB,SAAS,CAAC,MAAM,EAAE,6BAA6B;IAH3D;;OAEG;gBACmB,MAAM,EAAE,6BAA6B;IAE3D;;;OAGG;IACI,UAAU,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC;IAIjF,OAAO,CAAC,OAAO,CAqCb;CACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
|
-
import { Metadata } from '@sitecore-content-sdk/core/tools';
|
|
2
|
+
import { Metadata } from '@sitecore-content-sdk/core/node-tools';
|
|
3
3
|
import { ComponentMap } from '@sitecore-content-sdk/react';
|
|
4
4
|
import { NextjsContentSdkComponent } from '../sharedTypes/component-props';
|
|
5
5
|
export type EditingConfigRouteHandlerOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing-config-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/editing-config-route-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"editing-config-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/editing-config-route-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAIjE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;IACpD;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,gCAAgC;eAe/D,WAAW;mBAkEP,WAAW;CAkCxC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WriteImportMapArgs } from '@sitecore-content-sdk/content/tools';
|
|
1
|
+
import { WriteImportMapArgs } from '@sitecore-content-sdk/content/node-tools';
|
|
2
2
|
export declare const __mockDependencies: (mocks: any) => void;
|
|
3
3
|
/**
|
|
4
4
|
* Entry point function for generating import-map. Parses provided paths and outputs the modules and imports from those files into .sitecore/import-map.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/import-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/import-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EACnB,MAAM,0CAA0C,CAAC;AAUlD,eAAO,MAAM,kBAAkB,GAAI,OAAO,GAAG,SAI5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,kBAAkB;;mBAQtD,CAAC"}
|
package/types/tools/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { ComponentFile, ComponentImport, GenerateMapArgs, } from '@sitecore-content-sdk/content/tools';
|
|
2
|
+
export { generateSites, GenerateSitesConfig, getComponentList, extractFiles, } from '@sitecore-content-sdk/content/node-tools';
|
|
3
|
+
export { generateMetadata } from '@sitecore-content-sdk/core/node-tools';
|
|
3
4
|
export { generateMap } from './generate-map';
|
|
4
5
|
export { writeImportMap } from './codegen/import-map';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,GACb,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentFileWithType, ComponentType, RouterType } from '@sitecore-content-sdk/content/tools';
|
|
2
|
-
import { ModuleExports } from '@sitecore-content-sdk/content/tools';
|
|
2
|
+
import { ModuleExports } from '@sitecore-content-sdk/content/node-tools';
|
|
3
3
|
/**
|
|
4
4
|
* Detects the Next.js router type (App Router or Pages Router) based on directory structure.
|
|
5
5
|
* @param {string} projectRoot - The project root directory. Defaults to current working directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,aAAa,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,UAAU,EACX,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAGL,aAAa,EACd,MAAM,0CAA0C,CAAC;AAIlD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,GAAE,MAAsB,GAAG,UAAU,CAehF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,aAAa,CA0J5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,eAAe,CAAC,EAAE,OAAO,EACzB,UAAU,CAAC,EAAE,UAAU,GACtB,qBAAqB,EAAE,CAQzB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAGnF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAEpF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAEpF"}
|