create-content-sdk-app 2.0.2 → 2.1.0-canary.2

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.
Files changed (36) hide show
  1. package/LICENSE.MD +202 -202
  2. package/dist/templates/nextjs/.cursor/rules/general.mdc +81 -81
  3. package/dist/templates/nextjs/.cursor/rules/javascript.mdc +112 -112
  4. package/dist/templates/nextjs/.cursor/rules/project-setup.mdc +100 -100
  5. package/dist/templates/nextjs/.cursor/rules/sitecore.mdc +150 -150
  6. package/dist/templates/nextjs/.env.container.example +27 -27
  7. package/dist/templates/nextjs/.env.remote.example +51 -51
  8. package/dist/templates/nextjs/.gitattributes +11 -11
  9. package/dist/templates/nextjs/.prettierrc +8 -8
  10. package/dist/templates/nextjs/.vscode/extensions.json +8 -8
  11. package/dist/templates/nextjs/.vscode/launch.json +15 -15
  12. package/dist/templates/nextjs/.windsurfrules +186 -186
  13. package/dist/templates/nextjs/LICENSE.txt +202 -202
  14. package/dist/templates/nextjs/eslint.config.mjs +81 -81
  15. package/dist/templates/nextjs/gitignore +28 -28
  16. package/dist/templates/nextjs/package.json +68 -68
  17. package/dist/templates/nextjs/sitecore.config.ts.example +40 -40
  18. package/dist/templates/nextjs/src/proxy.ts +11 -3
  19. package/dist/templates/nextjs/tsconfig.json +40 -40
  20. package/dist/templates/nextjs-app-router/.cursor/rules/app-router-setup.mdc +116 -116
  21. package/dist/templates/nextjs-app-router/.cursor/rules/general.mdc +80 -80
  22. package/dist/templates/nextjs-app-router/.cursor/rules/javascript.mdc +112 -112
  23. package/dist/templates/nextjs-app-router/.cursor/rules/sitecore.mdc +174 -174
  24. package/dist/templates/nextjs-app-router/.env.container.example +27 -27
  25. package/dist/templates/nextjs-app-router/.env.remote.example +51 -51
  26. package/dist/templates/nextjs-app-router/.gitattributes +11 -11
  27. package/dist/templates/nextjs-app-router/.windsurfrules +290 -290
  28. package/dist/templates/nextjs-app-router/eslint.config.mjs +21 -29
  29. package/dist/templates/nextjs-app-router/gitignore +31 -31
  30. package/dist/templates/nextjs-app-router/package.json +54 -55
  31. package/dist/templates/nextjs-app-router/postcss.config.mjs +5 -5
  32. package/dist/templates/nextjs-app-router/sitecore.config.ts.example +40 -40
  33. package/dist/templates/nextjs-app-router/src/app/globals.css +1 -1
  34. package/dist/templates/nextjs-app-router/src/proxy.ts +11 -3
  35. package/dist/templates/nextjs-app-router/tsconfig.json +48 -48
  36. package/package.json +2 -2
