@nx/remix 16.8.2 → 17.2.5

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 (173) hide show
  1. package/README.md +32 -89
  2. package/executors.json +0 -12
  3. package/generators.d.ts +14 -0
  4. package/generators.js +17 -0
  5. package/generators.json +3 -9
  6. package/index.d.ts +1 -0
  7. package/index.js +5 -0
  8. package/migrations.json +23 -123
  9. package/package.json +42 -12
  10. package/plugins/component-testing/index.js +11 -6
  11. package/src/executors/build/build.impl.js +64 -74
  12. package/src/executors/serve/serve.impl.js +43 -43
  13. package/src/generators/action/action.impl.js +24 -26
  14. package/src/generators/action/schema.d.ts +7 -1
  15. package/src/generators/action/schema.json +10 -3
  16. package/src/generators/application/__snapshots__/application.impl.spec.ts.snap +776 -149
  17. package/src/generators/application/application.impl.js +181 -131
  18. package/src/generators/application/files/common/app/root.tsx__tmpl__ +3 -3
  19. package/src/generators/application/files/common/tests/routes/_index.spec.tsx__tmpl__ +16 -0
  20. package/src/generators/application/files/integrated/package.json__tmpl__ +1 -0
  21. package/src/generators/application/lib/index.js +0 -1
  22. package/src/generators/application/lib/normalize-options.d.ts +5 -3
  23. package/src/generators/application/lib/normalize-options.js +23 -15
  24. package/src/generators/application/lib/update-unit-test-config.js +8 -3
  25. package/src/generators/application/schema.d.ts +5 -0
  26. package/src/generators/application/schema.json +14 -9
  27. package/src/generators/cypress/cypress.impl.js +52 -42
  28. package/src/generators/cypress/schema.d.ts +5 -1
  29. package/src/generators/cypress/schema.json +6 -0
  30. package/src/generators/cypress-component-configuration/cypress-component-configuration.impl.js +13 -18
  31. package/src/generators/error-boundary/__snapshots__/error-boundary.impl.spec.ts.snap +39 -27
  32. package/src/generators/error-boundary/error-boundary.impl.js +6 -15
  33. package/src/generators/error-boundary/lib/add-v2-error-boundary.js +11 -16
  34. package/src/generators/error-boundary/lib/index.d.ts +0 -1
  35. package/src/generators/error-boundary/lib/index.js +0 -2
  36. package/src/generators/error-boundary/lib/normalize-options.d.ts +1 -1
  37. package/src/generators/error-boundary/lib/normalize-options.js +9 -5
  38. package/src/generators/error-boundary/schema.d.ts +7 -2
  39. package/src/generators/error-boundary/schema.json +14 -12
  40. package/src/generators/library/__snapshots__/library.impl.spec.ts.snap +157 -0
  41. package/src/generators/library/lib/add-tsconfig-entry-points.js +0 -1
  42. package/src/generators/library/lib/add-unit-testing.js +4 -6
  43. package/src/generators/library/lib/index.js +0 -1
  44. package/src/generators/library/lib/normalize-options.d.ts +2 -1
  45. package/src/generators/library/lib/normalize-options.js +16 -13
  46. package/src/generators/library/lib/update-buildable-config.js +5 -2
  47. package/src/generators/library/library.impl.js +30 -33
  48. package/src/generators/library/schema.d.ts +2 -0
  49. package/src/generators/library/schema.json +6 -0
  50. package/src/generators/loader/loader.impl.js +24 -26
  51. package/src/generators/loader/schema.d.ts +7 -1
  52. package/src/generators/loader/schema.json +10 -3
  53. package/src/generators/meta/lib/v2.impl.js +14 -16
  54. package/src/generators/meta/meta.impl.js +2 -17
  55. package/src/generators/meta/schema.d.ts +7 -2
  56. package/src/generators/meta/schema.json +10 -7
  57. package/src/generators/preset/lib/normalize-options.js +5 -3
  58. package/src/generators/preset/preset.impl.js +18 -23
  59. package/src/generators/preset/schema.json +1 -0
  60. package/src/generators/resource-route/__snapshots__/resource-route.impl.spec.ts.snap +21 -0
  61. package/src/generators/resource-route/resource-route.impl.js +32 -26
  62. package/src/generators/resource-route/schema.d.ts +7 -1
  63. package/src/generators/resource-route/schema.json +10 -3
  64. package/src/generators/route/__snapshots__/route.impl.spec.ts.snap +62 -9
  65. package/src/generators/route/route.impl.js +55 -43
  66. package/src/generators/route/schema.d.ts +7 -1
  67. package/src/generators/route/schema.json +11 -4
  68. package/src/generators/setup/schema.json +1 -0
  69. package/src/generators/setup/setup.impl.js +23 -23
  70. package/src/generators/setup-tailwind/__snapshots__/setup-tailwind.impl.spec.ts.snap +27 -23
  71. package/src/generators/setup-tailwind/lib/index.js +0 -1
  72. package/src/generators/setup-tailwind/lib/update-remix-config.js +2 -3
  73. package/src/generators/setup-tailwind/schema.json +1 -0
  74. package/src/generators/setup-tailwind/setup-tailwind.impl.js +25 -29
  75. package/src/generators/storybook-configuration/schema.d.ts +2 -2
  76. package/src/generators/storybook-configuration/schema.json +4 -11
  77. package/src/generators/storybook-configuration/storybook-configuration.impl.js +8 -13
  78. package/src/generators/style/schema.d.ts +7 -1
  79. package/src/generators/style/schema.json +12 -5
  80. package/src/generators/style/style.impl.js +32 -24
  81. package/src/utils/create-watch-paths.js +8 -13
  82. package/src/utils/get-default-export-name.js +1 -3
  83. package/src/utils/get-default-export.js +0 -1
  84. package/src/utils/insert-import.js +0 -1
  85. package/src/utils/insert-statement-after-imports.js +0 -1
  86. package/src/utils/insert-statement-in-default-function.js +0 -1
  87. package/src/utils/remix-config.d.ts +1 -2
  88. package/src/utils/remix-config.js +8 -9
  89. package/src/utils/remix-route-utils.d.ts +2 -2
  90. package/src/utils/remix-route-utils.js +23 -17
  91. package/src/utils/testing-config-utils.js +0 -1
  92. package/src/utils/upsert-links-function.js +0 -1
  93. package/src/utils/versions.d.ts +9 -8
  94. package/src/utils/versions.js +14 -14
  95. package/plugins/component-testing/index.js.map +0 -1
  96. package/src/executors/build/build.impl.js.map +0 -1
  97. package/src/executors/build/compat.d.ts +0 -2
  98. package/src/executors/build/compat.js +0 -6
  99. package/src/executors/build/compat.js.map +0 -1
  100. package/src/executors/serve/compat.d.ts +0 -2
  101. package/src/executors/serve/compat.js +0 -6
  102. package/src/executors/serve/compat.js.map +0 -1
  103. package/src/executors/serve/serve.impl.js.map +0 -1
  104. package/src/generators/action/action.impl.js.map +0 -1
  105. package/src/generators/application/application.impl.js.map +0 -1
  106. package/src/generators/application/lib/index.js.map +0 -1
  107. package/src/generators/application/lib/normalize-options.js.map +0 -1
  108. package/src/generators/application/lib/update-unit-test-config.js.map +0 -1
  109. package/src/generators/cypress/cypress.impl.js.map +0 -1
  110. package/src/generators/cypress-component-configuration/cypress-component-configuration.impl.js.map +0 -1
  111. package/src/generators/error-boundary/error-boundary.impl.js.map +0 -1
  112. package/src/generators/error-boundary/lib/add-v1-error-boundary.d.ts +0 -3
  113. package/src/generators/error-boundary/lib/add-v1-error-boundary.js +0 -21
  114. package/src/generators/error-boundary/lib/add-v1-error-boundary.js.map +0 -1
  115. package/src/generators/error-boundary/lib/add-v2-error-boundary.js.map +0 -1
  116. package/src/generators/error-boundary/lib/index.js.map +0 -1
  117. package/src/generators/error-boundary/lib/normalize-options.js.map +0 -1
  118. package/src/generators/library/lib/add-tsconfig-entry-points.js.map +0 -1
  119. package/src/generators/library/lib/add-unit-testing.js.map +0 -1
  120. package/src/generators/library/lib/index.js.map +0 -1
  121. package/src/generators/library/lib/normalize-options.js.map +0 -1
  122. package/src/generators/library/lib/update-buildable-config.js.map +0 -1
  123. package/src/generators/library/library.impl.js.map +0 -1
  124. package/src/generators/loader/loader.impl.js.map +0 -1
  125. package/src/generators/meta/lib/normalize-options.d.ts +0 -3
  126. package/src/generators/meta/lib/normalize-options.js +0 -15
  127. package/src/generators/meta/lib/normalize-options.js.map +0 -1
  128. package/src/generators/meta/lib/v1.impl.d.ts +0 -3
  129. package/src/generators/meta/lib/v1.impl.js +0 -30
  130. package/src/generators/meta/lib/v1.impl.js.map +0 -1
  131. package/src/generators/meta/lib/v2.impl.js.map +0 -1
  132. package/src/generators/meta/meta.impl.js.map +0 -1
  133. package/src/generators/preset/lib/normalize-options.js.map +0 -1
  134. package/src/generators/preset/preset.impl.js.map +0 -1
  135. package/src/generators/resource-route/resource-route.impl.js.map +0 -1
  136. package/src/generators/route/route.impl.js.map +0 -1
  137. package/src/generators/setup/setup.impl.js.map +0 -1
  138. package/src/generators/setup-tailwind/lib/index.js.map +0 -1
  139. package/src/generators/setup-tailwind/lib/update-remix-config.js.map +0 -1
  140. package/src/generators/setup-tailwind/setup-tailwind.impl.js.map +0 -1
  141. package/src/generators/storybook-configuration/storybook-configuration.impl.js.map +0 -1
  142. package/src/generators/style/style.impl.js.map +0 -1
  143. package/src/index.d.ts +0 -15
  144. package/src/index.js +0 -21
  145. package/src/index.js.map +0 -1
  146. package/src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8.d.ts +0 -6
  147. package/src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8.js +0 -45
  148. package/src/migrations/update-14-5-4/update-tsconfig-and-remix-config-for-1-6-8.js.map +0 -1
  149. package/src/migrations/update-15-8-6/update-remix-env-d.d.ts +0 -6
  150. package/src/migrations/update-15-8-6/update-remix-env-d.js +0 -27
  151. package/src/migrations/update-15-8-6/update-remix-env-d.js.map +0 -1
  152. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
  153. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -13
  154. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +0 -1
  155. package/src/utils/create-watch-paths.js.map +0 -1
  156. package/src/utils/get-default-export-name.js.map +0 -1
  157. package/src/utils/get-default-export.js.map +0 -1
  158. package/src/utils/get-remix-projects.d.ts +0 -2
  159. package/src/utils/get-remix-projects.js +0 -15
  160. package/src/utils/get-remix-projects.js.map +0 -1
  161. package/src/utils/insert-import.js.map +0 -1
  162. package/src/utils/insert-statement-after-imports.js.map +0 -1
  163. package/src/utils/insert-statement-in-default-function.js.map +0 -1
  164. package/src/utils/project.d.ts +0 -2
  165. package/src/utils/project.js +0 -15
  166. package/src/utils/project.js.map +0 -1
  167. package/src/utils/remix-config.js.map +0 -1
  168. package/src/utils/remix-route-utils.js.map +0 -1
  169. package/src/utils/testing-config-utils.js.map +0 -1
  170. package/src/utils/upsert-links-function.js.map +0 -1
  171. package/src/utils/versions.js.map +0 -1
  172. /package/src/generators/application/files/common/app/routes/{index.tsx__tmpl__ → _index.tsx__tmpl__} +0 -0
  173. /package/src/generators/application/files/common/{remix.config.js__tmpl__ → remix.config.cjs__tmpl__} +0 -0
