@nx/remix 22.7.0-beta.5 → 22.7.0-beta.6
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/assets.json +13 -0
- package/package.json +10 -11
- package/project.json +2 -27
- package/src/generators/application/__snapshots__/application.impl.spec.ts.snap +0 -760
- package/src/generators/error-boundary/__snapshots__/error-boundary.impl.spec.ts.snap +0 -31
- package/src/generators/library/__snapshots__/library.impl.spec.ts.snap +0 -51
- package/src/generators/resource-route/__snapshots__/resource-route.impl.spec.ts.snap +0 -5
- package/src/generators/route/__snapshots__/route.impl.spec.ts.snap +0 -48
- package/src/generators/setup-tailwind/__snapshots__/setup-tailwind.impl.spec.ts.snap +0 -89
- package/src/generators/storybook-configuration/__snapshots__/storybook-configuration.impl.spec.ts.snap +0 -113
- package/src/plugins/__snapshots__/plugin.spec.ts.snap +0 -525
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`ErrorBoundary --apiVersion=2 should correctly add the ErrorBoundary to the route file 1`] = `
|
|
4
|
-
"import { useRouteError, isRouteErrorResponse } from '@remix-run/react';
|
|
5
|
-
export function ErrorBoundary() {
|
|
6
|
-
const error = useRouteError();
|
|
7
|
-
|
|
8
|
-
// when true, this is what used to go to 'CatchBoundary'
|
|
9
|
-
if (isRouteErrorResponse(error)) {
|
|
10
|
-
return (
|
|
11
|
-
<div>
|
|
12
|
-
<h1>Oops</h1>
|
|
13
|
-
<p>Status: {error.status}</p>
|
|
14
|
-
<p>{error.data.message}</p>
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
} else if (error instanceof Error) {
|
|
18
|
-
return (
|
|
19
|
-
<div>
|
|
20
|
-
<h1>Error</h1>
|
|
21
|
-
<p>{error.message}</p>
|
|
22
|
-
<p>The stack trace is:</p>
|
|
23
|
-
<pre>{error.stack}</pre>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
} else {
|
|
27
|
-
return <h1>Unknown Error</h1>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
"
|
|
31
|
-
`;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
-
|
|
3
|
-
exports[`Remix Library Generator --unitTestRunner should create the correct config files for testing with jest 1`] = `
|
|
4
|
-
"module.exports = {
|
|
5
|
-
setupFilesAfterEnv: ['./src/test-setup.ts'],
|
|
6
|
-
displayName: 'test',
|
|
7
|
-
preset: '../jest.preset.js',
|
|
8
|
-
transform: {
|
|
9
|
-
'^(?!.*\\\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
|
|
10
|
-
'^.+\\\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
|
|
11
|
-
},
|
|
12
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
13
|
-
coverageDirectory: '../coverage/test',
|
|
14
|
-
};
|
|
15
|
-
"
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
exports[`Remix Library Generator --unitTestRunner should create the correct config files for testing with jest 2`] = `
|
|
19
|
-
"import { installGlobals } from '@remix-run/node';
|
|
20
|
-
import '@testing-library/jest-dom/matchers';
|
|
21
|
-
installGlobals();
|
|
22
|
-
"
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
exports[`Remix Library Generator --unitTestRunner should create the correct config files for testing with vitest 1`] = `null`;
|
|
26
|
-
|
|
27
|
-
exports[`Remix Library Generator --unitTestRunner should create the correct config files for testing with vitest 2`] = `
|
|
28
|
-
"import { installGlobals } from '@remix-run/node';
|
|
29
|
-
import '@testing-library/jest-dom/matchers';
|
|
30
|
-
installGlobals();
|
|
31
|
-
"
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
exports[`Remix Library Generator should generate a library correctly 1`] = `
|
|
35
|
-
[
|
|
36
|
-
"test.module.css",
|
|
37
|
-
"test.spec.tsx",
|
|
38
|
-
"test.tsx",
|
|
39
|
-
]
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
exports[`Remix Library Generator should generate a library correctly 2`] = `
|
|
43
|
-
{
|
|
44
|
-
"@proj/test": [
|
|
45
|
-
"test/src/index.ts",
|
|
46
|
-
],
|
|
47
|
-
"@proj/test/server": [
|
|
48
|
-
"test/src/server.ts",
|
|
49
|
-
],
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`resource route should error if it detects a possible missing route param because of un-escaped dollar sign 1`] = `[Error: Your route path has an indicator of an un-escaped dollar sign for a route param. If this was intended, include the --skipChecks flag.]`;
|
|
4
|
-
|
|
5
|
-
exports[`resource route should error if it detects a possible missing route param because of un-escaped dollar sign 3`] = `[Error: Your route path has an indicator of an un-escaped dollar sign for a route param. If this was intended, include the --skipChecks flag.]`;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`route should add route component 1`] = `
|
|
4
|
-
"import { useLoaderData, useActionData } from '@remix-run/react';
|
|
5
|
-
import { json } from '@remix-run/node';
|
|
6
|
-
import type {
|
|
7
|
-
LoaderFunctionArgs,
|
|
8
|
-
MetaFunction,
|
|
9
|
-
ActionFunctionArgs,
|
|
10
|
-
LinksFunction,
|
|
11
|
-
} from '@remix-run/node';
|
|
12
|
-
|
|
13
|
-
import stylesUrl from '../../../styles/path/to/example.css';
|
|
14
|
-
|
|
15
|
-
export const links: LinksFunction = () => {
|
|
16
|
-
return [{ rel: 'stylesheet', href: stylesUrl }];
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const action = async ({ request }: ActionFunctionArgs) => {
|
|
20
|
-
let formData = await request.formData();
|
|
21
|
-
|
|
22
|
-
return json({ message: formData.toString() }, { status: 200 });
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const meta: MetaFunction = () => {
|
|
26
|
-
return [{ title: 'Example Route' }];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
|
30
|
-
return json({
|
|
31
|
-
message: 'Hello, world!',
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default function Example() {
|
|
36
|
-
const actionMessage = useActionData<typeof action>();
|
|
37
|
-
const data = useLoaderData<typeof loader>();
|
|
38
|
-
|
|
39
|
-
return <p>Message: {data.message}</p>;
|
|
40
|
-
}
|
|
41
|
-
"
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
exports[`route should error if it detects a possible missing route param because of un-escaped dollar sign 1`] = `[Error: Your route path has an indicator of an un-escaped dollar sign for a route param. If this was intended, include the --skipChecks flag.]`;
|
|
45
|
-
|
|
46
|
-
exports[`route should error if it detects a possible missing route param because of un-escaped dollar sign 2`] = `[Error: Your route path has an indicator of an un-escaped dollar sign for a route param. If this was intended, include the --skipChecks flag.]`;
|
|
47
|
-
|
|
48
|
-
exports[`route should error if it detects a possible missing route param because of un-escaped dollar sign 3`] = `[Error: Your route path has an indicator of an un-escaped dollar sign for a route param. If this was intended, include the --skipChecks flag.]`;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`setup-tailwind generator should add a tailwind config to an application correctly 1`] = `
|
|
4
|
-
"import type { Config } from 'tailwindcss';
|
|
5
|
-
import { createGlobPatternsForDependencies } from '@nx/react/tailwind';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
content: [
|
|
9
|
-
'./app/**/*.{js,jsx,ts,tsx}',
|
|
10
|
-
...createGlobPatternsForDependencies(__dirname),
|
|
11
|
-
],
|
|
12
|
-
theme: {
|
|
13
|
-
extend: {},
|
|
14
|
-
},
|
|
15
|
-
plugins: [],
|
|
16
|
-
} satisfies Config;
|
|
17
|
-
"
|
|
18
|
-
`;
|
|
19
|
-
|
|
20
|
-
exports[`setup-tailwind generator should add a tailwind config to an application correctly 2`] = `
|
|
21
|
-
"export default {
|
|
22
|
-
plugins: {
|
|
23
|
-
tailwindcss: {},
|
|
24
|
-
autoprefixer: {},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
"
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
exports[`setup-tailwind generator should add a tailwind config to an application correctly 3`] = `
|
|
31
|
-
"@tailwind base;
|
|
32
|
-
@tailwind components;
|
|
33
|
-
@tailwind utilities;
|
|
34
|
-
"
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
exports[`setup-tailwind generator should add a tailwind config to an application correctly 4`] = `
|
|
38
|
-
"import {
|
|
39
|
-
Links,
|
|
40
|
-
Meta,
|
|
41
|
-
Outlet,
|
|
42
|
-
Scripts,
|
|
43
|
-
ScrollRestoration,
|
|
44
|
-
} from '@remix-run/react';
|
|
45
|
-
import type { MetaFunction, LinksFunction } from '@remix-run/node';
|
|
46
|
-
import './tailwind.css';
|
|
47
|
-
|
|
48
|
-
export const meta: MetaFunction = () => [
|
|
49
|
-
{
|
|
50
|
-
title: 'New Remix App',
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
export const links: LinksFunction = () => [
|
|
55
|
-
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
|
56
|
-
{
|
|
57
|
-
rel: 'preconnect',
|
|
58
|
-
href: 'https://fonts.gstatic.com',
|
|
59
|
-
crossOrigin: 'anonymous',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
rel: 'stylesheet',
|
|
63
|
-
href: 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap',
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
export function Layout({ children }: { children: React.ReactNode }) {
|
|
68
|
-
return (
|
|
69
|
-
<html lang="en">
|
|
70
|
-
<head>
|
|
71
|
-
<meta charSet="utf-8" />
|
|
72
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
73
|
-
<Meta />
|
|
74
|
-
<Links />
|
|
75
|
-
</head>
|
|
76
|
-
<body>
|
|
77
|
-
{children}
|
|
78
|
-
<ScrollRestoration />
|
|
79
|
-
<Scripts />
|
|
80
|
-
</body>
|
|
81
|
-
</html>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default function App() {
|
|
86
|
-
return <Outlet />;
|
|
87
|
-
}
|
|
88
|
-
"
|
|
89
|
-
`;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
-
|
|
3
|
-
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework jest 1`] = `
|
|
4
|
-
"/// <reference types="vitest" />
|
|
5
|
-
import { defineConfig } from 'vite';
|
|
6
|
-
import react from '@vitejs/plugin-react';
|
|
7
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths';
|
|
8
|
-
|
|
9
|
-
export default defineConfig({
|
|
10
|
-
cacheDir: '../../node_modules/.vite/storybook/libs/storybook-test',
|
|
11
|
-
|
|
12
|
-
plugins: [
|
|
13
|
-
react(),
|
|
14
|
-
viteTsConfigPaths({
|
|
15
|
-
root: '../../../',
|
|
16
|
-
}),
|
|
17
|
-
],
|
|
18
|
-
});
|
|
19
|
-
"
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework jest 2`] = `
|
|
23
|
-
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
24
|
-
|
|
25
|
-
const config: StorybookConfig = {
|
|
26
|
-
stories: ['../src/lib/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
|
|
27
|
-
addons: [],
|
|
28
|
-
framework: {
|
|
29
|
-
name: '@storybook/react-vite',
|
|
30
|
-
options: {
|
|
31
|
-
builder: {
|
|
32
|
-
viteConfigPath: 'vite.config.ts',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default config;
|
|
39
|
-
|
|
40
|
-
// To customize your Vite configuration you can use the viteFinal field.
|
|
41
|
-
// Check https://storybook.js.org/docs/react/builders/vite#configuration
|
|
42
|
-
// and https://nx.dev/recipes/storybook/custom-builder-configs
|
|
43
|
-
"
|
|
44
|
-
`;
|
|
45
|
-
|
|
46
|
-
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework none 1`] = `
|
|
47
|
-
"/// <reference types="vitest" />
|
|
48
|
-
import { defineConfig } from 'vite';
|
|
49
|
-
import react from '@vitejs/plugin-react';
|
|
50
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths';
|
|
51
|
-
|
|
52
|
-
export default defineConfig({
|
|
53
|
-
cacheDir: '../../node_modules/.vite/storybook/libs/storybook-test',
|
|
54
|
-
|
|
55
|
-
plugins: [
|
|
56
|
-
react(),
|
|
57
|
-
viteTsConfigPaths({
|
|
58
|
-
root: '../../../',
|
|
59
|
-
}),
|
|
60
|
-
],
|
|
61
|
-
});
|
|
62
|
-
"
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework none 2`] = `
|
|
66
|
-
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
67
|
-
|
|
68
|
-
const config: StorybookConfig = {
|
|
69
|
-
stories: ['../src/lib/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
|
|
70
|
-
addons: [],
|
|
71
|
-
framework: {
|
|
72
|
-
name: '@storybook/react-vite',
|
|
73
|
-
options: {
|
|
74
|
-
builder: {
|
|
75
|
-
viteConfigPath: 'vite.config.ts',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export default config;
|
|
82
|
-
|
|
83
|
-
// To customize your Vite configuration you can use the viteFinal field.
|
|
84
|
-
// Check https://storybook.js.org/docs/react/builders/vite#configuration
|
|
85
|
-
// and https://nx.dev/recipes/storybook/custom-builder-configs
|
|
86
|
-
"
|
|
87
|
-
`;
|
|
88
|
-
|
|
89
|
-
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework vitest 1`] = `null`;
|
|
90
|
-
|
|
91
|
-
exports[`Storybook Configuration it should create a storybook configuration and use react-vite framework with testing framework vitest 2`] = `
|
|
92
|
-
"import type { StorybookConfig } from '@storybook/react-vite';
|
|
93
|
-
|
|
94
|
-
const config: StorybookConfig = {
|
|
95
|
-
stories: ['../src/lib/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'],
|
|
96
|
-
addons: [],
|
|
97
|
-
framework: {
|
|
98
|
-
name: '@storybook/react-vite',
|
|
99
|
-
options: {
|
|
100
|
-
builder: {
|
|
101
|
-
viteConfigPath: 'vite.config.mts',
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export default config;
|
|
108
|
-
|
|
109
|
-
// To customize your Vite configuration you can use the viteFinal field.
|
|
110
|
-
// Check https://storybook.js.org/docs/react/builders/vite#configuration
|
|
111
|
-
// and https://nx.dev/recipes/storybook/custom-builder-configs
|
|
112
|
-
"
|
|
113
|
-
`;
|