uc-dev 1.0.0-beta.3 → 1.0.0-beta.5
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/out/cli.js +57 -28
- package/package.json +1 -1
package/out/cli.js
CHANGED
|
@@ -715,7 +715,7 @@ var ucUtil = class _ucUtil {
|
|
|
715
715
|
};
|
|
716
716
|
|
|
717
717
|
// src/utils/cliMain.ts
|
|
718
|
-
import { existsSync as existsSync11, readFileSync as
|
|
718
|
+
import { existsSync as existsSync11, readFileSync as readFileSync7 } from "fs";
|
|
719
719
|
import path6, { join as join15 } from "path";
|
|
720
720
|
|
|
721
721
|
// src/utils/cliDependancyChecker.ts
|
|
@@ -1208,8 +1208,12 @@ var ConfigHandler = class {
|
|
|
1208
1208
|
const pathAlias = prow.config?.browser?.importmap ?? {};
|
|
1209
1209
|
for (let [als, relPath] of Object.entries(pathAlias)) {
|
|
1210
1210
|
als = trimPath(als);
|
|
1211
|
-
let fpath =
|
|
1212
|
-
let resolvPath =
|
|
1211
|
+
let fpath = prow.projectPath;
|
|
1212
|
+
let resolvPath = path2.resolve(fpath, relPath);
|
|
1213
|
+
if (!fs2.existsSync(resolvPath)) {
|
|
1214
|
+
console.warn("ImportMap path not found:", resolvPath);
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1213
1217
|
const isDir = fs2.statSync(resolvPath).isDirectory();
|
|
1214
1218
|
let np = correctpath(path2.relative(fpath, resolvPath));
|
|
1215
1219
|
np = cpath(np, isDir);
|
|
@@ -1349,7 +1353,6 @@ var ConfigHandler = class {
|
|
|
1349
1353
|
const pkgJsonPath = appRequire.resolve(`${pkgName}/package.json`);
|
|
1350
1354
|
return path2.dirname(pkgJsonPath);
|
|
1351
1355
|
} catch (ee) {
|
|
1352
|
-
console.log(ee);
|
|
1353
1356
|
return null;
|
|
1354
1357
|
}
|
|
1355
1358
|
}
|
|
@@ -1612,9 +1615,6 @@ function _runTemplate(rel, options) {
|
|
|
1612
1615
|
import path5 from "path";
|
|
1613
1616
|
import url3 from "url";
|
|
1614
1617
|
|
|
1615
|
-
// src/lib/processes/BuildDesigner.ts
|
|
1616
|
-
import { join as join6, normalize as normalize5, relative as relative2, resolve as resolve6 } from "path";
|
|
1617
|
-
|
|
1618
1618
|
// ../ap-shared-core/out/uc-runtime/stylerRegs.js
|
|
1619
1619
|
function ScssExtractor(csscontent) {
|
|
1620
1620
|
let ocHandler = new openCloser();
|
|
@@ -1802,8 +1802,13 @@ function splitCSSById(cssContent, rtrn) {
|
|
|
1802
1802
|
rtrn.outerCssContents = outerRulesCSS;
|
|
1803
1803
|
}
|
|
1804
1804
|
|
|
1805
|
+
// src/lib/processes/BuildDesigner.ts
|
|
1806
|
+
import { existsSync as existsSync9, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
1807
|
+
import { join as join6, normalize as normalize5, relative as relative2, resolve as resolve6 } from "path";
|
|
1808
|
+
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
1809
|
+
|
|
1805
1810
|
// src/lib/processes/commonGeneratorX.ts
|
|
1806
|
-
import { existsSync as existsSync8, readFileSync as readFileSync4, writeFileSync as
|
|
1811
|
+
import { existsSync as existsSync8, readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
1807
1812
|
import { dirname as dirname5, join as join5, normalize as normalize4, resolve as resolve5 } from "path";
|
|
1808
1813
|
|
|
1809
1814
|
// src/lib/processes/ResourceBuildEngine.ts
|
|
@@ -2137,14 +2142,14 @@ var commonGeneratorX = class _commonGeneratorX {
|
|
|
2137
2142
|
let srctype = "ts";
|
|
2138
2143
|
ensureDirectoryExistence(row.src.pathOf[designerFileSrctype]);
|
|
2139
2144
|
_data = this.filex(`${srctype}${uctype}.designer`)(row);
|
|
2140
|
-
|
|
2145
|
+
writeFileSync2(row.src.pathOf[designerFileSrctype], _data);
|
|
2141
2146
|
if (!existsSync8(row.src.pathOf[codeFileSrctype])) {
|
|
2142
2147
|
_data = this.filex(`${srctype}${uctype}.code`)(row);
|
|
2143
|
-
|
|
2148
|
+
writeFileSync2(row.src.pathOf[codeFileSrctype], _data);
|
|
2144
2149
|
}
|
|
2145
2150
|
if (!existsSync8(row.src.pathOf.scss)) {
|
|
2146
2151
|
_data = this.filex(`${srctype}${uctype}.style`)(row);
|
|
2147
|
-
|
|
2152
|
+
writeFileSync2(row.src.pathOf.scss, _data);
|
|
2148
2153
|
}
|
|
2149
2154
|
}
|
|
2150
2155
|
}
|
|
@@ -2185,20 +2190,16 @@ var commonGeneratorX = class _commonGeneratorX {
|
|
|
2185
2190
|
});
|
|
2186
2191
|
ensureDirectoryExistence(resSrcFile);
|
|
2187
2192
|
let resContent = this.filex("ts.resources")(rowForRes);
|
|
2188
|
-
|
|
2193
|
+
writeFileSync2(resSrcFile, resContent, "utf-8");
|
|
2189
2194
|
if (!proj.config.cli.useTypeScript) {
|
|
2190
2195
|
let resSrcTypeFile = ucUtil.changeExtension(resSrcFile, ".js", ".d.ts");
|
|
2191
2196
|
let resContentTypes = this.filex("t.resources")(rowForRes);
|
|
2192
|
-
|
|
2197
|
+
writeFileSync2(resSrcTypeFile, resContentTypes, "utf-8");
|
|
2193
2198
|
}
|
|
2194
2199
|
return true;
|
|
2195
2200
|
}
|
|
2196
2201
|
};
|
|
2197
2202
|
|
|
2198
|
-
// src/lib/processes/BuildDesigner.ts
|
|
2199
|
-
import { existsSync as existsSync9, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
2200
|
-
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
2201
|
-
|
|
2202
2203
|
// node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.js
|
|
2203
2204
|
var _a;
|
|
2204
2205
|
var decodeMap = /* @__PURE__ */ new Map([
|
|
@@ -7325,7 +7326,7 @@ var BuildDesigner = class {
|
|
|
7325
7326
|
</WRAPPER>`;
|
|
7326
7327
|
}
|
|
7327
7328
|
if (!existsSync9(finfo.allPathOf[pref.srcDec].scss)) {
|
|
7328
|
-
|
|
7329
|
+
writeFileSync3(finfo.allPathOf[pref.srcDec].scss, `&{
|
|
7329
7330
|
position: relative;
|
|
7330
7331
|
display:block; width: 800px; height: 500px;
|
|
7331
7332
|
background-color: #aeaeae;
|
|
@@ -7627,9 +7628,11 @@ function registerMain() {
|
|
|
7627
7628
|
encrypt: cfg.encryptResource
|
|
7628
7629
|
}));
|
|
7629
7630
|
mp.cssGuid = JSON.stringify(ResourceKeyBridge.extractKey(_cssbuilder.build(stylePath, {})));
|
|
7630
|
-
if (cfg.cli.baseHtmlPath != void 0) {
|
|
7631
|
+
if (cfg.cli.baseHtmlPath != void 0 && cfg.cli.baseHtmlPath.length > 0) {
|
|
7631
7632
|
let htmlPath = join8(_mainProj.projectPath, cfg.cli.baseHtmlPath);
|
|
7632
|
-
|
|
7633
|
+
const mainHtmlRes = _cssbuilder.build(htmlPath, {});
|
|
7634
|
+
if (mainHtmlRes != void 0)
|
|
7635
|
+
mp.mainHtmlGuid = ResourceKeyBridge.extractKey(mainHtmlRes);
|
|
7633
7636
|
}
|
|
7634
7637
|
mp.ucConfigGuid = JSON.stringify(ResourceKeyBridge.extractKey(_cssbuilder.build(void 0, {
|
|
7635
7638
|
content: JSON.stringify(_mainProj.config)
|
|
@@ -8017,7 +8020,7 @@ import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
|
8017
8020
|
// src/utils/inquiry/cli_sample_style1.ts
|
|
8018
8021
|
import { dirname as dirname10, join as join13, relative as relative4, resolve as resolve10 } from "node:path";
|
|
8019
8022
|
import { fileURLToPath as fileURLToPath11 } from "node:url";
|
|
8020
|
-
import { readFileSync as
|
|
8023
|
+
import { readFileSync as readFileSync6 } from "node:fs";
|
|
8021
8024
|
async function cli_sample_style1(main2) {
|
|
8022
8025
|
const cli = main2.config.cli;
|
|
8023
8026
|
const sampleroot = dirname10(join13(cli.srcDir, cli.baseCodePath));
|
|
@@ -8070,7 +8073,7 @@ function _runTemplate4(rel, options) {
|
|
|
8070
8073
|
}
|
|
8071
8074
|
function _runTemplate_x(rel, row) {
|
|
8072
8075
|
const fpath = join13(dirname10(fileURLToPath11(import.meta.url)), "utils/inquiry", rel);
|
|
8073
|
-
let content =
|
|
8076
|
+
let content = readFileSync6(fpath, "utf-8");
|
|
8074
8077
|
content = ucUtil.PHP_REMOVE(content);
|
|
8075
8078
|
const tmaker = new TemplateMaker();
|
|
8076
8079
|
const callback = tmaker.compileTemplate(content);
|
|
@@ -8084,7 +8087,6 @@ async function cli_menu_generate(main2, back_menu_callback = async () => {
|
|
|
8084
8087
|
const cmd2 = await makeMenu("G E N E R A T E", `
|
|
8085
8088
|
E = Electron Stuffs
|
|
8086
8089
|
S = Sample Style1
|
|
8087
|
-
U = 'ucconfig.js' file
|
|
8088
8090
|
V = '.vscode/settings.json' file
|
|
8089
8091
|
T = 'tsconfig.json' for project
|
|
8090
8092
|
A = Do All Above
|
|
@@ -8094,7 +8096,6 @@ async function cli_menu_generate(main2, back_menu_callback = async () => {
|
|
|
8094
8096
|
async function _select(selectedOption) {
|
|
8095
8097
|
switch (selectedOption.toLowerCase().trim()) {
|
|
8096
8098
|
case "a":
|
|
8097
|
-
await _select("u");
|
|
8098
8099
|
await _select("v");
|
|
8099
8100
|
await _select("t");
|
|
8100
8101
|
await _select("s");
|
|
@@ -8109,9 +8110,6 @@ async function cli_menu_generate(main2, back_menu_callback = async () => {
|
|
|
8109
8110
|
await cli_sample_style1(main2);
|
|
8110
8111
|
hasAddedSampleForm = true;
|
|
8111
8112
|
break;
|
|
8112
|
-
case "u":
|
|
8113
|
-
await main2._cliUcconfigInq.generateUcConfig();
|
|
8114
|
-
break;
|
|
8115
8113
|
case "e":
|
|
8116
8114
|
await main2._cliElectronInq.generate(hasAddedSampleForm);
|
|
8117
8115
|
break;
|
|
@@ -8146,6 +8144,33 @@ function _runTemplate5(rel, options) {
|
|
|
8146
8144
|
return runTemplate(join14(dirname11(fileURLToPath12(import.meta.url)), "utils/inquiry", rel), import.meta.url, options);
|
|
8147
8145
|
}
|
|
8148
8146
|
|
|
8147
|
+
// src/utils/inquiry/cli_menu_dependancy.ts
|
|
8148
|
+
async function cli_menu_dependancy(main2, back_menu_callback = async () => {
|
|
8149
|
+
}) {
|
|
8150
|
+
let hasAddedSampleForm = false;
|
|
8151
|
+
const cmd2 = await makeMenu("D E P E N D A N C Y", `
|
|
8152
|
+
E = Electron
|
|
8153
|
+
T = Type Script
|
|
8154
|
+
R = rimraf
|
|
8155
|
+
U = uc-runtime
|
|
8156
|
+
D = uc-dev
|
|
8157
|
+
C = uc-controls
|
|
8158
|
+
`, "etrudc");
|
|
8159
|
+
await _select(cmd2);
|
|
8160
|
+
async function _select(selectedOption) {
|
|
8161
|
+
const packages = [];
|
|
8162
|
+
if (selectedOption.includes("e")) packages.push("electron");
|
|
8163
|
+
if (selectedOption.includes("t")) packages.push("typescript", "@types/node");
|
|
8164
|
+
if (selectedOption.includes("r")) packages.push("rimraf");
|
|
8165
|
+
if (selectedOption.includes("u")) packages.push("uc-runtime");
|
|
8166
|
+
if (selectedOption.includes("d")) packages.push("uc-dev");
|
|
8167
|
+
if (selectedOption.includes("c")) packages.push("uc-controls");
|
|
8168
|
+
if (packages.length > 0)
|
|
8169
|
+
await main2.dependancyChecker.installPackages(packages);
|
|
8170
|
+
console.log("INSTALLED..");
|
|
8171
|
+
}
|
|
8172
|
+
}
|
|
8173
|
+
|
|
8149
8174
|
// src/utils/inquiry/cli_menu_MainMenu.ts
|
|
8150
8175
|
async function cli_menu_MainMenu(main2, back_menu_callback = async () => {
|
|
8151
8176
|
}) {
|
|
@@ -8153,12 +8178,16 @@ async function cli_menu_MainMenu(main2, back_menu_callback = async () => {
|
|
|
8153
8178
|
P = Perameters
|
|
8154
8179
|
B = Build Designers and Resource File
|
|
8155
8180
|
G = Generate
|
|
8181
|
+
D = Dependancy
|
|
8156
8182
|
Q = Quit
|
|
8157
8183
|
`, "q");
|
|
8158
8184
|
switch (cmd2.toLowerCase().trim()) {
|
|
8159
8185
|
case "b":
|
|
8160
8186
|
await main2.startBuild();
|
|
8161
8187
|
break;
|
|
8188
|
+
case "d":
|
|
8189
|
+
await cli_menu_dependancy(main2, cli_menu_MainMenu);
|
|
8190
|
+
break;
|
|
8162
8191
|
case "p":
|
|
8163
8192
|
await main2._cliSurveys.inquiry();
|
|
8164
8193
|
await cli_menu_MainMenu(main2);
|
|
@@ -8327,7 +8356,7 @@ Sub Directory Path (inside source directory) : `, fdec.subDirPath ?? "");
|
|
|
8327
8356
|
throw new Error("package.json not found in project directory");
|
|
8328
8357
|
}
|
|
8329
8358
|
const pkgJson = JSON.parse(
|
|
8330
|
-
|
|
8359
|
+
readFileSync7(pkgPath, "utf-8")
|
|
8331
8360
|
);
|
|
8332
8361
|
const deps = {
|
|
8333
8362
|
...pkgJson.dependencies,
|