@@ -1,31 +1,31 @@
1
- # See https://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
-
6
- # next.js
7
- /.next*/
8
- /out/
9
-
10
- # misc
11
- .DS_Store
12
-
13
- # local env files
14
- .env.local
15
- .env.*.local
16
- .env
17
-
18
- # Log files
19
- *.log*
20
-
21
- # vercel
22
- .vercel
23
-
24
- # sitecore temp files
25
- .sitecore/*
26
- # except for component-map
27
- !.sitecore/component-map.ts
28
- !.sitecore/component-map.client.ts
29
- !.sitecore/import-map.ts
30
- !.sitecore/import-map.server.ts
31
- !.sitecore/import-map.client.ts
1
+ # See https://help.github.com/ignore-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+
6
+ # next.js
7
+ /.next*/
8
+ /out/
9
+
10
+ # misc
11
+ .DS_Store
12
+
13
+ # local env files
14
+ .env.local
15
+ .env.*.local
16
+ .env
17
+
18
+ # Log files
19
+ *.log*
20
+
21
+ # vercel
22
+ .vercel
23
+
24
+ # sitecore temp files
25
+ .sitecore/*
26
+ # except for component-map
27
+ !.sitecore/component-map.ts
28
+ !.sitecore/component-map.client.ts
29
+ !.sitecore/import-map.ts
30
+ !.sitecore/import-map.server.ts
31
+ !.sitecore/import-map.client.ts
@@ -1,56 +1,55 @@
1
- {
2
- "name": "content-sdk-nextjs-app-router",
3
- "description": "Application utilizing Content SDK and Next.js",
4
- "version": "0.1.0",
5
- "private": true,
6
- "author": {
7
- "name": "Sitecore Corporation",
8
- "url": "https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/sitecore/content-sdk.git"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/sitecore/content-sdk/issues"
16
- },
17
- "license": "Apache-2.0",
18
- "scripts": {
19
- "build": "cross-env NODE_ENV=production npm-run-all --serial sitecore-tools:generate-map sitecore-tools:build next:build",
20
- "lint": "eslint ./src/**/*.tsx ./src/**/*.ts",
21
- "next:build": "next build",
22
- "next:dev": "cross-env NODE_OPTIONS='--inspect' next dev",
23
- "next:start": "next start",
24
- "sitecore-tools:generate-map": "sitecore-tools project component generate-map",
25
- "sitecore-tools:generate-map:watch": "sitecore-tools project component generate-map --watch",
26
- "sitecore-tools:build": "sitecore-tools project build",
27
- "dev": "cross-env NODE_ENV=development npm-run-all --serial sitecore-tools:generate-map sitecore-tools:build --parallel next:dev sitecore-tools:generate-map:watch",
28
- "start": "cross-env-shell NODE_ENV=production npm-run-all --serial build next:start"
29
- },
30
- "dependencies": {
31
- "@sitecore-content-sdk/nextjs": "<%- version %>",
32
- "@sitecore-content-sdk/analytics-core": "<%- version %>",
33
- "@sitecore-content-sdk/personalize": "<%- version %>",
34
- "@sitecore-content-sdk/events": "<%- version %>",
35
- "@sitecore-feaas/clientside": "^0.6.0",
36
- "@sitecore/components": "~2.1.0",
37
- "next": "^16.1.1",
38
- "react": "^19.2.1",
39
- "react-dom": "^19.2.1",
40
- "next-intl": "^4.3.5"
41
- },
42
- "devDependencies": {
43
- "@eslint/eslintrc": "^3",
44
- "@sitecore-content-sdk/cli": "<%- version %>",
45
- "@tailwindcss/postcss": "^4",
46
- "@types/node": "^24.10.4",
47
- "@types/react": "^19.2.7",
48
- "@types/react-dom": "^19.2.3",
49
- "cross-env": "^10.0.0",
50
- "eslint": "^9.33.0",
51
- "eslint-config-next": "15.5.3",
52
- "npm-run-all2": "^8.0.4",
53
- "tailwindcss": "^4",
54
- "typescript": "~5.8.3"
55
- }
1
+ {
2
+ "name": "content-sdk-nextjs-app-router",
3
+ "description": "Application utilizing Content SDK and Next.js",
4
+ "version": "0.1.0",
5
+ "private": true,
6
+ "author": {
7
+ "name": "Sitecore Corporation",
8
+ "url": "https://doc.sitecore.com/xmc/en/developers/content-sdk/index.html"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/sitecore/content-sdk.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/sitecore/content-sdk/issues"
16
+ },
17
+ "license": "Apache-2.0",
18
+ "scripts": {
19
+ "build": "cross-env NODE_ENV=production npm-run-all --serial sitecore-tools:generate-map sitecore-tools:build next:build",
20
+ "lint": "eslint ./src/**/*.tsx ./src/**/*.ts",
21
+ "next:build": "next build",
22
+ "next:dev": "cross-env NODE_OPTIONS='--inspect' next dev",
23
+ "next:start": "next start",
24
+ "sitecore-tools:generate-map": "sitecore-tools project component generate-map",
25
+ "sitecore-tools:generate-map:watch": "sitecore-tools project component generate-map --watch",
26
+ "sitecore-tools:build": "sitecore-tools project build",
27
+ "dev": "cross-env NODE_ENV=development npm-run-all --serial sitecore-tools:generate-map sitecore-tools:build --parallel next:dev sitecore-tools:generate-map:watch",
28
+ "start": "cross-env-shell NODE_ENV=production npm-run-all --serial build next:start"
29
+ },
30
+ "dependencies": {
31
+ "@sitecore-content-sdk/nextjs": "<%- version %>",
32
+ "@sitecore-content-sdk/analytics-core": "<%- version %>",
33
+ "@sitecore-content-sdk/personalize": "<%- version %>",
34
+ "@sitecore-content-sdk/events": "<%- version %>",
35
+ "@sitecore-feaas/clientside": "^0.6.0",
36
+ "@sitecore/components": "~2.1.0",
37
+ "next": "^16.2.0",
38
+ "react": "^19.2.1",
39
+ "react-dom": "^19.2.1",
40
+ "next-intl": "^4.3.5"
41
+ },
42
+ "devDependencies": {
43
+ "@sitecore-content-sdk/cli": "<%- version %>",
44
+ "@tailwindcss/postcss": "^4",
45
+ "@types/node": "^24.10.4",
46
+ "@types/react": "^19.2.7",
47
+ "@types/react-dom": "^19.2.3",
48
+ "cross-env": "^10.0.0",
49
+ "eslint": "^9.33.0",
50
+ "eslint-config-next": "16.2.2",
51
+ "npm-run-all2": "^8.0.4",
52
+ "tailwindcss": "^4",
53
+ "typescript": "~5.8.3"
54
+ }
56
55
  }
