@steambrew/ttc 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Compiler.ts +16 -4
- package/dist/index.js +21 -4
- package/index.ts +6 -0
- package/package.json +6 -3
- package/rollup.config.js +1 -0
package/Compiler.ts
CHANGED
|
@@ -5,6 +5,7 @@ import replace from '@rollup/plugin-replace';
|
|
|
5
5
|
import typescript from '@rollup/plugin-typescript';
|
|
6
6
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
7
7
|
import terser from '@rollup/plugin-terser';
|
|
8
|
+
import babel from '@rollup/plugin-babel';
|
|
8
9
|
|
|
9
10
|
import chalk from 'chalk'
|
|
10
11
|
import { Logger } from "./Logger";
|
|
@@ -111,7 +112,10 @@ function InsertWebkitMillennium(props: TranspilerProps)
|
|
|
111
112
|
function GetPluginComponents(props: TranspilerProps) {
|
|
112
113
|
const pluginList = [
|
|
113
114
|
InsertMillennium(props),
|
|
114
|
-
|
|
115
|
+
typescript({
|
|
116
|
+
tsconfig: `./${GetFrontEndDirectory()}/tsconfig.json`
|
|
117
|
+
}),
|
|
118
|
+
nodeResolve(), commonjs(), json(),
|
|
115
119
|
replace({
|
|
116
120
|
delimiters: ['', ''],
|
|
117
121
|
preventAssignment: true,
|
|
@@ -131,13 +135,21 @@ function GetPluginComponents(props: TranspilerProps) {
|
|
|
131
135
|
|
|
132
136
|
function GetWebkitPluginComponents(props: TranspilerProps) {
|
|
133
137
|
const pluginList = [
|
|
134
|
-
InsertWebkitMillennium(props),
|
|
138
|
+
InsertWebkitMillennium(props),
|
|
139
|
+
typescript({
|
|
140
|
+
tsconfig: './webkit/tsconfig.json'
|
|
141
|
+
}),
|
|
142
|
+
nodeResolve(), commonjs(), json(),
|
|
135
143
|
replace({
|
|
136
144
|
delimiters: ['', ''],
|
|
137
145
|
preventAssignment: true,
|
|
138
146
|
'Millennium.callServerMethod': `__call_server_method__`,
|
|
139
147
|
'webkit.callable': `__wrapped_callable__`,
|
|
140
148
|
}),
|
|
149
|
+
babel({
|
|
150
|
+
presets: ['@babel/preset-env', '@babel/preset-react'],
|
|
151
|
+
babelHelpers: 'bundled',
|
|
152
|
+
})
|
|
141
153
|
]
|
|
142
154
|
|
|
143
155
|
props.bTersePlugin && pluginList.push(terser())
|
|
@@ -182,7 +194,7 @@ export const TranspilerPluginComponent = async (props: TranspilerProps) => {
|
|
|
182
194
|
}
|
|
183
195
|
|
|
184
196
|
const webkitRollupConfig: RollupOptions = {
|
|
185
|
-
input: `./webkit/index.
|
|
197
|
+
input: `./webkit/index.tsx`,
|
|
186
198
|
plugins: GetWebkitPluginComponents(props),
|
|
187
199
|
context: 'window',
|
|
188
200
|
external: (id) => {
|
|
@@ -209,7 +221,7 @@ export const TranspilerPluginComponent = async (props: TranspilerProps) => {
|
|
|
209
221
|
try {
|
|
210
222
|
await (await rollup(frontendRollupConfig)).write(frontendRollupConfig.output as OutputOptions);
|
|
211
223
|
|
|
212
|
-
if (fs.existsSync(`./webkit/index.
|
|
224
|
+
if (fs.existsSync(`./webkit/index.tsx`)) {
|
|
213
225
|
Logger.Info("Compiling webkit module...")
|
|
214
226
|
await (await rollup(webkitRollupConfig)).write(webkitRollupConfig.output as OutputOptions);
|
|
215
227
|
}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import replace from '@rollup/plugin-replace';
|
|
|
11
11
|
import typescript from '@rollup/plugin-typescript';
|
|
12
12
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
13
13
|
import terser from '@rollup/plugin-terser';
|
|
14
|
+
import babel from '@rollup/plugin-babel';
|
|
14
15
|
import { performance as performance$1 } from 'perf_hooks';
|
|
15
16
|
|
|
16
17
|
const Logger = {
|
|
@@ -237,7 +238,10 @@ function InsertWebkitMillennium(props) {
|
|
|
237
238
|
function GetPluginComponents(props) {
|
|
238
239
|
const pluginList = [
|
|
239
240
|
InsertMillennium(props),
|
|
240
|
-
typescript(
|
|
241
|
+
typescript({
|
|
242
|
+
tsconfig: `./${GetFrontEndDirectory()}/tsconfig.json`
|
|
243
|
+
}),
|
|
244
|
+
nodeResolve(), commonjs(), json(),
|
|
241
245
|
replace({
|
|
242
246
|
delimiters: ['', ''],
|
|
243
247
|
preventAssignment: true,
|
|
@@ -255,13 +259,21 @@ function GetPluginComponents(props) {
|
|
|
255
259
|
}
|
|
256
260
|
function GetWebkitPluginComponents(props) {
|
|
257
261
|
const pluginList = [
|
|
258
|
-
InsertWebkitMillennium(props),
|
|
262
|
+
InsertWebkitMillennium(props),
|
|
263
|
+
typescript({
|
|
264
|
+
tsconfig: './webkit/tsconfig.json'
|
|
265
|
+
}),
|
|
266
|
+
nodeResolve(), commonjs(), json(),
|
|
259
267
|
replace({
|
|
260
268
|
delimiters: ['', ''],
|
|
261
269
|
preventAssignment: true,
|
|
262
270
|
'Millennium.callServerMethod': `__call_server_method__`,
|
|
263
271
|
'webkit.callable': `__wrapped_callable__`,
|
|
264
272
|
}),
|
|
273
|
+
babel({
|
|
274
|
+
presets: ['@babel/preset-env', '@babel/preset-react'],
|
|
275
|
+
babelHelpers: 'bundled',
|
|
276
|
+
})
|
|
265
277
|
];
|
|
266
278
|
props.bTersePlugin && pluginList.push(terser());
|
|
267
279
|
return pluginList;
|
|
@@ -300,7 +312,7 @@ const TranspilerPluginComponent = async (props) => {
|
|
|
300
312
|
}
|
|
301
313
|
};
|
|
302
314
|
const webkitRollupConfig = {
|
|
303
|
-
input: `./webkit/index.
|
|
315
|
+
input: `./webkit/index.tsx`,
|
|
304
316
|
plugins: GetWebkitPluginComponents(props),
|
|
305
317
|
context: 'window',
|
|
306
318
|
external: (id) => {
|
|
@@ -323,7 +335,7 @@ const TranspilerPluginComponent = async (props) => {
|
|
|
323
335
|
Logger.Info("Starting build; this may take a few moments...");
|
|
324
336
|
try {
|
|
325
337
|
await (await rollup(frontendRollupConfig)).write(frontendRollupConfig.output);
|
|
326
|
-
if (fs.existsSync(`./webkit/index.
|
|
338
|
+
if (fs.existsSync(`./webkit/index.tsx`)) {
|
|
327
339
|
Logger.Info("Compiling webkit module...");
|
|
328
340
|
await (await rollup(webkitRollupConfig)).write(webkitRollupConfig.output);
|
|
329
341
|
}
|
|
@@ -366,6 +378,11 @@ const StartCompilerModule = () => {
|
|
|
366
378
|
};
|
|
367
379
|
const Initialize = () => {
|
|
368
380
|
global.PerfStartTime = performance$1.now();
|
|
381
|
+
// Check for --no-update flag
|
|
382
|
+
if (process.argv.includes("--no-update")) {
|
|
383
|
+
StartCompilerModule();
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
369
386
|
CheckModuleUpdates().then((needsUpdate) => {
|
|
370
387
|
needsUpdate ? process.exit() : StartCompilerModule();
|
|
371
388
|
});
|
package/index.ts
CHANGED
|
@@ -52,6 +52,12 @@ const StartCompilerModule = () => {
|
|
|
52
52
|
const Initialize = () => {
|
|
53
53
|
global.PerfStartTime = performance.now();
|
|
54
54
|
|
|
55
|
+
// Check for --no-update flag
|
|
56
|
+
if (process.argv.includes("--no-update")) {
|
|
57
|
+
StartCompilerModule()
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
|
|
55
61
|
CheckModuleUpdates().then((needsUpdate: boolean) => {
|
|
56
62
|
needsUpdate ? process.exit() : StartCompilerModule()
|
|
57
63
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steambrew/ttc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -26,10 +26,13 @@
|
|
|
26
26
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
27
27
|
"chalk": "^5.3.0",
|
|
28
28
|
"fs": "^0.0.1-security",
|
|
29
|
-
"rollup": "^4.27.4",
|
|
30
29
|
"tslib": "^2.8.1"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@
|
|
32
|
+
"@babel/preset-env": "^7.26.0",
|
|
33
|
+
"@babel/preset-react": "^7.25.9",
|
|
34
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
35
|
+
"@types/node": "^22.10.1",
|
|
36
|
+
"rollup": "^4.28.0"
|
|
34
37
|
}
|
|
35
38
|
}
|