This commit is contained in:
parent
911f8d600a
commit
1ea09adaa3
@ -323,6 +323,6 @@ function expectTargetsToBeCorrect(tree: Tree, projectRoot: string) {
|
||||
expect(targets.start.command).toEqual('remix-serve build/index.js');
|
||||
expect(targets.start.options.cwd).toEqual(projectRoot);
|
||||
expect(targets.typecheck).toBeTruthy();
|
||||
expect(targets.typecheck.command).toEqual('tsc');
|
||||
expect(targets.typecheck.command).toEqual('tsc --project tsconfig.app.json');
|
||||
expect(targets.typecheck.options.cwd).toEqual(projectRoot);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ export default async function (tree: Tree, _options: NxRemixGeneratorSchema) {
|
||||
},
|
||||
},
|
||||
typecheck: {
|
||||
command: `tsc`,
|
||||
command: `tsc --project tsconfig.app.json`,
|
||||
options: {
|
||||
cwd: options.projectRoot,
|
||||
},
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": [
|
||||
"remix.env.d.ts",
|
||||
"app/**/*.ts",
|
||||
"app/**/*.tsx",
|
||||
"app/**/*.js",
|
||||
"app/**/*.jsx"
|
||||
],
|
||||
"exclude": [
|
||||
"tests/**/*.spec.ts",
|
||||
"tests/**/*.test.ts",
|
||||
"tests/**/*.spec.tsx",
|
||||
"tests/**/*.test.tsx",
|
||||
"tests/**/*.spec.js",
|
||||
"tests/**/*.test.js",
|
||||
"tests/**/*.spec.jsx",
|
||||
"tests/**/*.test.jsx"
|
||||
]
|
||||
}
|
||||
@ -1,18 +1,24 @@
|
||||
{
|
||||
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
||||
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"jsx": "react-jsx",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"target": "ES2019",
|
||||
"strict": true,
|
||||
"allowJs": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
// Remix takes care of building everything in `remix build`.
|
||||
"noEmit": true
|
||||
}
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"jsx": "react-jsx",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"target": "ES2019",
|
||||
"strict": true,
|
||||
"allowJs": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
// Remix takes care of building everything in `remix build`.
|
||||
"noEmit": true
|
||||
},
|
||||
"include": [],
|
||||
"files": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ import {
|
||||
joinPathFragments,
|
||||
stripIndents,
|
||||
type Tree,
|
||||
updateJson,
|
||||
workspaceRoot,
|
||||
} from '@nx/devkit';
|
||||
import {
|
||||
@ -56,6 +57,32 @@ export function updateUnitTestConfig(
|
||||
);
|
||||
}
|
||||
|
||||
const pathToTsConfigSpec = joinPathFragments(
|
||||
pathToRoot,
|
||||
`tsconfig.spec.json`
|
||||
);
|
||||
|
||||
updateJson(tree, pathToTsConfigSpec, (json) => {
|
||||
json.includes = [
|
||||
'vite.config.ts',
|
||||
'vitest.config.ts',
|
||||
'app/**/*.ts',
|
||||
'app/**/*.tsx',
|
||||
'app/**/*.js',
|
||||
'app/**/*.jsx',
|
||||
'tests/**/*.spec.ts',
|
||||
'tests/**/*.test.ts',
|
||||
'tests/**/*.spec.tsx',
|
||||
'tests/**/*.test.tsx',
|
||||
'tests/**/*.spec.js',
|
||||
'tests/**/*.test.js',
|
||||
'tests/**/*.spec.jsx',
|
||||
'tests/**/*.test.jsx',
|
||||
];
|
||||
|
||||
return json;
|
||||
});
|
||||
|
||||
return addDependenciesToPackageJson(
|
||||
tree,
|
||||
{},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user