Skip to content

Commit 63595bc

Browse files
authored
refactor(compiler): remove legacy compiler
1 parent 4b5db7b commit 63595bc

File tree

868 files changed

+10979
-28933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

868 files changed

+10979
-28933
lines changed

.prettierrc.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"jsxBracketSameLine": false,
5+
"jsxSingleQuote": false,
6+
"quoteProps": "consistent",
7+
"printWidth": 180,
8+
"semi": true,
9+
"singleQuote": true,
10+
"tabWidth": 2,
11+
"trailingComma": "all",
12+
"useTabs": false
13+
}

.vscode/launch.json

+4-89
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@
4141
"internalConsoleOptions": "neverOpen",
4242
"disableOptimisticBPs": true
4343
},
44-
{
45-
"type": "node",
46-
"request": "launch",
47-
"name": "Style Modes",
48-
"args": [
49-
"${workspaceFolder}/bin/stencil",
50-
"build",
51-
"--dev",
52-
"--next",
53-
"--max-workers=0",
54-
"--config",
55-
"${workspaceFolder}/test/style-modes/stencil.config.ts"
56-
],
57-
"protocol": "inspector"
58-
},
5944
{
6045
"type": "node",
6146
"request": "launch",
@@ -72,38 +57,6 @@
7257
],
7358
"protocol": "inspector"
7459
},
75-
{
76-
"type": "node",
77-
"request": "launch",
78-
"name": "Hello World NEXT",
79-
"args": [
80-
"${workspaceFolder}/bin/stencil",
81-
"build",
82-
"--next",
83-
"--dev",
84-
"--watch",
85-
"--serve",
86-
"--max-workers=0",
87-
"--config",
88-
"${workspaceFolder}/test/hello-world/stencil.config.ts"
89-
],
90-
"protocol": "inspector"
91-
},
92-
{
93-
"type": "node",
94-
"request": "launch",
95-
"name": "Hello World Prerender NEXT",
96-
"args": [
97-
"${workspaceFolder}/bin/stencil",
98-
"build",
99-
"--next",
100-
"--prerender",
101-
"--max-workers=0",
102-
"--config",
103-
"${workspaceFolder}/test/hello-world/stencil.config.ts"
104-
],
105-
"protocol": "inspector"
106-
},
10760
{
10861
"type": "node",
10962
"request": "launch",
@@ -116,12 +69,11 @@
11669
{
11770
"type": "node",
11871
"request": "launch",
119-
"name": "Hello VDom NEXT",
72+
"name": "Hello VDom",
12073
"args": [
12174
"${workspaceFolder}/bin/stencil",
12275
"build",
12376
"--watch",
124-
"--next",
12577
"--debug",
12678
"--dev",
12779
"--config",
@@ -147,11 +99,10 @@
14799
{
148100
"type": "node",
149101
"request": "launch",
150-
"name": "Ionic App NEXT",
102+
"name": "Ionic App",
151103
"args": [
152104
"${workspaceFolder}/bin/stencil",
153105
"build",
154-
"--next",
155106
"--dev",
156107
"--max-workers=0",
157108
"--config",
@@ -166,7 +117,6 @@
166117
"args": [
167118
"${workspaceFolder}/bin/stencil",
168119
"build",
169-
"--next",
170120
"--dev",
171121
"--prerender",
172122
"--max-workers=0",
@@ -182,8 +132,7 @@
182132
"args": [
183133
"${workspaceFolder}/bin/stencil",
184134
"build",
185-
"--dev",
186-
"--next",
135+
// "--dev",
187136
"--max-workers=0",
188137
"--config",
189138
"${workspaceFolder}/test/end-to-end/stencil.config.ts"
@@ -219,11 +168,10 @@
219168
{
220169
"type": "node",
221170
"request": "launch",
222-
"name": "Todo App NEXT",
171+
"name": "Todo App",
223172
"args": [
224173
"${workspaceFolder}/bin/stencil",
225174
"build",
226-
"--next",
227175
"--dev",
228176
"--watch",
229177
"--serve",
@@ -253,26 +201,10 @@
253201
"type": "node",
254202
"request": "launch",
255203
"name": "Stencil Site Prerender",
256-
"args": [
257-
"${workspaceFolder}/bin/stencil",
258-
"build",
259-
"--prerender",
260-
"--max-workers=1",
261-
"--debug",
262-
"--config",
263-
"${workspaceFolder}/../stencil-site/stencil.config.ts"
264-
],
265-
"protocol": "inspector"
266-
},
267-
{
268-
"type": "node",
269-
"request": "launch",
270-
"name": "Stencil Site Prerender NEXT",
271204
"args": [
272205
"${workspaceFolder}/bin/stencil",
273206
"build",
274207
"--max-workers=0",
275-
"--next",
276208
"--debug",
277209
"--config",
278210
"${workspaceFolder}/../stencil-site/stencil.config.ts"
@@ -303,7 +235,6 @@
303235
"build",
304236
"--max-workers=0",
305237
"--dev",
306-
"--next",
307238
"--config",
308239
"${workspaceFolder}/test/karma/stencil.config.ts"
309240
],
@@ -317,22 +248,6 @@
317248
"${workspaceFolder}/test/karma/test-prerender/prerender.js"
318249
],
319250
"protocol": "inspector"
320-
},
321-
{
322-
"type": "node",
323-
"request": "launch",
324-
"name": "Karma NEXT",
325-
"args": [
326-
"${workspaceFolder}/bin/stencil",
327-
"build",
328-
"--next",
329-
"--max-workers=0",
330-
"--watch",
331-
"--dev",
332-
"--config",
333-
"${workspaceFolder}/test/karma/stencil.config.ts"
334-
],
335-
"protocol": "inspector"
336251
}
337252
]
338253
}

bin/stencil

+9-18
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,13 @@ try {
1414
}
1515
} catch (e) {}
1616

17-
if (process.argv.indexOf('--legacy') === -1) {
18-
if (process.argv.indexOf('--next') > -1) {
19-
console.warn('\nThe next compiler is now the default and the --next flag is no longer needed.\n');
20-
}
21-
var cli = require('../cli/index.js');
22-
cli.run({
23-
process: process,
24-
logger: cli.createNodeLogger(process),
25-
sys: cli.createNodeSystem(process)
26-
});
27-
28-
} else {
29-
var cliLegacy = require('../cli/index_legacy.js');
30-
var nodeLegacy = require('../sys/node/index.js');
31-
var sysLegacy = new nodeLegacy.NodeSystem();
32-
var loggerLegacy = new nodeLegacy.NodeLogger();
33-
34-
cliLegacy.run(process, sysLegacy, loggerLegacy);
17+
if (process.argv.indexOf('--next') > -1) {
18+
console.warn('\nThe next compiler is now the default and the --next flag is no longer needed.\n');
3519
}
20+
21+
var cli = require('../cli/index.js');
22+
cli.run({
23+
process: process,
24+
logger: cli.createNodeLogger(process),
25+
sys: cli.createNodeSystem(process)
26+
});

jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ module.exports = {
55
"@app-globals": "<rootDir>/internal/app-globals/index.js",
66
"@platform": "<rootDir>/internal/testing/index.js",
77
"@runtime": "<rootDir>/internal/testing/index.js",
8-
"@stencil/core/compiler": "<rootDir>/compiler/index.js",
8+
"@stencil/core/cli": "<rootDir>/cli/index.js",
9+
"@stencil/core/compiler": "<rootDir>/compiler/stencil.js",
910
"@stencil/core/mock-doc": "<rootDir>/mock-doc/index.js",
1011
"@stencil/core/testing": "<rootDir>/testing/index.js",
1112
"@utils": "<rootDir>/src/utils"

package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"rollup.prod.ci": "rollup --config --config-prod --config-ci",
3636
"rollup.watch": "rollup --watch --config",
3737
"license": "node scripts --license",
38+
"prettier": "prettier --write \"./src/**/*.{ts,tsx}\"",
3839
"test": "jest",
3940
"test.analysis": "cd test && npm run build",
4041
"test.dist": "node scripts --validate-build",
@@ -111,6 +112,7 @@
111112
"path-browserify": "^1.0.0",
112113
"pixelmatch": "4.0.2",
113114
"postcss": "^7.0.27",
115+
"prettier": "^1.19.1",
114116
"prompts": "2.3.1",
115117
"puppeteer": "~2.1.1",
116118
"rollup": "1.32.0",

scripts/build.ts

+18-25
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { BuildOptions } from './utils/options';
22
import { cli } from './bundles/cli';
3-
import { cli_legacy } from './bundles/cli_legacy';
43
import { compiler } from './bundles/compiler';
5-
import { compiler_legacy } from './bundles/compiler_legacy';
64
import { createLicense } from './license';
75
import { devServer } from './bundles/dev-server';
86
import { emptyDir } from 'fs-extra';
@@ -11,12 +9,10 @@ import { mockDoc } from './bundles/mock-doc';
119
import { release } from './release';
1210
import { screenshot } from './bundles/screenshot';
1311
import { sysNode } from './bundles/sys-node';
14-
import { sysNode_legacy } from './bundles/sys-node_legacy';
1512
import { testing } from './bundles/testing';
1613
import { validateBuild } from './test/validate-build';
1714
import { RollupOptions, rollup } from 'rollup';
1815

19-
2016
export async function run(rootDir: string, args: string[]) {
2117
try {
2218
if (args.includes('--release')) {
@@ -30,16 +26,13 @@ export async function run(rootDir: string, args: string[]) {
3026
if (args.includes('--validate-build')) {
3127
validateBuild(rootDir);
3228
}
33-
3429
} catch (e) {
3530
console.error(e);
3631
process.exit(1);
3732
}
3833
}
3934

40-
4135
export async function createBuild(opts: BuildOptions) {
42-
4336
await Promise.all([
4437
emptyDir(opts.output.cliDir),
4538
emptyDir(opts.output.compilerDir),
@@ -53,15 +46,13 @@ export async function createBuild(opts: BuildOptions) {
5346
await sysNode(opts);
5447

5548
const bundles = await Promise.all([
49+
//
5650
cli(opts),
57-
cli_legacy(opts),
5851
compiler(opts),
59-
compiler_legacy(opts),
6052
devServer(opts),
6153
internal(opts),
6254
mockDoc(opts),
6355
screenshot(opts),
64-
sysNode_legacy(opts),
6556
testing(opts),
6657
]);
6758

@@ -71,22 +62,24 @@ export async function createBuild(opts: BuildOptions) {
7162
}, [] as RollupOptions[]);
7263
}
7364

74-
7565
export async function bundleBuild(opts: BuildOptions) {
7666
const bundles = await createBuild(opts);
7767

78-
await Promise.all(bundles.map(async rollupOption => {
79-
80-
rollupOption.onwarn = () => {};
81-
82-
const bundle = await rollup(rollupOption);
83-
84-
if (Array.isArray(rollupOption.output)) {
85-
await Promise.all(rollupOption.output.map(async output => {
86-
await bundle.write(output);
87-
}));
88-
} else {
89-
await bundle.write(rollupOption.output);
90-
}
91-
}));
68+
await Promise.all(
69+
bundles.map(async rollupOption => {
70+
rollupOption.onwarn = () => {};
71+
72+
const bundle = await rollup(rollupOption);
73+
74+
if (Array.isArray(rollupOption.output)) {
75+
await Promise.all(
76+
rollupOption.output.map(async output => {
77+
await bundle.write(output);
78+
}),
79+
);
80+
} else {
81+
await bundle.write(rollupOption.output);
82+
}
83+
}),
84+
);
9285
}

0 commit comments

Comments
 (0)