@@ -1,5 +1,5 @@
1
- const config = {
2
- plugins: ["@tailwindcss/postcss"],
3
- };
4
-
5
- export default config;
1
+ const config = {
2
+ plugins: ["@tailwindcss/postcss"],
3
+ };
4
+
5
+ export default config;
@@ -1,40 +1,40 @@
1
- import { defineConfig } from '@sitecore-content-sdk/nextjs/config';
2
- /**
3
- * @type {import('@sitecore-content-sdk/nextjs/config').SitecoreConfig}
4
- * See the documentation for `defineConfig`:
5
- * https://doc.sitecore.com/xmc/en/developers/content-sdk/the-sitecore-configuration-file.html
6
- */
7
- export default defineConfig({
8
- api: {
9
- edge: {
10
- contextId:
11
- process.env.SITECORE_EDGE_CONTEXT_ID ||
12
- process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID ||
13
- '',
14
- clientContextId: process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID,
15
- edgeUrl:
16
- process.env.NEXT_PUBLIC_SITECORE_EDGE_PLATFORM_HOSTNAME ||
17
- process.env.SITECORE_EDGE_PLATFORM_HOSTNAME,
18
- },
19
- local: {
20
- apiKey: process.env.NEXT_PUBLIC_SITECORE_API_KEY || '',
21
- apiHost: process.env.NEXT_PUBLIC_SITECORE_API_HOST || '',
22
- },
23
- },
24
- defaultSite: process.env.NEXT_PUBLIC_DEFAULT_SITE_NAME,
25
- defaultLanguage: process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE || 'en',
26
- editingSecret: process.env.SITECORE_EDITING_SECRET,
27
- redirects: {
28
- enabled: true,
29
- locales: ['en'],
30
- },
31
- multisite: {
32
- enabled: true,
33
- useCookieResolution: () => process.env.VERCEL_ENV === 'preview',
34
- },
35
- personalize: {
36
- scope: process.env.NEXT_PUBLIC_PERSONALIZE_SCOPE,
37
- edgeTimeout: parseInt(process.env.PERSONALIZE_PROXY_EDGE_TIMEOUT!, 10),
38
- cdpTimeout: parseInt(process.env.PERSONALIZE_PROXY_EDGE_TIMEOUT!, 10),
39
- },
40
- });
1
+ import { defineConfig } from '@sitecore-content-sdk/nextjs/config';
2
+ /**
3
+ * @type {import('@sitecore-content-sdk/nextjs/config').SitecoreConfig}
4
+ * See the documentation for `defineConfig`:
5
+ * https://doc.sitecore.com/xmc/en/developers/content-sdk/the-sitecore-configuration-file.html
6
+ */
7
+ export default defineConfig({
8
+ api: {
9
+ edge: {
10
+ contextId:
11
+ process.env.SITECORE_EDGE_CONTEXT_ID ||
12
+ process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID ||
13
+ '',
14
+ clientContextId: process.env.NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID,
15
+ edgeUrl:
16
+ process.env.NEXT_PUBLIC_SITECORE_EDGE_PLATFORM_HOSTNAME ||
17
+ process.env.SITECORE_EDGE_PLATFORM_HOSTNAME,
18
+ },
19
+ local: {
20
+ apiKey: process.env.NEXT_PUBLIC_SITECORE_API_KEY || '',
21
+ apiHost: process.env.NEXT_PUBLIC_SITECORE_API_HOST || '',
22
+ },
23
+ },
24
+ defaultSite: process.env.NEXT_PUBLIC_DEFAULT_SITE_NAME,
25
+ defaultLanguage: process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE || 'en',
26
+ editingSecret: process.env.SITECORE_EDITING_SECRET,
27
+ redirects: {
28
+ enabled: true,
29
+ locales: ['en'],
30
+ },
31
+ multisite: {
32
+ enabled: true,
33
+ useCookieResolution: () => process.env.VERCEL_ENV === 'preview',
34
+ },
35
+ personalize: {
36
+ scope: process.env.NEXT_PUBLIC_PERSONALIZE_SCOPE,
37
+ edgeTimeout: parseInt(process.env.PERSONALIZE_PROXY_EDGE_TIMEOUT!, 10),
38
+ cdpTimeout: parseInt(process.env.PERSONALIZE_PROXY_EDGE_TIMEOUT!, 10),
39
+ },
40
+ });
@@ -1 +1 @@
1
- @import "tailwindcss";
1
+ @import "tailwindcss";
@@ -1,16 +1,24 @@
1
- import { type NextRequest } from 'next/server';
1
+ import { NextFetchEvent, type NextRequest } from 'next/server';
2
2
  import {
3
3
  defineProxy,
4
4
  AppRouterMultisiteProxy,
5
5
  PersonalizeProxy,
6
6
  RedirectsProxy,
7
7
  LocaleProxy,
8
+ BotTrackingProxy,
8
9
  } from '@sitecore-content-sdk/nextjs/proxy';
