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.command).toEqual('remix-serve build/index.js');
|
||||||
expect(targets.start.options.cwd).toEqual(projectRoot);
|
expect(targets.start.options.cwd).toEqual(projectRoot);
|
||||||
expect(targets.typecheck).toBeTruthy();
|
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);
|
expect(targets.typecheck.options.cwd).toEqual(projectRoot);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export default async function (tree: Tree, _options: NxRemixGeneratorSchema) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
typecheck: {
|
typecheck: {
|
||||||
command: `tsc`,
|
command: `tsc --project tsconfig.app.json`,
|
||||||
options: {
|
options: {
|
||||||
cwd: options.projectRoot,
|
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,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
||||||
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
@ -14,5 +13,12 @@
|
|||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
// Remix takes care of building everything in `remix build`.
|
// Remix takes care of building everything in `remix build`.
|
||||||
"noEmit": true
|
"noEmit": true
|
||||||
|
},
|
||||||
|
"include": [],
|
||||||
|
"files": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.app.json"
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import {
|
|||||||
joinPathFragments,
|
joinPathFragments,
|
||||||
stripIndents,
|
stripIndents,
|
||||||
type Tree,
|
type Tree,
|
||||||
|
updateJson,
|
||||||
workspaceRoot,
|
workspaceRoot,
|
||||||
} from '@nx/devkit';
|
} from '@nx/devkit';
|
||||||
import {
|
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(
|
return addDependenciesToPackageJson(
|
||||||
tree,
|
tree,
|
||||||
{},
|
{},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user