@@ -1,21 +1,21 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Remix Application Integrated Repo --directory should create the application correctly 1`] = `
3
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --directory should create the application correctly 1`] = `
4
4
  "/**
5
5
  * @type {import('@remix-run/dev').AppConfig}
6
6
  */
7
7
  module.exports = {
8
8
  ignoredRouteFiles: ['**/.*'],
9
- // appDirectory: \\"app\\",
10
- // assetsBuildDirectory: \\"public/build\\",
11
- // serverBuildPath: \\"build/index.js\\",
12
- // publicPath: \\"/build/\\",
9
+ // appDirectory: "app",
10
+ // assetsBuildDirectory: "public/build",
11
+ // serverBuildPath: "build/index.js",
12
+ // publicPath: "/build/",
13
13
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
14
14
  };
15
15
  "
16
16
  `;
17
17
 
18
- exports[`Remix Application Integrated Repo --directory should create the application correctly 2`] = `
18
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --directory should create the application correctly 2`] = `
19
19
  "import type { MetaFunction } from '@remix-run/node';
20
20
  import {
21
21
  Links,
@@ -26,15 +26,17 @@ import {
26
26
  ScrollRestoration,
27
27
  } from '@remix-run/react';
28
28
 
29
- export const meta: MetaFunction = () => ({
30
- charset: 'utf-8',
31
- title: 'New Remix App',
32
- viewport: 'width=device-width,initial-scale=1',
33
- });
29
+ export const meta: MetaFunction = () => [
30
+ {
31
+ charset: 'utf-8',
32
+ title: 'New Remix App',
33
+ viewport: 'width=device-width,initial-scale=1',
34
+ },
35
+ ];
34
36
 
35
37
  export default function App() {
36
38
  return (
37
- <html lang=\\"en\\">
39
+ <html lang="en">
38
40
  <head>
39
41
  <Meta />
40
42
  <Links />
@@ -51,7 +53,7 @@ export default function App() {
51
53
  "
52
54
  `;
53
55
 
54
- exports[`Remix Application Integrated Repo --directory should create the application correctly 3`] = `
56
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --directory should create the application correctly 3`] = `
55
57
  "export default function Index() {
56
58
  return (
57
59
  <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
@@ -59,24 +61,24 @@ exports[`Remix Application Integrated Repo --directory should create the applica
59
61
  <ul>
60
62
  <li>
61
63
  <a
62
- target=\\"_blank\\"
63
- href=\\"https://remix.run/tutorials/blog\\"
64
- rel=\\"noreferrer\\"
64
+ target="_blank"
65
+ href="https://remix.run/tutorials/blog"
66
+ rel="noreferrer"
65
67
  >
66
68
  15m Quickstart Blog Tutorial
67
69
  </a>
68
70
  </li>
69
71
  <li>
70
72
  <a
71
- target=\\"_blank\\"
72
- href=\\"https://remix.run/tutorials/jokes\\"
73
- rel=\\"noreferrer\\"
73
+ target="_blank"
74
+ href="https://remix.run/tutorials/jokes"
75
+ rel="noreferrer"
74
76
  >
75
77
  Deep Dive Jokes App Tutorial
76
78
  </a>
77
79
  </li>
78
80
  <li>
79
- <a target=\\"_blank\\" href=\\"https://remix.run/docs\\" rel=\\"noreferrer\\">
81
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
80
82
  Remix Docs
81
83
  </a>
82
84
  </li>
@@ -87,22 +89,22 @@ exports[`Remix Application Integrated Repo --directory should create the applica
87
89
  "
88
90
  `;
89
91
 
90
- exports[`Remix Application Integrated Repo --directory should extract the layout directory from the directory options if it exists 1`] = `
92
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --directory should extract the layout directory from the directory options if it exists 1`] = `
91
93
  "/**
92
94
  * @type {import('@remix-run/dev').AppConfig}
93
95
  */
94
96
  module.exports = {
95
97
  ignoredRouteFiles: ['**/.*'],
96
- // appDirectory: \\"app\\",
97
- // assetsBuildDirectory: \\"public/build\\",
98
- // serverBuildPath: \\"build/index.js\\",
99
- // publicPath: \\"/build/\\",
98
+ // appDirectory: "app",
99
+ // assetsBuildDirectory: "public/build",
100
+ // serverBuildPath: "build/index.js",
101
+ // publicPath: "/build/",
100
102
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
101
103
  };
102
104
  "
103
105
  `;
104
106
 
105
- exports[`Remix Application Integrated Repo --directory should extract the layout directory from the directory options if it exists 2`] = `
107
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --directory should extract the layout directory from the directory options if it exists 2`] = `
106
108
  "import type { MetaFunction } from '@remix-run/node';
107
109
  import {
108
110
  Links,
@@ -113,15 +115,17 @@ import {
113
115
  ScrollRestoration,
114
116
  } from '@remix-run/react';
115
117
 
116
- export const meta: MetaFunction = () => ({
117
- charset: 'utf-8',
118
- title: 'New Remix App',
119
- viewport: 'width=device-width,initial-scale=1',
120
- });
118
+ export const meta: MetaFunction = () => [
119
+ {
120
+ charset: 'utf-8',
121
+ title: 'New Remix App',
122
+ viewport: 'width=device-width,initial-scale=1',
123
+ },
124
+ ];
121
125
 
122
126
  export default function App() {
123
127
  return (
124
- <html lang=\\"en\\">
128
+ <html lang="en">
125
129
  <head>
126
130
  <Meta />
127
131
  <Links />
@@ -138,7 +142,7 @@ export default function App() {
138
142
  "
139
143
  `;
140
144
 
141
- exports[`Remix Application Integrated Repo --directory should extract the layout directory from the directory options if it exists 3`] = `
145
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --directory should extract the layout directory from the directory options if it exists 3`] = `
142
146
  "export default function Index() {
143
147
  return (
144
148
  <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
@@ -146,24 +150,24 @@ exports[`Remix Application Integrated Repo --directory should extract the layout
146
150
  <ul>
147
151
  <li>
148
152
  <a
149
- target=\\"_blank\\"
150
- href=\\"https://remix.run/tutorials/blog\\"
151
- rel=\\"noreferrer\\"
153
+ target="_blank"
154
+ href="https://remix.run/tutorials/blog"
155
+ rel="noreferrer"
152
156
  >
153
157
  15m Quickstart Blog Tutorial
154
158
  </a>
155
159
  </li>
156
160
  <li>
157
161
  <a
158
- target=\\"_blank\\"
159
- href=\\"https://remix.run/tutorials/jokes\\"
160
- rel=\\"noreferrer\\"
162
+ target="_blank"
163
+ href="https://remix.run/tutorials/jokes"
164
+ rel="noreferrer"
161
165
  >
162
166
  Deep Dive Jokes App Tutorial
163
167
  </a>
164
168
  </li>
165
169
  <li>
166
- <a target=\\"_blank\\" href=\\"https://remix.run/docs\\" rel=\\"noreferrer\\">
170
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
167
171
  Remix Docs
168
172
  </a>
169
173
  </li>
@@ -174,22 +178,36 @@ exports[`Remix Application Integrated Repo --directory should extract the layout
174
178
  "
175
179
  `;
176
180
 
177
- exports[`Remix Application Integrated Repo --js should create the application correctly 1`] = `
181
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --e2eTestRunner should generate an e2e application for the app 1`] = `
182
+ "import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
183
+
184
+ import { defineConfig } from 'cypress';
185
+
186
+ export default defineConfig({
187
+ e2e: {
188
+ ...nxE2EPreset(__filename, { cypressDir: 'src' }),
189
+ baseUrl: 'http://localhost:4200',
190
+ },
191
+ });
192
+ "
193
+ `;
194
+
195
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --js should create the application correctly 1`] = `
178
196
  "/**
179
197
  * @type {import('@remix-run/dev').AppConfig}
180
198
  */
181
199
  module.exports = {
182
200
  ignoredRouteFiles: ['**/.*'],
183
- // appDirectory: \\"app\\",
184
- // assetsBuildDirectory: \\"public/build\\",
185
- // serverBuildPath: \\"build/index.js\\",
186
- // publicPath: \\"/build/\\",
201
+ // appDirectory: "app",
202
+ // assetsBuildDirectory: "public/build",
203
+ // serverBuildPath: "build/index.js",
204
+ // publicPath: "/build/",
187
205
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
188
206
  };
189
207
  "
190
208
  `;
191
209
 
192
- exports[`Remix Application Integrated Repo --js should create the application correctly 2`] = `
210
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --js should create the application correctly 2`] = `
193
211
  "import {
194
212
  Links,
195
213
  LiveReload,
@@ -198,14 +216,289 @@ exports[`Remix Application Integrated Repo --js should create the application co
198
216
  Scripts,
199
217
  ScrollRestoration,
200
218
  } from '@remix-run/react';
201
- export const meta = () => ({
202
- charset: 'utf-8',
203
- title: 'New Remix App',
204
- viewport: 'width=device-width,initial-scale=1',
219
+ export const meta = () => [
220
+ {
221
+ charset: 'utf-8',
222
+ title: 'New Remix App',
223
+ viewport: 'width=device-width,initial-scale=1',
224
+ },
225
+ ];
226
+ export default function App() {
227
+ return (
228
+ <html lang="en">
229
+ <head>
230
+ <Meta />
231
+ <Links />
232
+ </head>
233
+ <body>
234
+ <Outlet />
235
+ <ScrollRestoration />
236
+ <Scripts />
237
+ <LiveReload />
238
+ </body>
239
+ </html>
240
+ );
241
+ }
242
+ "
243
+ `;
244
+
245
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --js should create the application correctly 3`] = `
246
+ "export default function Index() {
247
+ return (
248
+ <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
249
+ <h1>Welcome to Remix</h1>
250
+ <ul>
251
+ <li>
252
+ <a
253
+ target="_blank"
254
+ href="https://remix.run/tutorials/blog"
255
+ rel="noreferrer"
256
+ >
257
+ 15m Quickstart Blog Tutorial
258
+ </a>
259
+ </li>
260
+ <li>
261
+ <a
262
+ target="_blank"
263
+ href="https://remix.run/tutorials/jokes"
264
+ rel="noreferrer"
265
+ >
266
+ Deep Dive Jokes App Tutorial
267
+ </a>
268
+ </li>
269
+ <li>
270
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
271
+ Remix Docs
272
+ </a>
273
+ </li>
274
+ </ul>
275
+ </div>
276
+ );
277
+ }
278
+ "
279
+ `;
280
+
281
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using jest 1`] = `
282
+ "/**
283
+ * @type {import('@remix-run/dev').AppConfig}
284
+ */
285
+ module.exports = {
286
+ ignoredRouteFiles: ['**/.*'],
287
+ // appDirectory: "app",
288
+ // assetsBuildDirectory: "public/build",
289
+ // serverBuildPath: "build/index.js",
290
+ // publicPath: "/build/",
291
+ watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
292
+ };
293
+ "
294
+ `;
295
+
296
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using jest 2`] = `
297
+ "/* eslint-disable */
298
+ export default {
299
+ setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
300
+ displayName: 'test',
301
+ preset: '../jest.preset.cjs',
302
+ transform: {
303
+ '^.+\\\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
304
+ },
305
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
306
+ coverageDirectory: '../coverage/test',
307
+ };
308
+ "
309
+ `;
310
+
311
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using jest 3`] = `
312
+ "import { installGlobals } from '@remix-run/node';
313
+ import '@testing-library/jest-dom/matchers';
314
+ installGlobals();
315
+ "
316
+ `;
317
+
318
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using vitest 1`] = `
319
+ "/**
320
+ * @type {import('@remix-run/dev').AppConfig}
321
+ */
322
+ module.exports = {
323
+ ignoredRouteFiles: ['**/.*'],
324
+ // appDirectory: "app",
325
+ // assetsBuildDirectory: "public/build",
326
+ // serverBuildPath: "build/index.js",
327
+ // publicPath: "/build/",
328
+ watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
329
+ };
330
+ "
331
+ `;
332
+
333
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using vitest 2`] = `
334
+ "/// <reference types='vitest' />
335
+ import { defineConfig } from 'vite';
336
+ import react from '@vitejs/plugin-react';
337
+ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
338
+
339
+ export default defineConfig({
340
+ root: __dirname,
341
+ cacheDir: '../node_modules/.vite/test',
342
+
343
+ plugins: [react(), nxViteTsPaths()],
344
+
345
+ // Uncomment this if you are using workers.
346
+ // worker: {
347
+ // plugins: [ nxViteTsPaths() ],
348
+ // },
349
+
350
+ test: {
351
+ setupFiles: ['test-setup.ts'],
352
+ globals: true,
353
+ cache: {
354
+ dir: '../node_modules/.vitest',
355
+ },
356
+ environment: 'jsdom',
357
+ include: ['./tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
358
+
359
+ reporters: ['default'],
360
+ coverage: {
361
+ reportsDirectory: '../coverage/test',
362
+ provider: 'v8',
363
+ },
364
+ },
205
365
  });
366
+ "
367
+ `;
368
+
369
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using vitest 3`] = `
370
+ "import { installGlobals } from '@remix-run/node';
371
+ import '@testing-library/jest-dom/matchers';
372
+ installGlobals();
373
+ "
374
+ `;
375
+
376
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided should create the application correctly 1`] = `
377
+ "/**
378
+ * @type {import('@remix-run/dev').AppConfig}
379
+ */
380
+ module.exports = {
381
+ ignoredRouteFiles: ['**/.*'],
382
+ // appDirectory: "app",
383
+ // assetsBuildDirectory: "public/build",
384
+ // serverBuildPath: "build/index.js",
385
+ // publicPath: "/build/",
386
+ watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
387
+ };
388
+ "
389
+ `;
390
+
391
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided should create the application correctly 2`] = `
392
+ "import type { MetaFunction } from '@remix-run/node';
393
+ import {
394
+ Links,
395
+ LiveReload,
396
+ Meta,
397
+ Outlet,
398
+ Scripts,
399
+ ScrollRestoration,
400
+ } from '@remix-run/react';
401
+
402
+ export const meta: MetaFunction = () => [
403
+ {
404
+ charset: 'utf-8',
405
+ title: 'New Remix App',
406
+ viewport: 'width=device-width,initial-scale=1',
407
+ },
408
+ ];
409
+
410
+ export default function App() {
411
+ return (
412
+ <html lang="en">
413
+ <head>
414
+ <Meta />
415
+ <Links />
416
+ </head>
417
+ <body>
418
+ <Outlet />
419
+ <ScrollRestoration />
420
+ <Scripts />
421
+ <LiveReload />
422
+ </body>
423
+ </html>
424
+ );
425
+ }
426
+ "
427
+ `;
428
+
429
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided should create the application correctly 3`] = `
430
+ "export default function Index() {
431
+ return (
432
+ <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
433
+ <h1>Welcome to Remix</h1>
434
+ <ul>
435
+ <li>
436
+ <a
437
+ target="_blank"
438
+ href="https://remix.run/tutorials/blog"
439
+ rel="noreferrer"
440
+ >
441
+ 15m Quickstart Blog Tutorial
442
+ </a>
443
+ </li>
444
+ <li>
445
+ <a
446
+ target="_blank"
447
+ href="https://remix.run/tutorials/jokes"
448
+ rel="noreferrer"
449
+ >
450
+ Deep Dive Jokes App Tutorial
451
+ </a>
452
+ </li>
453
+ <li>
454
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
455
+ Remix Docs
456
+ </a>
457
+ </li>
458
+ </ul>
459
+ </div>
460
+ );
461
+ }
462
+ "
463
+ `;
464
+
465
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --directory should create the application correctly 1`] = `
466
+ "/**
467
+ * @type {import('@remix-run/dev').AppConfig}
468
+ */
469
+ module.exports = {
470
+ ignoredRouteFiles: ['**/.*'],
471
+ // appDirectory: "app",
472
+ // assetsBuildDirectory: "public/build",
473
+ // serverBuildPath: "build/index.js",
474
+ // publicPath: "/build/",
475
+ watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
476
+ };
477
+ "
478
+ `;
479
+
480
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --directory should create the application correctly 2`] = `
481
+ "import type { MetaFunction } from '@remix-run/node';
482
+ import {
483
+ Links,
484
+ LiveReload,
485
+ Meta,
486
+ Outlet,
487
+ Scripts,
488
+ ScrollRestoration,
489
+ } from '@remix-run/react';
490
+
491
+ export const meta: MetaFunction = () => [
492
+ {
493
+ charset: 'utf-8',
494
+ title: 'New Remix App',
495
+ viewport: 'width=device-width,initial-scale=1',
496
+ },
497
+ ];
498
+
206
499
  export default function App() {
207
500
  return (
208
- <html lang=\\"en\\">
501
+ <html lang="en">
209
502
  <head>
210
503
  <Meta />
211
504
  <Links />
@@ -222,7 +515,7 @@ export default function App() {
222
515
  "
223
516
  `;
224
517
 
225
- exports[`Remix Application Integrated Repo --js should create the application correctly 3`] = `
518
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --directory should create the application correctly 3`] = `
226
519
  "export default function Index() {
227
520
  return (
228
521
  <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
@@ -230,24 +523,24 @@ exports[`Remix Application Integrated Repo --js should create the application co
230
523
  <ul>
231
524
  <li>
232
525
  <a
233
- target=\\"_blank\\"
234
- href=\\"https://remix.run/tutorials/blog\\"
235
- rel=\\"noreferrer\\"
526
+ target="_blank"
527
+ href="https://remix.run/tutorials/blog"
528
+ rel="noreferrer"
236
529
  >
237
530
  15m Quickstart Blog Tutorial
238
531
  </a>
239
532
  </li>
240
533
  <li>
241
534
  <a
242
- target=\\"_blank\\"
243
- href=\\"https://remix.run/tutorials/jokes\\"
244
- rel=\\"noreferrer\\"
535
+ target="_blank"
536
+ href="https://remix.run/tutorials/jokes"
537
+ rel="noreferrer"
245
538
  >
246
539
  Deep Dive Jokes App Tutorial
247
540
  </a>
248
541
  </li>
249
542
  <li>
250
- <a target=\\"_blank\\" href=\\"https://remix.run/docs\\" rel=\\"noreferrer\\">
543
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
251
544
  Remix Docs
252
545
  </a>
253
546
  </li>
@@ -258,29 +551,218 @@ exports[`Remix Application Integrated Repo --js should create the application co
258
551
  "
259
552
  `;
260
553
 
261
- exports[`Remix Application Integrated Repo --unitTestRunner should generate the correct files for testing using jest 1`] = `
554
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --directory should extract the layout directory from the directory options if it exists 1`] = `
262
555
  "/**
263
556
  * @type {import('@remix-run/dev').AppConfig}
264
557
  */
265
558
  module.exports = {
266
559
  ignoredRouteFiles: ['**/.*'],
267
- // appDirectory: \\"app\\",
268
- // assetsBuildDirectory: \\"public/build\\",
269
- // serverBuildPath: \\"build/index.js\\",
270
- // publicPath: \\"/build/\\",
560
+ // appDirectory: "app",
561
+ // assetsBuildDirectory: "public/build",
562
+ // serverBuildPath: "build/index.js",
563
+ // publicPath: "/build/",
271
564
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
272
565
  };
273
566
  "
274
567
  `;
275
568
 
276
- exports[`Remix Application Integrated Repo --unitTestRunner should generate the correct files for testing using jest 2`] = `
569
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --directory should extract the layout directory from the directory options if it exists 2`] = `
570
+ "import type { MetaFunction } from '@remix-run/node';
571
+ import {
572
+ Links,
573
+ LiveReload,
574
+ Meta,
575
+ Outlet,
576
+ Scripts,
577
+ ScrollRestoration,
578
+ } from '@remix-run/react';
579
+
580
+ export const meta: MetaFunction = () => [
581
+ {
582
+ charset: 'utf-8',
583
+ title: 'New Remix App',
584
+ viewport: 'width=device-width,initial-scale=1',
585
+ },
586
+ ];
587
+
588
+ export default function App() {
589
+ return (
590
+ <html lang="en">
591
+ <head>
592
+ <Meta />
593
+ <Links />
594
+ </head>
595
+ <body>
596
+ <Outlet />
597
+ <ScrollRestoration />
598
+ <Scripts />
599
+ <LiveReload />
600
+ </body>
601
+ </html>
602
+ );
603
+ }
604
+ "
605
+ `;
606
+
607
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --directory should extract the layout directory from the directory options if it exists 3`] = `
608
+ "export default function Index() {
609
+ return (
610
+ <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
611
+ <h1>Welcome to Remix</h1>
612
+ <ul>
613
+ <li>
614
+ <a
615
+ target="_blank"
616
+ href="https://remix.run/tutorials/blog"
617
+ rel="noreferrer"
618
+ >
619
+ 15m Quickstart Blog Tutorial
620
+ </a>
621
+ </li>
622
+ <li>
623
+ <a
624
+ target="_blank"
625
+ href="https://remix.run/tutorials/jokes"
626
+ rel="noreferrer"
627
+ >
628
+ Deep Dive Jokes App Tutorial
629
+ </a>
630
+ </li>
631
+ <li>
632
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
633
+ Remix Docs
634
+ </a>
635
+ </li>
636
+ </ul>
637
+ </div>
638
+ );
639
+ }
640
+ "
641
+ `;
642
+
643
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --e2eTestRunner should generate an e2e application for the app 1`] = `
644
+ "import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
645
+
646
+ import { defineConfig } from 'cypress';
647
+
648
+ export default defineConfig({
649
+ e2e: {
650
+ ...nxE2EPreset(__filename, { cypressDir: 'src' }),
651
+ baseUrl: 'http://localhost:4200',
652
+ },
653
+ });
654
+ "
655
+ `;
656
+
657
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --js should create the application correctly 1`] = `
658
+ "/**
659
+ * @type {import('@remix-run/dev').AppConfig}
660
+ */
661
+ module.exports = {
662
+ ignoredRouteFiles: ['**/.*'],
663
+ // appDirectory: "app",
664
+ // assetsBuildDirectory: "public/build",
665
+ // serverBuildPath: "build/index.js",
666
+ // publicPath: "/build/",
667
+ watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
668
+ };
669
+ "
670
+ `;
671
+
672
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --js should create the application correctly 2`] = `
673
+ "import {
674
+ Links,
675
+ LiveReload,
676
+ Meta,
677
+ Outlet,
678
+ Scripts,
679
+ ScrollRestoration,
680
+ } from '@remix-run/react';
681
+ export const meta = () => [
682
+ {
683
+ charset: 'utf-8',
684
+ title: 'New Remix App',
685
+ viewport: 'width=device-width,initial-scale=1',
686
+ },
687
+ ];
688
+ export default function App() {
689
+ return (
690
+ <html lang="en">
691
+ <head>
692
+ <Meta />
693
+ <Links />
694
+ </head>
695
+ <body>
696
+ <Outlet />
697
+ <ScrollRestoration />
698
+ <Scripts />
699
+ <LiveReload />
700
+ </body>
701
+ </html>
702
+ );
703
+ }
704
+ "
705
+ `;
706
+
707
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --js should create the application correctly 3`] = `
708
+ "export default function Index() {
709
+ return (
710
+ <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
711
+ <h1>Welcome to Remix</h1>
712
+ <ul>
713
+ <li>
714
+ <a
715
+ target="_blank"
716
+ href="https://remix.run/tutorials/blog"
717
+ rel="noreferrer"
718
+ >
719
+ 15m Quickstart Blog Tutorial
720
+ </a>
721
+ </li>
722
+ <li>
723
+ <a
724
+ target="_blank"
725
+ href="https://remix.run/tutorials/jokes"
726
+ rel="noreferrer"
727
+ >
728
+ Deep Dive Jokes App Tutorial
729
+ </a>
730
+ </li>
731
+ <li>
732
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
733
+ Remix Docs
734
+ </a>
735
+ </li>
736
+ </ul>
737
+ </div>
738
+ );
739
+ }
740
+ "
741
+ `;
742
+
743
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using jest 1`] = `
744
+ "/**
745
+ * @type {import('@remix-run/dev').AppConfig}
746
+ */
747
+ module.exports = {
748
+ ignoredRouteFiles: ['**/.*'],
749
+ // appDirectory: "app",
750
+ // assetsBuildDirectory: "public/build",
751
+ // serverBuildPath: "build/index.js",
752
+ // publicPath: "/build/",
753
+ watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
754
+ };
755
+ "
756
+ `;
757
+
758
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using jest 2`] = `
277
759
  "/* eslint-disable */
278
760
  export default {
279
761
  setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
280
762
  displayName: 'test',
281
- preset: '../../jest.preset.js',
763
+ preset: '../../jest.preset.cjs',
282
764
  transform: {
283
- '^.+\\\\\\\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
765
+ '^.+\\\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
284
766
  },
285
767
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
286
768
  coverageDirectory: '../../coverage/apps/test',
@@ -288,29 +770,37 @@ export default {
288
770
  "
289
771
  `;
290
772
 
291
- exports[`Remix Application Integrated Repo --unitTestRunner should generate the correct files for testing using vitest 1`] = `
773
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using jest 3`] = `
774
+ "import { installGlobals } from '@remix-run/node';
775
+ import '@testing-library/jest-dom/matchers';
776
+ installGlobals();
777
+ "
778
+ `;
779
+
780
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using vitest 1`] = `
292
781
  "/**
293
782
  * @type {import('@remix-run/dev').AppConfig}
294
783
  */
295
784
  module.exports = {
296
785
  ignoredRouteFiles: ['**/.*'],
297
- // appDirectory: \\"app\\",
298
- // assetsBuildDirectory: \\"public/build\\",
299
- // serverBuildPath: \\"build/index.js\\",
300
- // publicPath: \\"/build/\\",
786
+ // appDirectory: "app",
787
+ // assetsBuildDirectory: "public/build",
788
+ // serverBuildPath: "build/index.js",
789
+ // publicPath: "/build/",
301
790
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
302
791
  };
303
792
  "
304
793
  `;
305
794
 
306
- exports[`Remix Application Integrated Repo --unitTestRunner should generate the correct files for testing using vitest 2`] = `
307
- "/// <reference types=\\"vitest\\" />
308
- import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
309
- import react from '@vitejs/plugin-react';
795
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using vitest 2`] = `
796
+ "/// <reference types='vitest' />
310
797
  import { defineConfig } from 'vite';
798
+ import react from '@vitejs/plugin-react';
799
+ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
311
800
 
312
801
  export default defineConfig({
313
- cacheDir: '../../node_modules/.vite/test',
802
+ root: __dirname,
803
+ cacheDir: '../../node_modules/.vite/apps/test',
314
804
 
315
805
  plugins: [react(), nxViteTsPaths()],
316
806
 
@@ -320,34 +810,47 @@ export default defineConfig({
320
810
  // },
321
811
 
322
812
  test: {
323
- setupFiles: ['./test-setup.ts'],
813
+ setupFiles: ['test-setup.ts'],
324
814
  globals: true,
325
815
  cache: {
326
816
  dir: '../../node_modules/.vitest',
327
817
  },
328
818
  environment: 'jsdom',
329
- include: ['./app/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
819
+ include: ['./tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
820
+
821
+ reporters: ['default'],
822
+ coverage: {
823
+ reportsDirectory: '../../coverage/apps/test',
824
+ provider: 'v8',
825
+ },
330
826
  },
331
827
  });
332
828
  "
333
829
  `;
334
830
 
335
- exports[`Remix Application Integrated Repo should create the application correctly 1`] = `
831
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using vitest 3`] = `
832
+ "import { installGlobals } from '@remix-run/node';
833
+ import '@testing-library/jest-dom/matchers';
834
+ installGlobals();
835
+ "
836
+ `;
837
+
838
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived should create the application correctly 1`] = `
336
839
  "/**
337
840
  * @type {import('@remix-run/dev').AppConfig}
338
841
  */
339
842
  module.exports = {
340
843
  ignoredRouteFiles: ['**/.*'],
341
- // appDirectory: \\"app\\",
342
- // assetsBuildDirectory: \\"public/build\\",
343
- // serverBuildPath: \\"build/index.js\\",
344
- // publicPath: \\"/build/\\",
844
+ // appDirectory: "app",
845
+ // assetsBuildDirectory: "public/build",
846
+ // serverBuildPath: "build/index.js",
847
+ // publicPath: "/build/",
345
848
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
346
849
  };
347
850
  "
348
851
  `;
349
852
 
350
- exports[`Remix Application Integrated Repo should create the application correctly 2`] = `
853
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived should create the application correctly 2`] = `
351
854
  "import type { MetaFunction } from '@remix-run/node';
352
855
  import {
353
856
  Links,
@@ -358,15 +861,17 @@ import {
358
861
  ScrollRestoration,
359
862
  } from '@remix-run/react';
360
863
 
361
- export const meta: MetaFunction = () => ({
362
- charset: 'utf-8',
363
- title: 'New Remix App',
364
- viewport: 'width=device-width,initial-scale=1',
365
- });
864
+ export const meta: MetaFunction = () => [
865
+ {
866
+ charset: 'utf-8',
867
+ title: 'New Remix App',
868
+ viewport: 'width=device-width,initial-scale=1',
869
+ },
870
+ ];
366
871
 
367
872
  export default function App() {
368
873
  return (
369
- <html lang=\\"en\\">
874
+ <html lang="en">
370
875
  <head>
371
876
  <Meta />
372
877
  <Links />
@@ -383,7 +888,7 @@ export default function App() {
383
888
  "
384
889
  `;
385
890
 
386
- exports[`Remix Application Integrated Repo should create the application correctly 3`] = `
891
+ exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived should create the application correctly 3`] = `
387
892
  "export default function Index() {
388
893
  return (
389
894
  <div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
@@ -391,24 +896,24 @@ exports[`Remix Application Integrated Repo should create the application correct
391
896
  <ul>
392
897
  <li>
393
898
  <a
394
- target=\\"_blank\\"
395
- href=\\"https://remix.run/tutorials/blog\\"
396
- rel=\\"noreferrer\\"
899
+ target="_blank"
900
+ href="https://remix.run/tutorials/blog"
901
+ rel="noreferrer"
397
902
  >
398
903
  15m Quickstart Blog Tutorial
399
904
  </a>
400
905
  </li>
401
906
  <li>
402
907
  <a
403
- target=\\"_blank\\"
404
- href=\\"https://remix.run/tutorials/jokes\\"
405
- rel=\\"noreferrer\\"
908
+ target="_blank"
909
+ href="https://remix.run/tutorials/jokes"
910
+ rel="noreferrer"
406
911
  >
407
912
  Deep Dive Jokes App Tutorial
408
913
  </a>
409
914
  </li>
410
915
  <li>
411
- <a target=\\"_blank\\" href=\\"https://remix.run/docs\\" rel=\\"noreferrer\\">
916
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
412
917
  Remix Docs
413
918
  </a>
414
919
  </li>
@@ -419,16 +924,30 @@ exports[`Remix Application Integrated Repo should create the application correct
419
924
  "
420
925
  `;
421
926
 
927
+ exports[`Remix Application Standalone Project Repo --e2eTestRunner should generate an e2e application for the app 1`] = `
928
+ "import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';
929
+
930
+ import { defineConfig } from 'cypress';
931
+
932
+ export default defineConfig({
933
+ e2e: {
934
+ ...nxE2EPreset(__filename, { cypressDir: 'src' }),
935
+ baseUrl: 'http://localhost:4200',
936
+ },
937
+ });
938
+ "
939
+ `;
940
+
422
941
  exports[`Remix Application Standalone Project Repo --js should create the application correctly 1`] = `
423
942
  "/**
424
943
  * @type {import('@remix-run/dev').AppConfig}
425
944
  */
426
945
  module.exports = {
427
946
  ignoredRouteFiles: ['**/.*'],
428
- // appDirectory: \\"app\\",
429
- // assetsBuildDirectory: \\"public/build\\",
430
- // serverBuildPath: \\"build/index.js\\",
431
- // publicPath: \\"/build/\\",
947
+ // appDirectory: "app",
948
+ // assetsBuildDirectory: "public/build",
949
+ // serverBuildPath: "build/index.js",
950
+ // publicPath: "/build/",
432
951
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
433
952
  };
434
953
  "
@@ -443,14 +962,16 @@ exports[`Remix Application Standalone Project Repo --js should create the applic
443
962
  Scripts,
444
963
  ScrollRestoration,
445
964
  } from '@remix-run/react';
446
- export const meta = () => ({
447
- charset: 'utf-8',
448
- title: 'New Remix App',
449
- viewport: 'width=device-width,initial-scale=1',
450
- });
965
+ export const meta = () => [
966
+ {
967
+ charset: 'utf-8',
968
+ title: 'New Remix App',
969
+ viewport: 'width=device-width,initial-scale=1',
970
+ },
971
+ ];
451
972
  export default function App() {
452
973
  return (
453
- <html lang=\\"en\\">
974
+ <html lang="en">
454
975
  <head>
455
976
  <Meta />
456
977
  <Links />
@@ -475,24 +996,24 @@ exports[`Remix Application Standalone Project Repo --js should create the applic
475
996
  <ul>
476
997
  <li>
477
998
  <a
478
- target=\\"_blank\\"
479
- href=\\"https://remix.run/tutorials/blog\\"
480
- rel=\\"noreferrer\\"
999
+ target="_blank"
1000
+ href="https://remix.run/tutorials/blog"
1001
+ rel="noreferrer"
481
1002
  >
482
1003
  15m Quickstart Blog Tutorial
483
1004
  </a>
484
1005
  </li>
485
1006
  <li>
486
1007
  <a
487
- target=\\"_blank\\"
488
- href=\\"https://remix.run/tutorials/jokes\\"
489
- rel=\\"noreferrer\\"
1008
+ target="_blank"
1009
+ href="https://remix.run/tutorials/jokes"
1010
+ rel="noreferrer"
490
1011
  >
491
1012
  Deep Dive Jokes App Tutorial
492
1013
  </a>
493
1014
  </li>
494
1015
  <li>
495
- <a target=\\"_blank\\" href=\\"https://remix.run/docs\\" rel=\\"noreferrer\\">
1016
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
496
1017
  Remix Docs
497
1018
  </a>
498
1019
  </li>
@@ -509,10 +1030,10 @@ exports[`Remix Application Standalone Project Repo --unitTestRunner should gener
509
1030
  */
510
1031
  module.exports = {
511
1032
  ignoredRouteFiles: ['**/.*'],
512
- // appDirectory: \\"app\\",
513
- // assetsBuildDirectory: \\"public/build\\",
514
- // serverBuildPath: \\"build/index.js\\",
515
- // publicPath: \\"/build/\\",
1033
+ // appDirectory: "app",
1034
+ // assetsBuildDirectory: "public/build",
1035
+ // serverBuildPath: "build/index.js",
1036
+ // publicPath: "/build/",
516
1037
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
517
1038
  };
518
1039
  "
@@ -523,9 +1044,9 @@ exports[`Remix Application Standalone Project Repo --unitTestRunner should gener
523
1044
  export default {
524
1045
  setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
525
1046
  displayName: 'test',
526
- preset: './jest.preset.js',
1047
+ preset: './jest.preset.cjs',
527
1048
  transform: {
528
- '^.+\\\\\\\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
1049
+ '^.+\\\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
529
1050
  },
530
1051
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
531
1052
  coverageDirectory: './coverage/test',
@@ -537,29 +1058,57 @@ export default {
537
1058
  "
538
1059
  `;
539
1060
 
1061
+ exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using jest 3`] = `
1062
+ "import { installGlobals } from '@remix-run/node';
1063
+ import '@testing-library/jest-dom/matchers';
1064
+ installGlobals();
1065
+ "
1066
+ `;
1067
+
1068
+ exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using jest 4`] = `
1069
+ "import { createRemixStub } from '@remix-run/testing';
1070
+ import { render, screen, waitFor } from '@testing-library/react';
1071
+ import Index from '../../app/routes/_index';
1072
+
1073
+ test('renders loader data', async () => {
1074
+ const RemixStub = createRemixStub([
1075
+ {
1076
+ path: '/',
1077
+ Component: Index,
1078
+ },
1079
+ ]);
1080
+
1081
+ render(<RemixStub />);
1082
+
1083
+ await waitFor(() => screen.findByText('Welcome to Remix'));
1084
+ });
1085
+ "
1086
+ `;
1087
+
540
1088
  exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using vitest 1`] = `
541
1089
  "/**
542
1090
  * @type {import('@remix-run/dev').AppConfig}
543
1091
  */
544
1092
  module.exports = {
545
1093
  ignoredRouteFiles: ['**/.*'],
546
- // appDirectory: \\"app\\",
547
- // assetsBuildDirectory: \\"public/build\\",
548
- // serverBuildPath: \\"build/index.js\\",
549
- // publicPath: \\"/build/\\",
1094
+ // appDirectory: "app",
1095
+ // assetsBuildDirectory: "public/build",
1096
+ // serverBuildPath: "build/index.js",
1097
+ // publicPath: "/build/",
550
1098
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
551
1099
  };
552
1100
  "
553
1101
  `;
554
1102
 
555
1103
  exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using vitest 2`] = `
556
- "/// <reference types=\\"vitest\\" />
557
- import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
558
- import react from '@vitejs/plugin-react';
1104
+ "/// <reference types='vitest' />
559
1105
  import { defineConfig } from 'vite';
1106
+ import react from '@vitejs/plugin-react';
1107
+ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
560
1108
 
561
1109
  export default defineConfig({
562
- cacheDir: './node_modules/.vite/test',
1110
+ root: __dirname,
1111
+ cacheDir: './node_modules/.vite/.',
563
1112
 
564
1113
  plugins: [react(), nxViteTsPaths()],
565
1114
 
@@ -569,28 +1118,61 @@ export default defineConfig({
569
1118
  // },
570
1119
 
571
1120
  test: {
572
- setupFiles: ['./test-setup.ts'],
1121
+ setupFiles: ['test-setup.ts'],
573
1122
  globals: true,
574
1123
  cache: {
575
1124
  dir: './node_modules/.vitest',
576
1125
  },
577
1126
  environment: 'jsdom',
578
- include: ['./app/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
1127
+ include: ['./tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
1128
+
1129
+ reporters: ['default'],
1130
+ coverage: {
1131
+ reportsDirectory: './coverage/.',
1132
+ provider: 'v8',
1133
+ },
579
1134
  },
580
1135
  });
581
1136
  "
582
1137
  `;
583
1138
 
1139
+ exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using vitest 3`] = `
1140
+ "import { createRemixStub } from '@remix-run/testing';
1141
+ import { render, screen, waitFor } from '@testing-library/react';
1142
+ import Index from '../../app/routes/_index';
1143
+
1144
+ test('renders loader data', async () => {
1145
+ const RemixStub = createRemixStub([
1146
+ {
1147
+ path: '/',
1148
+ Component: Index,
1149
+ },
1150
+ ]);
1151
+
1152
+ render(<RemixStub />);
1153
+
1154
+ await waitFor(() => screen.findByText('Welcome to Remix'));
1155
+ });
1156
+ "
1157
+ `;
1158
+
1159
+ exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using vitest 4`] = `
1160
+ "import { installGlobals } from '@remix-run/node';
1161
+ import '@testing-library/jest-dom/matchers';
1162
+ installGlobals();
1163
+ "
1164
+ `;
1165
+
584
1166
  exports[`Remix Application Standalone Project Repo should create the application correctly 1`] = `
585
1167
  "/**
586
1168
  * @type {import('@remix-run/dev').AppConfig}
587
1169
  */
588
1170
  module.exports = {
589
1171
  ignoredRouteFiles: ['**/.*'],
590
- // appDirectory: \\"app\\",
591
- // assetsBuildDirectory: \\"public/build\\",
592
- // serverBuildPath: \\"build/index.js\\",
593
- // publicPath: \\"/build/\\",
1172
+ // appDirectory: "app",
1173
+ // assetsBuildDirectory: "public/build",
1174
+ // serverBuildPath: "build/index.js",
1175
+ // publicPath: "/build/",
594
1176
  watchPaths: () => require('@nx/remix').createWatchPaths(__dirname),
595
1177
  };
596
1178
  "
@@ -607,15 +1189,17 @@ import {
607
1189
  ScrollRestoration,
608
1190
  } from '@remix-run/react';
609
1191
 
610
- export const meta: MetaFunction = () => ({
611
- charset: 'utf-8',
612
- title: 'New Remix App',
613
- viewport: 'width=device-width,initial-scale=1',
614
- });
1192
+ export const meta: MetaFunction = () => [
1193
+ {
1194
+ charset: 'utf-8',
1195
+ title: 'New Remix App',
1196
+ viewport: 'width=device-width,initial-scale=1',
1197
+ },
1198
+ ];
615
1199
 
616
1200
  export default function App() {
617
1201
  return (
618
- <html lang=\\"en\\">
1202
+ <html lang="en">
619
1203
  <head>
620
1204
  <Meta />
621
1205
  <Links />
@@ -640,24 +1224,24 @@ exports[`Remix Application Standalone Project Repo should create the application
640
1224
  <ul>
641
1225
  <li>
642
1226
  <a
643
- target=\\"_blank\\"
644
- href=\\"https://remix.run/tutorials/blog\\"
645
- rel=\\"noreferrer\\"
1227
+ target="_blank"
1228
+ href="https://remix.run/tutorials/blog"
1229
+ rel="noreferrer"
646
1230
  >
647
1231
  15m Quickstart Blog Tutorial
648
1232
  </a>
649
1233
  </li>
650
1234
  <li>
651
1235
  <a
652
- target=\\"_blank\\"
653
- href=\\"https://remix.run/tutorials/jokes\\"
654
- rel=\\"noreferrer\\"
1236
+ target="_blank"
1237
+ href="https://remix.run/tutorials/jokes"
1238
+ rel="noreferrer"
655
1239
  >
656
1240
  Deep Dive Jokes App Tutorial
657
1241
  </a>
658
1242
  </li>
659
1243
  <li>
660
- <a target=\\"_blank\\" href=\\"https://remix.run/docs\\" rel=\\"noreferrer\\">
1244
+ <a target="_blank" href="https://remix.run/docs" rel="noreferrer">
661
1245
  Remix Docs
662
1246
  </a>
663
1247
  </li>
@@ -667,3 +1251,46 @@ exports[`Remix Application Standalone Project Repo should create the application
667
1251
  }
668
1252
  "
669
1253
  `;
1254
+
1255
+ exports[`Remix Application Standalone Project Repo should create the application correctly 4`] = `
1256
+ "import { createRemixStub } from '@remix-run/testing';
1257
+ import { render, screen, waitFor } from '@testing-library/react';
1258
+ import Index from '../../app/routes/_index';
1259
+
1260
+ test('renders loader data', async () => {
1261
+ const RemixStub = createRemixStub([
1262
+ {
1263
+ path: '/',
1264
+ Component: Index,
1265
+ },
1266
+ ]);
1267
+
1268
+ render(<RemixStub />);
1269
+
1270
+ await waitFor(() => screen.findByText('Welcome to Remix'));
1271
+ });
1272
+ "
1273
+ `;
1274
+
1275
+ exports[`Remix Application Standalone Project Repo should create the application correctly 5`] = `null`;
1276
+
1277
+ exports[`Remix Application Standalone Project Repo should create the application correctly 6`] = `
1278
+ "{
1279
+ "root": true,
1280
+ "ignorePatterns": ["!**/*"],
1281
+ "plugins": ["@nx"],
1282
+ "overrides": [
1283
+ {
1284
+ "files": ["*.ts", "*.tsx"],
1285
+ "extends": ["plugin:@nx/typescript"],
1286
+ "rules": {}
1287
+ },
1288
+ {
1289
+ "files": ["*.js", "*.jsx"],
1290
+ "extends": ["plugin:@nx/javascript"],
1291
+ "rules": {}
1292
+ }
1293
+ ]
1294
+ }
1295
+ "
1296
+ `;