@tixyel/cli 2.0.0 → 2.0.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/README.md CHANGED
@@ -1,31 +1,31 @@
1
- # @tixyel/cli
2
-
3
- CLI tool for Tixyel widgets.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install -g @tixyel/cli
9
- ```
10
-
11
- ## Usage
12
-
13
- ```bash
14
- tixyel --help
15
- ```
16
-
17
- ## Development
18
-
19
- ```bash
20
- npm run dev
21
- ```
22
-
23
- ## Build
24
-
25
- ```bash
26
- npm run build
27
- ```
28
-
29
- ## License
30
-
31
- Apache-2.0
1
+ # @tixyel/cli
2
+
3
+ CLI tool for Tixyel widgets.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @tixyel/cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ tixyel --help
15
+ ```
16
+
17
+ ## Development
18
+
19
+ ```bash
20
+ npm run dev
21
+ ```
22
+
23
+ ## Build
24
+
25
+ ```bash
26
+ npm run build
27
+ ```
28
+
29
+ ## License
30
+
31
+ Apache-2.0
@@ -1,111 +1,111 @@
1
- export const workspace_config = `
2
- import { defineWorkspaceConfig } from '@tixyel/cli';
3
-
4
- export default defineWorkspaceConfig({
5
- search: {
6
- maxDepth: 3,
7
- ignore: ['node_modules', 'dist', 'build', '.git'],
8
- },
9
-
10
- metadata: {
11
- author: 'Your Name',
12
- clientId: 'your-client-id',
13
- },
14
-
15
- scaffold: [
16
- {
17
- name: 'development',
18
- type: 'folder',
19
- content: [
20
- {
21
- name: 'index.html',
22
- type: 'file',
23
- content: \`\`,
24
- },
25
- {
26
- name: 'style.css',
27
- type: 'file',
28
- content: \`\`,
29
- },
30
- {
31
- name: 'script.js',
32
- type: 'file',
33
- content: \`\`,
34
- },
35
- {
36
- name: 'fields.json',
37
- type: 'file',
38
- content: '{}',
39
- },
40
- {
41
- name: 'data.json',
42
- type: 'file',
43
- content: '{}',
44
- },
45
- ],
46
- },
47
- {
48
- name: 'finished',
49
- type: 'folder',
50
- },
51
- {
52
- name: 'widgetIO',
53
- type: 'folder',
54
- },
55
- ],
56
-
57
- build: {
58
- parallel: true,
59
- verbose: false,
60
-
61
- find: {
62
- html: ['index.html'],
63
- script: ['script.js'],
64
- css: ['style.css'],
65
- fields: ['fields.json', 'fields.jsonc'],
66
- },
67
- result: {
68
- 'HTML.html': 'html',
69
- 'SCRIPT.js': 'script',
70
- 'CSS.css': 'css',
71
- 'FIELDS.json': 'fields',
72
- },
73
- widgetIO: {
74
- 'html.txt': 'html',
75
- 'js.txt': 'script',
76
- 'css.txt': 'css',
77
- 'fields.txt': 'fields',
78
- },
79
-
80
- obfuscation: {
81
- javascript: {
82
- compact: true,
83
- log: false,
84
- debugProtection: false,
85
- selfDefending: false,
86
- deadCodeInjection: false,
87
- controlFlowFlattening: false,
88
- stringArray: false,
89
- simplify: false,
90
- identifierNamesGenerator: 'mangled',
91
- },
92
- css: {
93
- removeNesting: true,
94
- autoprefixer: {
95
- overrideBrowserslist: ['Chrome 127'],
96
- },
97
- cssnano: {
98
- preset: 'default',
99
- },
100
- },
101
- html: {
102
- removeComments: true,
103
- collapseWhitespace: true,
104
- minifyCSS: true,
105
- minifyJS: true,
106
- removeAttributeQuotes: false,
107
- },
108
- },
109
- },
110
- });
1
+ export const workspace_config = `
2
+ import { defineWorkspaceConfig } from '@tixyel/cli';
3
+
4
+ export default defineWorkspaceConfig({
5
+ search: {
6
+ maxDepth: 3,
7
+ ignore: ['node_modules', 'dist', 'build', '.git'],
8
+ },
9
+
10
+ metadata: {
11
+ author: 'Your Name',
12
+ clientId: 'your-client-id',
13
+ },
14
+
15
+ scaffold: [
16
+ {
17
+ name: 'development',
18
+ type: 'folder',
19
+ content: [
20
+ {
21
+ name: 'index.html',
22
+ type: 'file',
23
+ content: \`\`,
24
+ },
25
+ {
26
+ name: 'style.css',
27
+ type: 'file',
28
+ content: \`\`,
29
+ },
30
+ {
31
+ name: 'script.js',
32
+ type: 'file',
33
+ content: \`\`,
34
+ },
35
+ {
36
+ name: 'fields.json',
37
+ type: 'file',
38
+ content: '{}',
39
+ },
40
+ {
41
+ name: 'data.json',
42
+ type: 'file',
43
+ content: '{}',
44
+ },
45
+ ],
46
+ },
47
+ {
48
+ name: 'finished',
49
+ type: 'folder',
50
+ },
51
+ {
52
+ name: 'widgetIO',
53
+ type: 'folder',
54
+ },
55
+ ],
56
+
57
+ build: {
58
+ parallel: true,
59
+ verbose: false,
60
+
61
+ find: {
62
+ html: ['index.html'],
63
+ script: ['script.js'],
64
+ css: ['style.css'],
65
+ fields: ['fields.json', 'fields.jsonc'],
66
+ },
67
+ result: {
68
+ 'HTML.html': 'html',
69
+ 'SCRIPT.js': 'script',
70
+ 'CSS.css': 'css',
71
+ 'FIELDS.json': 'fields',
72
+ },
73
+ widgetIO: {
74
+ 'html.txt': 'html',
75
+ 'js.txt': 'script',
76
+ 'css.txt': 'css',
77
+ 'fields.txt': 'fields',
78
+ },
79
+
80
+ obfuscation: {
81
+ javascript: {
82
+ compact: true,
83
+ log: false,
84
+ debugProtection: false,
85
+ selfDefending: false,
86
+ deadCodeInjection: false,
87
+ controlFlowFlattening: false,
88
+ stringArray: false,
89
+ simplify: false,
90
+ identifierNamesGenerator: 'mangled',
91
+ },
92
+ css: {
93
+ removeNesting: true,
94
+ autoprefixer: {
95
+ overrideBrowserslist: ['Chrome 127'],
96
+ },
97
+ cssnano: {
98
+ preset: 'default',
99
+ },
100
+ },
101
+ html: {
102
+ removeComments: true,
103
+ collapseWhitespace: true,
104
+ minifyCSS: true,
105
+ minifyJS: true,
106
+ removeAttributeQuotes: false,
107
+ },
108
+ },
109
+ },
110
+ });
111
111
  `.trim();
package/dist/widget.js CHANGED
@@ -273,11 +273,11 @@ export async function processBuild(widget, workspaceConfig, verbose = false) {
273
273
  return contents;
274
274
  };
275
275
  // watermark for the files
276
- var ref = ` ____ _ _ _
277
- / __ \\ | |_ (_) __ __ _ _ ___ | |
278
- / / _\` | | __| | | \\ \\/ / | | | | / _ \\ | |
279
- | | (_| | | |_ | | > < | |_| | | __/ | |
280
- \\ \\__,_| \\__| |_| /_/\\_\\ \\__, | \\___| |_|
276
+ var ref = ` ____ _ _ _
277
+ / __ \\ | |_ (_) __ __ _ _ ___ | |
278
+ / / _\` | | __| | | \\ \\/ / | | | | / _ \\ | |
279
+ | | (_| | | |_ | | > < | |_| | | __/ | |
280
+ \\ \\__,_| \\__| |_| /_/\\_\\ \\__, | \\___| |_|
281
281
  \\____/ |___/\n`;
282
282
  var watermark = {
283
283
  html: [
package/package.json CHANGED
@@ -1,65 +1,71 @@
1
- {
2
- "name": "@tixyel/cli",
3
- "version": "2.0.0",
4
- "description": "CLI tool for streamelements widgets",
5
- "keywords": [
6
- "cli",
7
- "widgets",
8
- "typescript",
9
- "server",
10
- "build"
11
- ],
12
- "author": {
13
- "name": "Tixyel",
14
- "email": "tixyelpvd@gmail.com",
15
- "url": "https://github.com/tixyel"
16
- },
17
- "license": "Apache-2.0",
18
- "homepage": "https://github.com/Tixyel/widgets#readme",
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/Tixyel/widgets.git",
22
- "directory": "packages/cli"
23
- },
24
- "bugs": {
25
- "url": "https://github.com/Tixyel/widgets/issues"
26
- },
27
- "type": "module",
28
- "private": false,
29
- "bin": {
30
- "tixyel": "./dist/index.js"
31
- },
32
- "main": "./dist/index.js",
33
- "types": "./dist/index.d.ts",
34
- "exports": {
35
- ".": {
36
- "types": "./dist/index.d.ts",
37
- "import": "./dist/index.js",
38
- "default": "./dist/index.js"
39
- }
40
- },
41
- "files": [
42
- "dist",
43
- "package.json"
44
- ],
45
- "scripts": {
46
- "build": "cross-env TIXYEL_VERSION=$npm_package_version tsc",
47
- "dev": "cross-env TIXYEL_VERSION=$npm_package_version tsc --watch",
48
- "check-types": "tsc --noEmit"
49
- },
50
- "dependencies": {
51
- "autoprefixer": "^10.4.22",
52
- "commander": "^14.0.2",
53
- "cross-env": "^10.1.0",
54
- "cssnano": "^7.1.2",
55
- "fast-glob": "^3.3.3",
56
- "html-minifier-terser": "^7.2.0",
57
- "inquirer": "^13.0.2",
58
- "javascript-obfuscator": "^4.1.1",
59
- "jsonc-parser": "^3.3.1",
60
- "jszip": "^3.10.1"
61
- },
62
- "devDependencies": {
63
- "@types/inquirer": "^9.0.9"
64
- }
65
- }
1
+ {
2
+ "name": "@tixyel/cli",
3
+ "version": "2.0.2",
4
+ "description": "CLI tool for streamelements widgets",
5
+ "keywords": [
6
+ "cli",
7
+ "widgets",
8
+ "typescript",
9
+ "server",
10
+ "build"
11
+ ],
12
+ "author": {
13
+ "name": "Tixyel",
14
+ "email": "tixyelpvd@gmail.com",
15
+ "url": "https://github.com/tixyel"
16
+ },
17
+ "license": "Apache-2.0",
18
+ "homepage": "https://github.com/Tixyel/widgets#readme",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/Tixyel/widgets.git",
22
+ "directory": "packages/cli"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/Tixyel/widgets/issues"
26
+ },
27
+ "type": "module",
28
+ "private": false,
29
+ "bin": {
30
+ "tixyel": "./dist/index.js"
31
+ },
32
+ "main": "./dist/index.js",
33
+ "types": "./dist/index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js",
38
+ "default": "./dist/index.js"
39
+ }
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "package.json"
44
+ ],
45
+ "scripts": {
46
+ "build": "cross-env TIXYEL_VERSION=$npm_package_version tsc",
47
+ "dev": "cross-env TIXYEL_VERSION=$npm_package_version tsc --watch",
48
+ "check-types": "tsc --noEmit"
49
+ },
50
+ "dependencies": {
51
+ "autoprefixer": "^10.4.22",
52
+ "commander": "^14.0.2",
53
+ "cross-env": "^10.1.0",
54
+ "cssnano": "^7.1.2",
55
+ "esbuild": "^0.25.12",
56
+ "fast-glob": "^3.3.3",
57
+ "html-minifier": "^4.0.0",
58
+ "html-minifier-terser": "^7.2.0",
59
+ "inquirer": "^13.0.2",
60
+ "javascript-obfuscator": "^4.1.1",
61
+ "jsonc-parser": "^3.3.1",
62
+ "jszip": "^3.10.1",
63
+ "postcss": "^8.5.6",
64
+ "postcss-nested": "^7.0.2"
65
+ },
66
+ "devDependencies": {
67
+ "@types/html-minifier": "^4.0.6",
68
+ "@types/html-minifier-terser": "^7.0.2",
69
+ "@types/inquirer": "^9.0.9"
70
+ }
71
+ }
package/dist/dev.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { WidgetInfo } from './widget';
2
- export declare function devServer(widget: WidgetInfo, port?: number): Promise<void>;
package/dist/dev.js DELETED
@@ -1 +0,0 @@
1
- export async function devServer(widget, port = 3666) { }
@@ -1 +0,0 @@
1
- export declare const workspace_config = "\nimport type { TixyelCliConfig } from '@tixyel/cli';\n\n/**\n * Tixyel workspace configuration\n */\nconst config: TixyelCliConfig = {\n \n};\n\nexport default config;\n";
@@ -1,12 +0,0 @@
1
- export const workspace_config = `
2
- import type { TixyelCliConfig } from '@tixyel/cli';
3
-
4
- /**
5
- * Tixyel workspace configuration
6
- */
7
- const config: TixyelCliConfig = {
8
-
9
- };
10
-
11
- export default config;
12
- `;
@@ -1,47 +0,0 @@
1
- import type autoprefixer from 'autoprefixer';
2
- import type cssnanoPlugin from 'cssnano';
3
- import type { ObfuscatorOptions } from 'javascript-obfuscator';
4
- import type { Options as HtmlMinifierOptions } from 'html-minifier-terser';
5
- export type ScaffoldItem = ScaffoldFile | ScaffoldFolder;
6
- export interface ScaffoldFile {
7
- name: string;
8
- type: 'file';
9
- content: string;
10
- }
11
- export interface ScaffoldFolder {
12
- name: string;
13
- type: 'folder';
14
- content?: ScaffoldItem[];
15
- }
16
- export interface WorkspaceConfig<Find extends BuildFindMap = BuildFindMap> {
17
- search?: {
18
- maxDepth?: number;
19
- ignore?: string[];
20
- };
21
- metadata?: {
22
- author?: string;
23
- clientId?: string;
24
- [key: string]: unknown;
25
- };
26
- scaffold?: ScaffoldItem[];
27
- build?: {
28
- parallel?: boolean;
29
- verbose?: boolean;
30
- find?: Find;
31
- result?: BuildResultMap<Find>;
32
- widgetIO?: BuildResultMap<Find>;
33
- obfuscation?: {
34
- javascript?: ObfuscatorOptions;
35
- css?: {
36
- removeNesting?: boolean;
37
- autoprefixer?: autoprefixer.Options;
38
- cssnano?: cssnanoPlugin.Options;
39
- };
40
- html?: HtmlMinifierOptions;
41
- };
42
- };
43
- }
44
- type BuildFindMap = Record<string, string[]>;
45
- type BuildResultMap<Find extends BuildFindMap> = Record<string, keyof Find>;
46
- export declare function defineWorkspaceConfig<const Find extends BuildFindMap>(config: WorkspaceConfig<Find>): WorkspaceConfig<Find>;
47
- export {};
@@ -1,4 +0,0 @@
1
- // Helper to preserve literal keys for autocomplete in find/result
2
- export function defineWorkspaceConfig(config) {
3
- return config;
4
- }