@steambrew/ttc 1.2.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/index.ts CHANGED
@@ -1,65 +1,60 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * this component serves as:
5
- * - typescript transpiler
6
- * - rollup configurator
7
- */
8
- import { BuildType, ValidateParameters } from "./Parameters"
9
- import { CheckForUpdates } from "./VersionMon"
10
- import { ValidatePlugin } from './Linter'
11
- import { TranspilerPluginComponent, TranspilerProps } from './Compiler'
12
- import { performance } from 'perf_hooks';
13
- import { Logger } from "./Logger";
14
- // import { Logger } from './Logger'
15
-
16
- declare global {
17
- var PerfStartTime: number;
18
- }
19
-
20
- const CheckModuleUpdates = async () => {
21
- return await CheckForUpdates()
22
- }
23
-
24
- const StartCompilerModule = () => {
25
-
26
- const parameters = ValidateParameters( process.argv.slice(2) );
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
- })
34
-
35
- ValidatePlugin(parameters.targetPlugin).then((json: any) => {
36
-
37
- const props: TranspilerProps = {
38
- bTersePlugin: bTersePlugin,
39
- strPluginInternalName: json?.name
40
- }
41
-
42
- TranspilerPluginComponent(props)
43
- })
44
-
45
- /**
46
- * plugin is invalid, we close the proccess as it has already been handled
47
- */
48
- .catch(() => {
49
- process.exit()
50
- })
51
- }
52
-
53
- const Initialize = () => {
54
- global.PerfStartTime = performance.now();
55
-
56
- // Check for --no-update flag
57
- if (process.argv.includes("--no-update")) {
58
- StartCompilerModule()
59
- return
60
- }
61
-
62
- CheckModuleUpdates().then(StartCompilerModule)
63
- }
64
-
65
- Initialize();
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * this component serves as:
5
+ * - typescript transpiler
6
+ * - rollup configurator
7
+ */
8
+ import { BuildType, ValidateParameters } from './Parameters';
9
+ import { CheckForUpdates } from './VersionMon';
10
+ import { ValidatePlugin } from './Linter';
11
+ import { TranspilerPluginComponent, TranspilerProps } from './Compiler';
12
+ import { performance } from 'perf_hooks';
13
+ import chalk from 'chalk';
14
+ // import { Logger } from './Logger'
15
+
16
+ declare global {
17
+ var PerfStartTime: number;
18
+ }
19
+
20
+ const CheckModuleUpdates = async () => {
21
+ return await CheckForUpdates();
22
+ };
23
+
24
+ const StartCompilerModule = () => {
25
+ const parameters = ValidateParameters(process.argv.slice(2));
26
+ const bTersePlugin = parameters.type == BuildType.ProdBuild;
27
+
28
+ console.log(chalk.greenBright.bold('config'), 'Building target:', parameters.targetPlugin, 'with type:', BuildType[parameters.type], 'minify:', bTersePlugin, '...');
29
+
30
+ ValidatePlugin(parameters.targetPlugin)
31
+ .then((json: any) => {
32
+ const props: TranspilerProps = {
33
+ bTersePlugin: bTersePlugin,
34
+ strPluginInternalName: json?.name,
35
+ };
36
+
37
+ TranspilerPluginComponent(props);
38
+ })
39
+
40
+ /**
41
+ * plugin is invalid, we close the proccess as it has already been handled
42
+ */
43
+ .catch(() => {
44
+ process.exit();
45
+ });
46
+ };
47
+
48
+ const Initialize = () => {
49
+ global.PerfStartTime = performance.now();
50
+
51
+ // Check for --no-update flag
52
+ if (process.argv.includes('--no-update')) {
53
+ StartCompilerModule();
54
+ return;
55
+ }
56
+
57
+ CheckModuleUpdates().then(StartCompilerModule);
58
+ };
59
+
60
+ Initialize();
package/package.json CHANGED
@@ -1,40 +1,49 @@
1
- {
2
- "name": "@steambrew/ttc",
3
- "version": "1.2.2",
4
- "type": "module",
5
- "main": "dist/index.js",
6
- "module": "dist/index.js",
7
- "bin": {
8
- "millennium-ttc": "dist/index.js"
9
- },
10
- "scripts": {
11
- "build": "rollup -c"
12
- },
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
- "keywords": [],
17
- "author": "",
18
- "license": "ISC",
19
- "description": "A tiny typescript compiler for Millennium plugins.",
20
- "dependencies": {
21
- "@babel/preset-env": "^7.26.0",
22
- "@babel/preset-react": "^7.25.9",
23
- "@rollup/plugin-babel": "^6.0.4",
24
- "@rollup/plugin-commonjs": "^28.0.1",
25
- "@rollup/plugin-json": "^6.1.0",
26
- "@rollup/plugin-node-resolve": "^15.3.0",
27
- "@rollup/plugin-replace": "^6.0.1",
28
- "@rollup/plugin-terser": "^0.4.4",
29
- "@rollup/plugin-typescript": "^12.1.1",
30
- "chalk": "^5.3.0",
31
- "dotenv": "^16.4.7",
32
- "fs": "^0.0.1-security",
33
- "rollup": "^4.28.0",
34
- "rollup-plugin-inject-process-env": "^1.3.1",
35
- "tslib": "^2.8.1"
36
- },
37
- "devDependencies": {
38
- "@types/node": "^22.10.1"
39
- }
40
- }
1
+ {
2
+ "name": "@steambrew/ttc",
3
+ "version": "2.4.2",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "bin": {
8
+ "millennium-ttc": "dist/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "rollup -c",
12
+ "prepare": "npm run build"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "keywords": [],
18
+ "author": "",
19
+ "license": "ISC",
20
+ "description": "A tiny typescript compiler for Millennium plugins.",
21
+ "dependencies": {
22
+ "@babel/parser": "^7.27.0",
23
+ "@babel/preset-env": "^7.26.0",
24
+ "@babel/preset-react": "^7.25.9",
25
+ "@babel/preset-typescript": "^7.27.0",
26
+ "@babel/traverse": "^7.27.0",
27
+ "@rollup/plugin-babel": "^6.0.4",
28
+ "@rollup/plugin-commonjs": "^28.0.1",
29
+ "@rollup/plugin-json": "^6.1.0",
30
+ "@rollup/plugin-node-resolve": "^15.3.0",
31
+ "@rollup/plugin-replace": "^6.0.1",
32
+ "@rollup/plugin-terser": "^0.4.4",
33
+ "@rollup/plugin-typescript": "^12.1.1",
34
+ "@rollup/pluginutils": "^5.1.4",
35
+ "chalk": "^5.3.0",
36
+ "dotenv": "^16.4.7",
37
+ "fs": "^0.0.1-security",
38
+ "glob": "^11.0.2",
39
+ "magic-string": "^0.30.17",
40
+ "rollup": "^4.40.0",
41
+ "rollup-plugin-inject-process-env": "^1.3.1",
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"
48
+ }
49
+ }
package/rollup.config.js CHANGED
@@ -1,31 +1,34 @@
1
- import commonjs from '@rollup/plugin-commonjs';
2
- import typescript from '@rollup/plugin-typescript';
3
- import json from '@rollup/plugin-json';
4
-
5
- export default {
6
- input: 'index.ts',
7
- context: 'window',
8
- output: {
9
- file: 'dist/index.js'
10
- },
11
- plugins: [commonjs(), typescript(), json()],
12
- external: [
13
- "chalk",
14
- "path",
15
- "url",
16
- "fs/promises",
17
- "fs",
18
- "rollup",
19
- "@rollup/plugin-json",
20
- "@rollup/plugin-commonjs",
21
- "@rollup/plugin-replace",
22
- "@rollup/plugin-typescript",
23
- "@rollup/plugin-node-resolve",
24
- "rollup-plugin-import-css",
25
- "@rollup/plugin-terser",
26
- "@rollup/plugin-babel",
27
- "rollup-plugin-inject-process-env",
28
- "dotenv",
29
- "perf_hooks",
30
- ]
31
- };
1
+ import commonjs from '@rollup/plugin-commonjs';
2
+ import typescript from '@rollup/plugin-typescript';
3
+ import json from '@rollup/plugin-json';
4
+ import nodeResolve from '@rollup/plugin-node-resolve';
5
+
6
+ export default {
7
+ input: 'index.ts',
8
+ context: 'window',
9
+ output: {
10
+ file: 'dist/index.js',
11
+ },
12
+ plugins: [commonjs(), typescript(), json(), nodeResolve()],
13
+ external: [
14
+ 'chalk',
15
+ 'path',
16
+ 'url',
17
+ 'fs/promises',
18
+ 'fs',
19
+ 'rollup',
20
+ '@rollup/plugin-json',
21
+ '@rollup/plugin-commonjs',
22
+ '@rollup/plugin-replace',
23
+ '@rollup/plugin-typescript',
24
+ '@rollup/plugin-node-resolve',
25
+ 'rollup-plugin-import-css',
26
+ '@rollup/plugin-terser',
27
+ '@rollup/plugin-babel',
28
+ 'rollup-plugin-inject-process-env',
29
+ 'dotenv',
30
+ 'perf_hooks',
31
+ '@rollup/pluginutils',
32
+ 'magic-string',
33
+ ],
34
+ };
package/tsconfig.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "dist",
4
- "module": "ESNext",
5
- "target": "ES2020",
6
- "jsx": "react",
7
- "jsxFactory": "window.SP_REACT.createElement",
8
- "declaration": false,
9
- "moduleResolution": "node",
10
- "noUnusedLocals": true,
11
- "noUnusedParameters": true,
12
- "esModuleInterop": true,
13
- "noImplicitReturns": true,
14
- "noImplicitThis": true,
15
- "noImplicitAny": true,
16
- "strict": true,
17
- "ignoreDeprecations": "5.0",
18
- "allowSyntheticDefaultImports": true,
19
- "skipLibCheck": true
20
- },
21
- "include": ["./"],
22
- "exclude": ["node_modules"]
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "dist",
4
+ "module": "ESNext",
5
+ "target": "ES2020",
6
+ "jsx": "react",
7
+ "jsxFactory": "window.SP_REACT.createElement",
8
+ "declaration": false,
9
+ "moduleResolution": "node",
10
+ "noUnusedLocals": true,
11
+ "noUnusedParameters": true,
12
+ "esModuleInterop": true,
13
+ "noImplicitReturns": true,
14
+ "noImplicitThis": true,
15
+ "noImplicitAny": true,
16
+ "strict": true,
17
+ "ignoreDeprecations": "5.0",
18
+ "allowSyntheticDefaultImports": true,
19
+ "skipLibCheck": true
20
+ },
21
+ "include": ["./"],
22
+ "exclude": ["node_modules"]
23
+ }
24
24