|
10 | 10 | "production", |
11 | 11 | "^production", |
12 | 12 | "{projectRoot}/lib/banner.json", |
13 | | - { "env": "NEXT_PUBLIC_ASTRO_URL" } |
14 | | - ] |
15 | | - }, |
16 | | - "build": { |
17 | | - "dependsOn": ["copy-docs", "prebuild-banner"], |
18 | | - "executor": "nx:run-commands", |
19 | | - "options": { |
20 | | - "commands": [ |
21 | | - { "command": "next build", "description": "Build Next.js app" }, |
22 | | - { |
23 | | - "command": "pnpm next-sitemap --config ./next-sitemap.config.js && node ./scripts/patch-sitemap-index.mjs", |
24 | | - "description": "Generate sitemap" |
25 | | - } |
26 | | - ], |
27 | | - "cwd": "nx-dev/nx-dev", |
28 | | - "parallel": false |
29 | | - }, |
30 | | - "inputs": [ |
31 | | - "production", |
32 | | - "^production", |
33 | | - "{projectRoot}/lib/banner.json", |
34 | | - "{projectRoot}/next-sitemap.config.js", |
35 | 13 | { "env": "NEXT_PUBLIC_ASTRO_URL" }, |
36 | 14 | { "env": "NX_DEV_URL" }, |
37 | 15 | { "env": "NEXT_PUBLIC_NO_INDEX" } |
|
42 | 20 | "{workspaceRoot}/nx-dev/nx-dev/public/robots.txt" |
43 | 21 | ] |
44 | 22 | }, |
45 | | - "check-links": { |
46 | | - "cache": true, |
47 | | - "dependsOn": ["nx-dev:build", "astro-docs:build"], |
48 | | - "executor": "nx:run-commands", |
49 | | - "options": { |
50 | | - "command": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/internal-link-checker.ts" |
51 | | - }, |
52 | | - "inputs": [ |
53 | | - "{workspaceRoot}/docs/**/*", |
54 | | - { "dependentTasksOutputFiles": "**/sitemap*.xml" }, |
55 | | - "{workspaceRoot}/scripts/tsconfig.scripts.json", |
56 | | - "{workspaceRoot}/scripts/documentation/internal-link-checker.ts" |
57 | | - ] |
58 | | - }, |
59 | | - "test": { |
60 | | - "dependsOn": ["check-links"] |
61 | | - }, |
62 | 23 | "sitemap": { |
63 | | - "dependsOn": ["build"], |
64 | | - "executor": "nx:run-commands", |
| 24 | + "dependsOn": ["nx-dev:next:build"], |
65 | 25 | "inputs": [ |
66 | 26 | "{workspaceRoot}/docs/**/*", |
67 | 27 | "production", |
68 | 28 | "{projectRoot}/next-sitemap.config.js", |
69 | 29 | { "env": "NX_DEV_URL" }, |
70 | 30 | { "env": "NEXT_PUBLIC_NO_INDEX" } |
71 | 31 | ], |
72 | | - "outputs": ["{workspaceRoot}/nx-dev/nx-dev/public"], |
| 32 | + "outputs": ["{workspaceRoot}/nx-dev/nx-dev/public/sitemap*.xml"], |
| 33 | + "command": "pnpm next-sitemap --config ./next-sitemap.config.js && node ./scripts/patch-sitemap-index.mjs", |
73 | 34 | "options": { |
74 | | - "command": "pnpm next-sitemap --config ./nx-dev/nx-dev/next-sitemap.config.js && node ./nx-dev/nx-dev/scripts/patch-sitemap-index.mjs" |
| 35 | + "cwd": "nx-dev/nx-dev" |
75 | 36 | } |
76 | 37 | }, |
77 | 38 | "prebuild-banner": { |
78 | | - "executor": "nx:run-commands", |
79 | 39 | "cache": false, |
80 | 40 | "outputs": ["{projectRoot}/lib/banner.json"], |
| 41 | + "command": "node ../../scripts/documentation/prebuild-banner.mjs", |
81 | 42 | "options": { |
82 | | - "command": "node ../../scripts/documentation/prebuild-banner.mjs", |
83 | 43 | "cwd": "nx-dev/nx-dev", |
84 | 44 | "env": { |
85 | 45 | "BANNER_OUTPUT_PATH": "lib/banner.json" |
|
94 | 54 | "cwd": "nx-dev/nx-dev" |
95 | 55 | } |
96 | 56 | }, |
97 | | - "serve": { |
98 | | - "dependsOn": ["copy-docs", "prebuild-banner"], |
99 | | - "command": "next dev", |
100 | | - "options": { |
101 | | - "cwd": "nx-dev/nx-dev" |
102 | | - } |
| 57 | + "copy-redirects": { |
| 58 | + "dependsOn": ["nx-dev:next:build"], |
| 59 | + "inputs": ["{projectRoot}/_redirects"], |
| 60 | + "outputs": ["{projectRoot}/.next/_redirects"], |
| 61 | + "command": "cp nx-dev/nx-dev/_redirects nx-dev/nx-dev/.next/_redirects" |
103 | 62 | }, |
104 | | - "serve-docs": { |
105 | | - "executor": "nx:run-commands", |
106 | | - "options": { |
107 | | - "commands": [ |
108 | | - "nx watch --projects=docs -- nx run-many -t=copy-docs -p nx-dev", |
109 | | - "nx run nx-dev:serve" |
110 | | - ], |
111 | | - "parallel": true |
112 | | - } |
| 63 | + "deploy-build": { |
| 64 | + "dependsOn": ["sitemap", "copy-redirects"], |
| 65 | + "outputs": ["{projectRoot}/.next"] |
113 | 66 | }, |
114 | 67 | "start": { |
115 | | - "dependsOn": ["build"], |
116 | | - "command": "next start", |
117 | | - "options": { |
118 | | - "cwd": "nx-dev/nx-dev" |
119 | | - } |
| 68 | + "command": "nx next:start nx-dev" |
120 | 69 | }, |
121 | | - "deploy-build": { |
122 | | - "executor": "nx:run-commands", |
123 | | - "outputs": ["{projectRoot}/public/documentation"], |
124 | | - "options": { |
125 | | - "commands": [ |
126 | | - { |
127 | | - "command": "nx run nx-dev:build", |
128 | | - "description": "NextJs build step" |
129 | | - } |
130 | | - ], |
131 | | - "color": true, |
132 | | - "parallel": false, |
133 | | - "env": { |
134 | | - "NODE_OPTIONS": "--max-old-space-size=4096" |
135 | | - } |
136 | | - }, |
137 | | - "configurations": { |
138 | | - "netlify": { |
139 | | - "commands": [ |
140 | | - { |
141 | | - "command": "nx run nx-dev:build && cp nx-dev/nx-dev/_redirects nx-dev/nx-dev/.next/_redirects", |
142 | | - "description": "NextJs build for Netlify" |
143 | | - } |
144 | | - ] |
145 | | - } |
146 | | - } |
| 70 | + "check-links": { |
| 71 | + "cache": true, |
| 72 | + "dependsOn": ["nx-dev:next:build", "astro-docs:build"], |
| 73 | + "command": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/documentation/internal-link-checker.ts", |
| 74 | + "inputs": [ |
| 75 | + "{workspaceRoot}/docs/**/*", |
| 76 | + { "dependentTasksOutputFiles": "**/sitemap*.xml" }, |
| 77 | + "{workspaceRoot}/scripts/tsconfig.scripts.json", |
| 78 | + "{workspaceRoot}/scripts/documentation/internal-link-checker.ts" |
| 79 | + ] |
| 80 | + }, |
| 81 | + "test": { |
| 82 | + "dependsOn": ["check-links"] |
147 | 83 | } |
148 | 84 | }, |
149 | 85 | "tags": ["scope:nx-dev", "type:app"], |
|
0 commit comments