bigtest
bigtest copied to clipboard
typescript errors about missing tsconfig.json are printed to the console in non-typescript projects
When integrating the bigtest runner into the stripes-components project, the bundler threw this error out to the console:
rpt2: config error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'.
The project is in vanilla javascript and not typescript, so that's probably related. However, even though it prints this error, the tests to run properly.
Here is the full project.https://github.com/cowboyd/stripes-components/tree/integrate-bigtest
There is no error ;)
@jnicklas 😹 ok, thanks for that.... comment updated.
it is an error coming from the rollup-plugin-typescript2
which is why it is prefixed with rpt2
.
It is because there is no tsconfig.json and nowhere in the rollup config do we specify include
or exclude
fields that tsc uses to know where to look for or avoid typescript files.
I think we need to update our defaults to:
export declare function defaultTSConfig(): {
compilerOptions: {
skipLibCheck: boolean;
target: string;
lib: string[];
include: [
"nowhere/**/*.ts",
],
};
};
@dagda1 That seems to change it to:
rpt2: config error TS18003: No inputs were found in config file 'tsconfig.json'. Specified 'include' paths were '["nowhere/**/*.ts"]' and 'exclude' paths were '[]'.
@cowboyd oh right so the error is that it cannot find any typescript files.
I wanted to avoid us deciding if it is a typescript or javascript project
stdout or stderr from here.
a couple of things we could do is:
const isTypescript = fs.existsSync(process.cwd(), 'tsconfig.json);
Not sure if we can guarantee that but might be fine
The error message is just a console.something and not an actual error so we could suppress it somehow.
if it is typescript, we either disable the plugin or do not add it to the plugins array
Whether or not tsconfig is present is a known propert of BigTest.json so theoretically this is possible
@jnicklas @dagda1 I went down the same rabbit hole to try and get rid of the warning. I see that the orchestrator
invokes createManifestBuilder
:
yield fork(createManifestServer({
atom: options.atom,
dir: manifestDistDir,
port: options.project.manifest.port,
proxyPort: options.project.proxy.port,
}));
And the manifest-builder
creates the Bundler
:
export function* createManifestBuilder(options: ManifestBuilderOptions): Operation {
let bundlerSlice = options.atom.slice('bundler');
bundlerSlice.set({ type: 'UNBUNDLED' });
let bundler: Bundler = yield Bundler.create({
watch: options.watch,
entry: options.srcPath,
globalName: bigtestGlobals.manifestProperty,
outFile: path.join(options.buildDir, "manifest.js"),
tsconfig: options.tsconfig,
});
// ...
};
I don't understand at which point the options
object is modified to include tsconfig
.
Edit: Oh that's what #803 is for.
@minkimcello this is different than #803. this is when there are no typescript files, i.e it is a javascript project but the rollup tyoescript2 plugin is still included in the rollout plugins array.
no inputs means no files to transpile, it comes from tsc.
ideally we would not include that plug-in if we are dealing with javascript only but it is not entirely clear cut when it is.
I actually just opened #959, but it seems related to this.