9
10
  import sites from '.sitecore/sites.json';
10
11
  import scConfig from 'sitecore.config';
11
12
  import { routing } from './i18n/routing';
12
13
 
13
- export default function proxy(req: NextRequest) {
14
+ export default function proxy(req: NextRequest, event: NextFetchEvent) {
15
+ // BotTrackingProxy will detect and track bots before any other proxies run
16
+ const botTracking = new BotTrackingProxy({
17
+ ...scConfig.api.edge,
18
+ sites,
19
+ fetchEvent: event,
20
+ });
21
+
14
22
  // LocaleProxy and AppRouterMultisiteProxy must always run for App Router routing
15
23
  const locale = new LocaleProxy({
16
24
  /**
@@ -82,7 +90,7 @@ export default function proxy(req: NextRequest) {
82
90
  // },
83
91
  });
84
92
 
85
- return defineProxy(locale, multisite, redirects, personalize).exec(req);
93
+ return defineProxy(botTracking, locale, multisite, redirects, personalize).exec(req);
86
94
  }
87
95
 
88
96
  export const config = {
@@ -1,48 +1,48 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": ".",
4
- "paths": {
5
- "components/*": [
6
- "src/components/*"
7
- ],
8
- "lib/*": [
9
- "src/lib/*"
10
- ],
11
- "temp/*": [
12
- "src/temp/*"
13
- ],
14
- "assets/*": [
15
- "src/assets/*"
16
- ],
17
- ".sitecore/*": [
18
- ".sitecore/*"
19
- ],
20
- <%_ if (helper.isDev) { _%>
21
- "next/*": ["node_modules/next/*"],
22
- <%_ } _%>
23
- },
24
- "target": "ES2017",
25
- "types": ["node"],
26
- "lib": ["dom", "dom.iterable", "esnext"],
27
- "allowJs": true,
28
- "skipLibCheck": true,
29
- "strict": true,
30
- "noEmit": true,
31
- "esModuleInterop": true,
32
- "strictFunctionTypes": false,
33
- "module": "esnext",
34
- "moduleResolution": "node",
35
- "allowSyntheticDefaultImports": true,
36
- "resolveJsonModule": true,
37
- "isolatedModules": true,
38
- "jsx": "preserve",
39
- "incremental": true,
40
- "plugins": [
41
- {
42
- "name": "next"
43
- }
44
- ],
45
- },
46
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
47
- "exclude": ["node_modules"]
48
- }
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "paths": {
5
+ "components/*": [
6
+ "src/components/*"
7
+ ],
8
+ "lib/*": [
9
+ "src/lib/*"
10
+ ],
11
+ "temp/*": [
12
+ "src/temp/*"
13
+ ],
14
+ "assets/*": [
15
+ "src/assets/*"
16
+ ],
17
+ ".sitecore/*": [
18
+ ".sitecore/*"
19
+ ],
20
+ <%_ if (helper.isDev) { _%>
21
+ "next/*": ["node_modules/next/*"],
22
+ <%_ } _%>
23
+ },
24
+ "target": "ES2017",
25
+ "types": ["node"],
26
+ "lib": ["dom", "dom.iterable", "esnext"],
27
+ "allowJs": true,
28
+ "skipLibCheck": true,
29
+ "strict": true,
30
+ "noEmit": true,
31
+ "esModuleInterop": true,
32
+ "strictFunctionTypes": false,
33
+ "module": "esnext",
34
+ "moduleResolution": "node",
35
+ "allowSyntheticDefaultImports": true,
36
+ "resolveJsonModule": true,
37
+ "isolatedModules": true,
38
+ "jsx": "preserve",
39
+ "incremental": true,
40
+ "plugins": [
41
+ {
42
+ "name": "next"
43
+ }
44
+ ],
45
+ },
46
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
47
+ "exclude": ["node_modules"]
48
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-content-sdk-app",
3
- "version": "2.0.2",
3
+ "version": "2.1.0-canary.2",
4
4
  "description": "Sitecore Content SDK initializer",
5
5
  "bin": "./dist/index.js",
6
6
  "scripts": {
@@ -70,5 +70,5 @@
70
70
  "ts-node": "^10.9.2",
71
71
  "typescript": "~5.8.3"
72
72
  },
73
- "gitHead": "b76e6169344e65141a96238321b74ef92202b436"
73
+ "gitHead": "eb793df1044b5140ec9acbe54e0b9b18b889f0b6"
74
74
  }