uc-dev 1.0.0-beta.0

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.
Files changed (31) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +79 -0
  3. package/out/cli.js +8162 -0
  4. package/out/lib/processes/templates/js.tpt.code +7 -0
  5. package/out/lib/processes/templates/js.tpt.designer +101 -0
  6. package/out/lib/processes/templates/js.tpt.style +36 -0
  7. package/out/lib/processes/templates/js.uc.code +15 -0
  8. package/out/lib/processes/templates/js.uc.designer +103 -0
  9. package/out/lib/processes/templates/js.uc.style +5 -0
  10. package/out/lib/processes/templates/t.resources +26 -0
  11. package/out/lib/processes/templates/ts.resources +55 -0
  12. package/out/lib/processes/templates/ts.tpt.code +7 -0
  13. package/out/lib/processes/templates/ts.tpt.designer +77 -0
  14. package/out/lib/processes/templates/ts.tpt.dynamic +12 -0
  15. package/out/lib/processes/templates/ts.tpt.style +36 -0
  16. package/out/lib/processes/templates/ts.uc.code +10 -0
  17. package/out/lib/processes/templates/ts.uc.designer +89 -0
  18. package/out/lib/processes/templates/ts.uc.dynamic +12 -0
  19. package/out/lib/processes/templates/ts.uc.dynamicByHtml +16 -0
  20. package/out/lib/processes/templates/ts.uc.style +5 -0
  21. package/out/utils/inquiry/templates/.vscode/json.settings +17 -0
  22. package/out/utils/inquiry/templates/electron/html.renderer +11 -0
  23. package/out/utils/inquiry/templates/electron/sample1/form.uc.html.tp +54 -0
  24. package/out/utils/inquiry/templates/electron/sample1/form.uc.scss.tp +95 -0
  25. package/out/utils/inquiry/templates/electron/ts.main +44 -0
  26. package/out/utils/inquiry/templates/electron/ts.preload +3 -0
  27. package/out/utils/inquiry/templates/electron/ts.renderer +5 -0
  28. package/out/utils/inquiry/templates/electron/ts.resx +50 -0
  29. package/out/utils/inquiry/templates/js.ucconfig +108 -0
  30. package/out/utils/inquiry/templates/typescript/json.tsconfig +39 -0
  31. package/package.json +36 -0
