fix(test): remove problematic invocation of main from index
This commit is contained in:
parent
4165928a08
commit
3361099729
|
@ -3,7 +3,6 @@ import commonjs from 'rollup-plugin-commonjs';
|
|||
import { eslint } from 'rollup-plugin-eslint';
|
||||
import json from 'rollup-plugin-json';
|
||||
import multiEntry from 'rollup-plugin-multi-entry';
|
||||
import builtins from 'rollup-plugin-node-builtins';
|
||||
import globals from 'rollup-plugin-node-globals';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import replace from 'rollup-plugin-replace';
|
||||
|
@ -43,6 +42,10 @@ const bundle = {
|
|||
return 'vendor';
|
||||
}
|
||||
|
||||
if (id.includes(process.env['HOME'])) {
|
||||
return 'linked';
|
||||
}
|
||||
|
||||
/* if (id.includes(`chai`) || id.includes(`sinon`)) {
|
||||
return 'test';
|
||||
} */
|
||||
|
@ -73,7 +76,9 @@ const bundle = {
|
|||
dir: targetPath,
|
||||
chunkFileNames: '[name].js',
|
||||
entryFileNames: 'entry-[name].js',
|
||||
exports: 'named',
|
||||
format: 'module',
|
||||
minifyInternalExports: false,
|
||||
sourcemap: true,
|
||||
},
|
||||
plugins: [
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
## includeSchema variable
|
||||
|
||||
The schema to be used for included files. This is necessary to work around circular dependency errors.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
| --- | --- |
|
||||
| [CONFIG\_SCHEMA](./js-yaml-schema.config_schema.md) | |
|
||||
| [envType](./js-yaml-schema.envtype.md) | |
|
||||
| [includeSchema](./js-yaml-schema.includeschema.md) | |
|
||||
| [includeSchema](./js-yaml-schema.includeschema.md) | The schema to be used for included files. This is necessary to work around circular dependency errors. |
|
||||
| [includeType](./js-yaml-schema.includetype.md) | |
|
||||
| [regexpType](./js-yaml-schema.regexptype.md) | |
|
||||
| [streamType](./js-yaml-schema.streamtype.md) | |
|
||||
|
|
13
src/index.ts
13
src/index.ts
|
@ -1,18 +1,5 @@
|
|||
import { main } from './app';
|
||||
|
||||
export { CONFIG_SCHEMA } from './schema';
|
||||
export { envType } from './type/Env';
|
||||
export { includeSchema, includeType } from './type/Include';
|
||||
export { regexpType } from './type/Regexp';
|
||||
export { streamType } from './type/Stream';
|
||||
|
||||
const STATUS_ERROR = 1;
|
||||
|
||||
/**
|
||||
* This is the main entry-point to the program and the only file not included in the main bundle.
|
||||
*/
|
||||
main(process.argv).then((status) => process.exit(status)).catch((err: Error) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('uncaught error during main:', err);
|
||||
process.exit(STATUS_ERROR);
|
||||
});
|
||||
|
|
|
@ -3,7 +3,9 @@ import { existsSync, readFileSync, realpathSync } from 'fs';
|
|||
import { SAFE_SCHEMA, safeLoad, Type as YamlType } from 'js-yaml';
|
||||
import { join } from 'path';
|
||||
|
||||
// work around the circular dependency by setting the schema later
|
||||
/**
|
||||
* The schema to be used for included files. This is necessary to work around circular dependency errors.
|
||||
*/
|
||||
export const includeSchema = {
|
||||
schema: SAFE_SCHEMA,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue