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