@@ -0,0 +1,54 @@
1
+ <wrapper x-caption="Welcome to UC Builder">
2
+ <UCWINFRAME x-name="winFrame1" x-from="uc-control/controls/ucWinFrame.uc.html">
3
+ <div class="dashboard">
4
+
5
+ <header class="hero">
6
+ <h1>Welcome 👋</h1>
7
+ <p>Your UC project is ready. Start building something amazing.</p>
8
+ <button class="primary-btn">Create First Control</button>
9
+ </header>
10
+
11
+ <section class="stats">
12
+
13
+ <div class="card">
14
+ <h3>User Controls</h3>
15
+ <span class="value">0</span>
16
+ </div>
17
+
18
+ <div class="card">
19
+ <h3>Forms</h3>
20
+ <span class="value">1</span>
21
+ </div>
22
+
23
+ <div class="card">
24
+ <h3>Status</h3>
25
+ <span class="value success">Ready</span>
26
+ </div>
27
+
28
+ </section>
29
+
30
+ <section class="actions">
31
+
32
+ <div class="action-card">
33
+ <h3>Create Control</h3>
34
+ <p>Add reusable UI components.</p>
35
+ <button>New Control</button>
36
+ </div>
37
+
38
+ <div class="action-card">
39
+ <h3>Edit Layout</h3>
40
+ <p>Design your form visually.</p>
41
+ <button>Open Designer</button>
42
+ </div>
43
+
44
+ <div class="action-card">
45
+ <h3>Documentation</h3>
46
+ <p>Learn how UC Builder works.</p>
47
+ <button>View Docs</button>
48
+ </div>
49
+
50
+ </section>
51
+
52
+ </div>
53
+ </UCWINFRAME>
54
+ </wrapper>
@@ -0,0 +1,95 @@
1
+ & {
2
+ font-family: system-ui, sans-serif;
3
+ background: #f6f8fb;
4
+ color: #1f2933;
5
+ }
6
+
7
+ .dashboard {
8
+ padding: 24px;
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: 24px;
12
+ }
13
+
14
+ /* HERO */
15
+
16
+ .hero {
17
+ background: linear-gradient(135deg, #4f46e5, #6366f1);
18
+ color: white;
19
+ padding: 28px;
20
+ border-radius: 12px;
21
+ }
22
+
23
+ .hero h1 {
24
+ margin: 0 0 8px;
25
+ }
26
+
27
+ .primary-btn {
28
+ margin-top: 12px;
29
+ padding: 10px 16px;
30
+ border: none;
31
+ border-radius: 8px;
32
+ background: white;
33
+ color: #4f46e5;
34
+ font-weight: 600;
35
+ cursor: pointer;
36
+ }
37
+
38
+ /* STATS */
39
+
40
+ .stats {
41
+ display: grid;
42
+ grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
43
+ gap: 16px;
44
+ }
45
+
46
+ .card {
47
+ background: white;
48
+ padding: 18px;
49
+ border-radius: 10px;
50
+ box-shadow: 0 2px 6px rgba(0,0,0,0.05);
51
+ }
52
+
53
+ .card h3 {
54
+ margin: 0;
55
+ font-size: 14px;
56
+ color: #64748b;
57
+ }
58
+
59
+ .value {
60
+ font-size: 28px;
61
+ font-weight: bold;
62
+ }
63
+
64
+ .success {
65
+ color: #16a34a;
66
+ }
67
+
68
+ /* ACTIONS */
69
+
70
+ .actions {
71
+ display: grid;
72
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
73
+ gap: 16px;
74
+ }
75
+
76
+ .action-card {
77
+ background: white;
78
+ padding: 20px;
79
+ border-radius: 10px;
80
+ box-shadow: 0 2px 6px rgba(0,0,0,0.05);
81
+ }
82
+
83
+ .action-card h3 {
84
+ margin-top: 0;
85
+ }
86
+
87
+ .action-card button {
88
+ margin-top: 8px;
89
+ padding: 8px 14px;
90
+ border: none;
91
+ border-radius: 6px;
92
+ background: #4f46e5;
93
+ color: white;
94
+ cursor: pointer;
95
+ }
@@ -0,0 +1,44 @@
1
+ import { app, BrowserWindow, screen } from "electron";
2
+ import { IpcMainHelper } from "uc-control/core-main.js";
3
+ import { dirname, join, resolve } from "path";
4
+ import { fileURLToPath, pathToFileURL } from "url";
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ let win: Electron.BrowserWindow;
8
+ app.on('ready', async () => {
9
+ const mainScreen: Electron.Display = screen.getPrimaryDisplay();
10
+ await IpcMainHelper.init(import('<?= resourcePath ?>'));
11
+ win = new BrowserWindow({
12
+ width: mainScreen.size.width,
13
+ height: mainScreen.size.height,
14
+ titleBarStyle: 'hidden',
15
+ webPreferences: {
16
+ nodeIntegration: <?= nodeIntegration ?>,
17
+ contextIsolation: <?= contextIsolation ?>,
18
+ sandbox: false,
19
+ spellcheck: false,
20
+ webSecurity: true,
21
+ preload: join(__dirname, '<?= preloadPath ?>'),
22
+ },
23
+ });
24
+ <?php if(removeMenu===true){ ?>
25
+ win.setMenu(null);
26
+ <?php } ?>
27
+ try {
28
+
29
+ await IpcMainHelper.loadURL(pathToFileURL(join(__dirname, '<?= rendererHtmlPath ?>')).href, win, {
30
+ // in browser
31
+ // this will make resolve path from project root directory instead of loaded html file path
32
+ baseURLForDataURL: pathToFileURL(resolve(process.cwd(),'index.html')).href
33
+ });
34
+
35
+ win.show();
36
+ <?php if(devtools===true){ ?>
37
+ win.webContents.once('did-finish-load', () => {
38
+ win!.webContents.openDevTools(/*{ mode: 'detach' }*/);
39
+ });
40
+ <?php } ?>
41
+ } catch (ex) {
42
+ console.log(ex);
43
+ }
44
+ });
@@ -0,0 +1,3 @@
1
+ import { contextBridge, ipcRenderer } from "electron";
2
+ import { IpcPreload } from "uc-control/core-main.js";
3
+ IpcPreload.init(contextBridge, ipcRenderer);
@@ -0,0 +1,5 @@
1
+ import "uc-control/InitRenderer.js"; /// put this line at the top of the code
2
+
3
+ // START YOUR JOURNEY
4
+
5
+ <?= startUpCode ?>
@@ -0,0 +1,50 @@
1
+ import { app, BrowserWindow, screen } from "electron";
2
+ import { IpcMainHelper } from "uc-control/core-main.js";
3
+ import { dirname, join, resolve } from "path";
4
+ import { fileURLToPath, pathToFileURL } from "url";
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ let win: Electron.BrowserWindow;
8
+ app.on('ready', async () => {
9
+ const mainScreen: Electron.Display = screen.getPrimaryDisplay();
10
+ await IpcMainHelper.init(import('<?= resourcePath ?>'));
11
+ win = new BrowserWindow({
12
+ width: mainScreen.size.width,
13
+ height: mainScreen.size.height,
14
+ titleBarStyle: 'hidden',
15
+ webPreferences: {
16
+ nodeIntegration: <?= nodeIntegration ?>,
17
+ contextIsolation: <?= contextIsolation ?>,
18
+ sandbox: false,
19
+ spellcheck: false,
20
+ webSecurity: true,
21
+ preload: join(__dirname, '<?= preloadPath ?>'),
22
+ },
23
+ });
24
+ <?php if(removeMenu===true){ ?>
25
+ win.setMenu(null);
26
+ <?php } ?>
27
+ try {
28
+
29
+ IpcMainHelper.loadURL(pathToFileURL(join(__dirname, '<?= rendererHtmlPath ?>')).href, win, {
30
+ // in browser
31
+ // this will make resolve path from project root directory instead of loaded html file path
32
+ baseURLForDataURL: pathToFileURL(resolve(process.cwd(), 'index.html')).href
33
+ });
34
+
35
+ IpcMainHelper.loadURL(pathToFileURL(join(__dirname, '<?= rendererHtmlPath ?>')).href, win, {
36
+ // in browser
37
+ // this will make resolve path from project root directory instead of loaded html file path
38
+ baseURLForDataURL: pathToFileURL(resolve(process.cwd(), 'index.html')).href
39
+ });
40
+
41
+ win.show();
42
+ <?php if(devtools===true){ ?>
43
+ win.webContents.once('did-finish-load', () => {
44
+ win!.webContents.openDevTools(/*{ mode: 'detach' }*/);
45
+ });
46
+ <?php } ?>
47
+ } catch (ex) {
48
+ console.log(ex);
49
+ }
50
+ });
@@ -0,0 +1,108 @@
1
+ import { UcDefaultConfig } from "uc-control/core-main.js";
2
+ <?php
3
+ const $prf = preference;
4
+ const $build = $prf.build;
5
+ const $dirDec = $prf.dirDeclaration;
6
+ const $srcDec = $prf.srcDec;
7
+ const $outDec = $prf.outDec;
8
+ ?>
9
+ export default UcDefaultConfig({
10
+ useTypeScript:<?= useTypeScript ?>,
11
+ guid: "<?= guid ?>",
12
+ browser: {
13
+ resolveProjects: [ <?php browser.resolveProjects.forEach(v => {
14
+ ?> "<?= v ?>", <?php
15
+ }); ?> ],
16
+ importmap: {
17
+ <?php for(const [k,v] of Object.entries(browser.importmap)) { ?>
18
+ <?= JSON.stringify(k) ?>:<?= JSON.stringify(v) ?>
19
+ <?php } ?>
20
+ },
21
+ baseCssPath: "<?= browser.baseCssPath ?>",
22
+ baseHtmlPath:"<?= browser.baseHtmlPath ?>",
23
+ baseCodePath:"<?= browser.baseCodePath ?>",
24
+ },
25
+ projectBaseCssPath: "<?= projectBaseCssPath ?>",
26
+ preference: {
27
+ build: {
28
+ ResourceStorageFile: "<?= $build.ResourceStorageFile ?>",
29
+ ignorePath: [ <?php $build.ignorePath.forEach(v => {
30
+ ?> "<?= v ?>", <?php
31
+ }); ?> ],
32
+ RuntimeResources: [
33
+ {
34
+ includeExtensions: [ <?php $build.RuntimeResources[0].includeExtensions.forEach(v => {
35
+ ?> "<?= v ?>", <?php
36
+ }); ?> ],
37
+ fromDeclare: "<?= $srcDec ?>",
38
+ toDeclares: ["<?= $outDec ?>"]
39
+ }
40
+ ],
41
+ guidOptions: {
42
+ guidType: "<?= $build.guidOptions.guidType ?>",
43
+ sequencePadSize: <?= $build.guidOptions.sequencePadSize ?>,
44
+ }
45
+ },
46
+
47
+ dirDeclaration: {
48
+ <?= $srcDec ?>: {
49
+ /*
50
+ i.e
51
+ ./[src]/lib/file.uc.ts => ./src/lib/file.uc.ts
52
+ ./[]/lib/file.uc.html => ./lib/file.uc.html
53
+ */
54
+ dirPath: '<?= $dirDec[$srcDec].dirPath ?>',
55
+ /**
56
+ * i.e
57
+ * dirDeclaration.<?= $srcDec ?>.dirpath = 'src';
58
+ * dirDeclaration.<?= $srcDec ?>.fileDeclaration.subDirPath = 'designerFiles';
59
+ *
60
+ * ./[src]/[designerFiles]/lib/file.uc.designer.ts => ./src/designerFiles/lib/file.uc.designer.ts
61
+ * ./[src]/[]/lib/file.uc.ts => ./src/lib/file.uc.ts
62
+ *
63
+ * dirDeclaration.<?= $srcDec ?>.fileDeclaration.subDirPath = ''
64
+ * ./[src]/[]/lib/file.uc.ts => ./src/lib/file.uc.ts
65
+ *
66
+ * dirDeclaration.<?= $srcDec ?>.fileDeclaration.subDirPath = 'htmlFiles'
67
+ * ./[src]/[htmlFiles]/lib/file.uc.designer.ts => ./src/htmlFiles/lib/file.uc.designer.ts
68
+ *
69
+ * Same for <?= $outDec ?> declaration
70
+ */
71
+ fileDeclaration: <?php fileDec($dirDec[$srcDec].fileDeclaration) ?>
72
+ },
73
+ <?= $outDec ?>: {
74
+ /*
75
+ i.e
76
+ ./[out]/lib/file.uc.js => ./out/lib/file.uc.js
77
+ ./[]/lib/file.uc.html => ./lib/file.uc.html
78
+ */
79
+ dirPath: '<?= $dirDec[$outDec].dirPath ?>',
80
+ fileDeclaration: <?php fileDec($dirDec[$outDec].fileDeclaration) ?>
81
+ }
82
+ },
83
+ /**
84
+ * A common Declaration for all declarations specified in `dirDeclaration`
85
+ * (i.e <?= $srcDec ?>,<?= $outDec ?>)
86
+ */
87
+ fileCommonDeclaration: <?php fileDec($prf.fileCommonDeclaration) ?>,
88
+ /**
89
+ * specify dirDeclaration key for source
90
+ */
91
+ srcDec: "<?= $prf.srcDec ?>",
92
+ /**
93
+ * specify dirDeclaration key for output
94
+ */
95
+ outDec: "<?= $prf.outDec ?>"
96
+ },
97
+ });
98
+ <?php
99
+ function fileDec(dec) { ?> { <?php
100
+ for(const [k,v] of Object.entries(dec)){ ?>
101
+ <?= k ?> : <?php fileDecItem(v) ?>,
102
+ <?php }
103
+ ?> } <?php }
104
+ function fileDecItem(dec) { ?> { <?php
105
+ if(dec.subDirPath!=undefined && dec.subDirPath!=''){ ?> subDirPath : '<?= dec.subDirPath ?>', <?php }
106
+ if(dec.extension!=undefined && dec.extension!=''){ ?> extension : '<?= dec.extension ?>', <?php }
107
+ ?> } <?php }
108
+ ?>
@@ -0,0 +1,39 @@
1
+ {
2
+ "exclude": [
3
+ "node_modules",
4
+ "<?= outDir ?>",
5
+ ],
6
+ "include": [
7
+ "<?= srcDir ?>"
8
+ ],
9
+ "compileOnSave": true,
10
+ "compilerOptions": {
11
+ "module": "ESNext",
12
+ "moduleResolution": "node",
13
+ "target": "ESNext",
14
+ "strict": true,
15
+ "baseUrl": ".",
16
+ "outDir": "./<?= outDir ?>",
17
+ "rootDir": "./<?= srcDir ?>",
18
+ "declaration": true,
19
+ "sourceMap": true,
20
+ "allowJs": true,
21
+ "strictNullChecks": false,
22
+ "esModuleInterop": true,
23
+ "checkJs": false,
24
+ "forceConsistentCasingInFileNames": true,
25
+ "resolveJsonModule": true,
26
+ "noEmit": false,
27
+ "skipLibCheck": true,
28
+ "emitDecoratorMetadata": true,
29
+ "experimentalDecorators": true,
30
+ "removeComments": false,
31
+ "noImplicitAny": false,
32
+ "inlineSources": true,
33
+ "paths": {
34
+ "uc-control/*": [
35
+ "./node_modules/uc-control/out/*"
36
+ ]
37
+ }
38
+ },
39
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "uc-dev",
3
+ "version": "1.0.0-beta.0",
4
+ "description": "project builder for uc-control",
5
+ "license": "ISC",
6
+ "author": "",
7
+ "type": "module",
8
+ "scripts": {
9
+ "clean": "rimraf out",
10
+ "start": "electron .",
11
+ "build:es": "node copyRes.mjs && node build-es.js",
12
+ "build:dts": "tsc --emitDeclarationOnly",
13
+ "build": "tsc && node copyRes.mjs",
14
+ "rebuild": "npm run clean && npm run build:es",
15
+ "rebuild:start": "npm run rebuild && npm run start"
16
+ },
17
+ "devDependencies": {
18
+ "@types/node": "^20.11.0",
19
+ "ap-shared-core": "file:../ap-shared-core",
20
+ "electron": "^39.1.1",
21
+ "rimraf": "^6.0.1",
22
+ "esbuild": "^0.27.2",
23
+ "tsconfig-paths": "^4.2.0",
24
+ "typescript": "^5.9.3"
25
+ },
26
+ "dependencies": {
27
+ "css-select": "^6.0.0",
28
+ "dom-serializer": "^2.0.0",
29
+ "htmlparser2": "^10.1.0",
30
+ "uc-dev": "file:../uc-dev/uc-dev-1.0.0-beta.0.tgz"
31
+ },
32
+ "files": ["out"],
33
+ "bin": {
34
+ "uc-dev": "./out/cli.js"
35
+ }
36
+ }