@steambrew/ttc 1.4.2 → 2.4.2
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 +7 -8
- package/Logger.ts +44 -47
- package/PluginSetup.ts +0 -5
- package/StaticEmbed.ts +278 -0
- package/VersionMon.ts +18 -19
- package/dist/index.js +55465 -214
- package/index.ts +35 -40
- package/package.json +13 -2
- package/rollup.config.js +4 -1
package/index.ts
CHANGED
|
@@ -5,61 +5,56 @@
|
|
|
5
5
|
* - typescript transpiler
|
|
6
6
|
* - rollup configurator
|
|
7
7
|
*/
|
|
8
|
-
import { BuildType, ValidateParameters } from
|
|
9
|
-
import { CheckForUpdates } from
|
|
10
|
-
import { ValidatePlugin } from './Linter'
|
|
11
|
-
import { TranspilerPluginComponent, TranspilerProps } from './Compiler'
|
|
8
|
+
import { BuildType, ValidateParameters } from './Parameters';
|
|
9
|
+
import { CheckForUpdates } from './VersionMon';
|
|
10
|
+
import { ValidatePlugin } from './Linter';
|
|
11
|
+
import { TranspilerPluginComponent, TranspilerProps } from './Compiler';
|
|
12
12
|
import { performance } from 'perf_hooks';
|
|
13
|
-
import
|
|
13
|
+
import chalk from 'chalk';
|
|
14
14
|
// import { Logger } from './Logger'
|
|
15
15
|
|
|
16
16
|
declare global {
|
|
17
|
-
|
|
17
|
+
var PerfStartTime: number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const CheckModuleUpdates = async () => {
|
|
21
|
-
|
|
22
|
-
}
|
|
21
|
+
return await CheckForUpdates();
|
|
22
|
+
};
|
|
23
23
|
|
|
24
24
|
const StartCompilerModule = () => {
|
|
25
|
+
const parameters = ValidateParameters(process.argv.slice(2));
|
|
26
|
+
const bTersePlugin = parameters.type == BuildType.ProdBuild;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
const bTersePlugin = parameters.type == BuildType.ProdBuild
|
|
28
|
-
|
|
29
|
-
Logger.Tree("Transpiler config: ", {
|
|
30
|
-
target: parameters.targetPlugin,
|
|
31
|
-
build: BuildType[parameters.type],
|
|
32
|
-
minify: bTersePlugin
|
|
33
|
-
})
|
|
28
|
+
console.log(chalk.greenBright.bold('config'), 'Building target:', parameters.targetPlugin, 'with type:', BuildType[parameters.type], 'minify:', bTersePlugin, '...');
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
ValidatePlugin(parameters.targetPlugin)
|
|
31
|
+
.then((json: any) => {
|
|
32
|
+
const props: TranspilerProps = {
|
|
33
|
+
bTersePlugin: bTersePlugin,
|
|
34
|
+
strPluginInternalName: json?.name,
|
|
35
|
+
};
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
strPluginInternalName: json?.name
|
|
40
|
-
}
|
|
37
|
+
TranspilerPluginComponent(props);
|
|
38
|
+
})
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
process.exit()
|
|
50
|
-
})
|
|
51
|
-
}
|
|
40
|
+
/**
|
|
41
|
+
* plugin is invalid, we close the proccess as it has already been handled
|
|
42
|
+
*/
|
|
43
|
+
.catch(() => {
|
|
44
|
+
process.exit();
|
|
45
|
+
});
|
|
46
|
+
};
|
|
52
47
|
|
|
53
48
|
const Initialize = () => {
|
|
54
|
-
|
|
49
|
+
global.PerfStartTime = performance.now();
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
// Check for --no-update flag
|
|
52
|
+
if (process.argv.includes('--no-update')) {
|
|
53
|
+
StartCompilerModule();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
61
56
|
|
|
62
|
-
|
|
63
|
-
}
|
|
57
|
+
CheckModuleUpdates().then(StartCompilerModule);
|
|
58
|
+
};
|
|
64
59
|
|
|
65
|
-
Initialize();
|
|
60
|
+
Initialize();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steambrew/ttc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -19,8 +19,11 @@
|
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"description": "A tiny typescript compiler for Millennium plugins.",
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@babel/parser": "^7.27.0",
|
|
22
23
|
"@babel/preset-env": "^7.26.0",
|
|
23
24
|
"@babel/preset-react": "^7.25.9",
|
|
25
|
+
"@babel/preset-typescript": "^7.27.0",
|
|
26
|
+
"@babel/traverse": "^7.27.0",
|
|
24
27
|
"@rollup/plugin-babel": "^6.0.4",
|
|
25
28
|
"@rollup/plugin-commonjs": "^28.0.1",
|
|
26
29
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -28,11 +31,19 @@
|
|
|
28
31
|
"@rollup/plugin-replace": "^6.0.1",
|
|
29
32
|
"@rollup/plugin-terser": "^0.4.4",
|
|
30
33
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
34
|
+
"@rollup/pluginutils": "^5.1.4",
|
|
31
35
|
"chalk": "^5.3.0",
|
|
32
36
|
"dotenv": "^16.4.7",
|
|
33
37
|
"fs": "^0.0.1-security",
|
|
34
|
-
"
|
|
38
|
+
"glob": "^11.0.2",
|
|
39
|
+
"magic-string": "^0.30.17",
|
|
40
|
+
"rollup": "^4.40.0",
|
|
35
41
|
"rollup-plugin-inject-process-env": "^1.3.1",
|
|
36
42
|
"tslib": "^2.8.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/babel__traverse": "^7.20.7",
|
|
46
|
+
"@types/glob": "^8.1.0",
|
|
47
|
+
"@types/node": "^22.15.2"
|
|
37
48
|
}
|
|
38
49
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import commonjs from '@rollup/plugin-commonjs';
|
|
2
2
|
import typescript from '@rollup/plugin-typescript';
|
|
3
3
|
import json from '@rollup/plugin-json';
|
|
4
|
+
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
input: 'index.ts',
|
|
@@ -8,7 +9,7 @@ export default {
|
|
|
8
9
|
output: {
|
|
9
10
|
file: 'dist/index.js',
|
|
10
11
|
},
|
|
11
|
-
plugins: [commonjs(), typescript(), json()],
|
|
12
|
+
plugins: [commonjs(), typescript(), json(), nodeResolve()],
|
|
12
13
|
external: [
|
|
13
14
|
'chalk',
|
|
14
15
|
'path',
|
|
@@ -27,5 +28,7 @@ export default {
|
|
|
27
28
|
'rollup-plugin-inject-process-env',
|
|
28
29
|
'dotenv',
|
|
29
30
|
'perf_hooks',
|
|
31
|
+
'@rollup/pluginutils',
|
|
32
|
+
'magic-string',
|
|
30
33
|
],
|
|
31
34
|
};
|