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 { eslint } from 'rollup-plugin-eslint';
|
||||||
import json from 'rollup-plugin-json';
|
import json from 'rollup-plugin-json';
|
||||||
import multiEntry from 'rollup-plugin-multi-entry';
|
import multiEntry from 'rollup-plugin-multi-entry';
|
||||||
import builtins from 'rollup-plugin-node-builtins';
|
|
||||||
import globals from 'rollup-plugin-node-globals';
|
import globals from 'rollup-plugin-node-globals';
|
||||||
import resolve from 'rollup-plugin-node-resolve';
|
import resolve from 'rollup-plugin-node-resolve';
|
||||||
import replace from 'rollup-plugin-replace';
|
import replace from 'rollup-plugin-replace';
|
||||||
|
@ -43,6 +42,10 @@ const bundle = {
|
||||||
return 'vendor';
|
return 'vendor';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (id.includes(process.env['HOME'])) {
|
||||||
|
return 'linked';
|
||||||
|
}
|
||||||
|
|
||||||
/* if (id.includes(`chai`) || id.includes(`sinon`)) {
|
/* if (id.includes(`chai`) || id.includes(`sinon`)) {
|
||||||
return 'test';
|
return 'test';
|
||||||
} */
|
} */
|
||||||
|
@ -73,7 +76,9 @@ const bundle = {
|
||||||
dir: targetPath,
|
dir: targetPath,
|
||||||
chunkFileNames: '[name].js',
|
chunkFileNames: '[name].js',
|
||||||
entryFileNames: 'entry-[name].js',
|
entryFileNames: 'entry-[name].js',
|
||||||
|
exports: 'named',
|
||||||
format: 'module',
|
format: 'module',
|
||||||
|
minifyInternalExports: false,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
## includeSchema variable
|
## includeSchema variable
|
||||||
|
|
||||||
|
The schema to be used for included files. This is necessary to work around circular dependency errors.
|
||||||
|
|
||||||
<b>Signature:</b>
|
<b>Signature:</b>
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [CONFIG\_SCHEMA](./js-yaml-schema.config_schema.md) | |
|
| [CONFIG\_SCHEMA](./js-yaml-schema.config_schema.md) | |
|
||||||
| [envType](./js-yaml-schema.envtype.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) | |
|
| [includeType](./js-yaml-schema.includetype.md) | |
|
||||||
| [regexpType](./js-yaml-schema.regexptype.md) | |
|
| [regexpType](./js-yaml-schema.regexptype.md) | |
|
||||||
| [streamType](./js-yaml-schema.streamtype.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 { CONFIG_SCHEMA } from './schema';
|
||||||
export { envType } from './type/Env';
|
export { envType } from './type/Env';
|
||||||
export { includeSchema, includeType } from './type/Include';
|
export { includeSchema, includeType } from './type/Include';
|
||||||
export { regexpType } from './type/Regexp';
|
export { regexpType } from './type/Regexp';
|
||||||
export { streamType } from './type/Stream';
|
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 { SAFE_SCHEMA, safeLoad, Type as YamlType } from 'js-yaml';
|
||||||
import { join } from 'path';
|
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 = {
|
export const includeSchema = {
|
||||||
schema: SAFE_SCHEMA,
|
schema: SAFE_SCHEMA,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue