Skip to content

Commit 5ad289c

Browse files
authored
Small code improvements/cleanup (#582)
Increase E2E tests timeout Don't cache node_modules on CI to avoid TS compilation bugs
1 parent 39513fd commit 5ad289c

File tree

9 files changed

+27
-99
lines changed

9 files changed

+27
-99
lines changed

.cirrus.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ container:
22
image: nikolaik/python-nodejs:python3.5-nodejs14-alpine
33

44
test_task:
5-
node_modules_cache:
6-
folder: node_modules
7-
fingerprint_script: cat yarn.lock
8-
populate_script: yarn install
5+
install_script: yarn install
96
build_script: yarn compile
107
test_script: yarn test

examples/__tests__/react-typescript.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { terminateDevServer } from '../../e2e-helpers/terminateDevServer';
99
const workPath = path.resolve(path.join(__dirname, '..'), 'react-typescript');
1010

1111
describe('example:react-typescript', () => {
12-
beforeAll(() => jest.setTimeout(1000 * 45));
12+
beforeAll(() => jest.setTimeout(1000 * 120));
1313

1414
it('start', async () => {
1515
const devServerPort = await getPort();

examples/__tests__/react.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { terminateDevServer } from '../../e2e-helpers/terminateDevServer';
99
const workPath = path.resolve(path.join(__dirname, '..'), 'react');
1010

1111
describe('example:react', () => {
12-
beforeAll(() => jest.setTimeout(1000 * 45));
12+
beforeAll(() => jest.setTimeout(1000 * 120));
1313

1414
it('start', async () => {
1515
const devServerPort = await getPort();

packages/core/src/Task.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,3 @@ export class Task<TOptions extends {}, _TArgs extends string[]> {
4242
return this._handler(args, options);
4343
}
4444
}
45-
46-
// replace with factory
47-
// const task = new Task('task-0')
48-
// .expectArguments(new StringRule().maxLength(1), new StringRule())
49-
// .expectOption('option-0', new StringRule())
50-
// .handle(([arg0], options) => {});
51-
52-
// task.run(['abc', 'ac'], { 'option-0': '123' });

packages/core/src/WorkSpace.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,4 @@ export class WorkSpace {
1313
};
1414

1515
public constructor(public readonly name: string) {}
16-
17-
// private readonly rootDepNode: DependencyNode = new DependencyNode('root');
18-
// private readonly beforeApplyMap: Map<string, Function> = new Map();
19-
20-
// public beforeApply<
21-
// T extends PluginConstructor,
22-
// TPlugin = T extends PluginConstructor<infer R> ? R : never
23-
// >(PluginClass: T, id: string, fnCallback: (plugin: TPlugin) => void): void {
24-
// const dependencyNode =
25-
// findRecursive(this.rootDepNode, PluginClass.name) ||
26-
// this.rootDepNode.addOrGetEdge(PluginClass.name);
27-
//
28-
// const callbackId = `${PluginClass.name}/${id}`;
29-
//
30-
// this.beforeApplyMap.set(callbackId, fnCallback);
31-
//
32-
// dependencyNode.addOrGetEdge(callbackId);
33-
//
34-
// return undefined;
35-
// }
3616
}

packages/core/src/graph/findRecursive.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/core/src/graph/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
export * from './DependencyNode';
22
export * from './resolve';
3-
export * from './findRecursive';
4-
export * from './traverseRecursive';

packages/core/src/graph/traverseRecursive.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/plugin-webpack-spa/src/WebpackSpaPlugin.ts

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -103,34 +103,32 @@ export class WebpackSpaPlugin<
103103
}
104104
])
105105
);
106-
107-
modifications.insertPlugin(
108-
new FriendlyErrorsPlugin({
109-
compilationSuccessInfo: {
110-
messages: [
111-
`Your application successfully built and available at ${paths.build
112-
.split(path.sep)
113-
.pop()} folder`
114-
]
115-
}
116-
})
117-
);
118-
} else {
119-
modifications.insertPlugin(
120-
new FriendlyErrorsPlugin({
121-
compilationSuccessInfo: {
122-
messages: [
123-
'Your application is available at http://localhost:8080'
124-
],
125-
notes: [
126-
'The development build is not optimized',
127-
'To create a production build, run `build` script'
128-
]
129-
}
130-
})
131-
);
132106
}
133107

108+
modifications.insertPlugin(
109+
isDev
110+
? new FriendlyErrorsPlugin({
111+
compilationSuccessInfo: {
112+
messages: [
113+
'Your application is available at http://localhost:8080'
114+
],
115+
notes: [
116+
'The development build is not optimized',
117+
'To create a production build, run `build` script'
118+
]
119+
}
120+
})
121+
: new FriendlyErrorsPlugin({
122+
compilationSuccessInfo: {
123+
messages: [
124+
`Your application successfully built and available at ${paths.build
125+
.split(path.sep)
126+
.pop()} folder`
127+
]
128+
}
129+
})
130+
);
131+
134132
modifications.insertPlugin(
135133
new HtmlWebpackPlugin({
136134
inject: true,

0 commit comments

Comments
 (0)