uc-dev 1.0.4 → 1.0.6
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 +69 -69
- package/package.json +1 -1
package/out/cli.js
CHANGED
|
@@ -58,8 +58,8 @@ function correctpath(str, trim = false) {
|
|
|
58
58
|
function subtractPath(basePath, targetPath, pathModule) {
|
|
59
59
|
const absBase = pathModule.resolve(basePath);
|
|
60
60
|
const absTarget = pathModule.resolve(targetPath);
|
|
61
|
-
const
|
|
62
|
-
return
|
|
61
|
+
const relative6 = pathModule.relative(absBase, absTarget);
|
|
62
|
+
return relative6;
|
|
63
63
|
}
|
|
64
64
|
function trimPath(pth) {
|
|
65
65
|
return pth.replace(/^\.?\/*|\/*$/g, "");
|
|
@@ -93,7 +93,7 @@ var ProjectRowBase = class {
|
|
|
93
93
|
resolvablePackages = {};
|
|
94
94
|
configGuid = "";
|
|
95
95
|
rootPath = "";
|
|
96
|
-
|
|
96
|
+
// aliceTo_Path?: { [alice: string]: string; } = {};
|
|
97
97
|
projectPrimaryAlice = "";
|
|
98
98
|
children = [];
|
|
99
99
|
config = new UserUCConfig();
|
|
@@ -715,15 +715,15 @@ var ucUtil = class _ucUtil {
|
|
|
715
715
|
};
|
|
716
716
|
|
|
717
717
|
// src/utils/cliMain.ts
|
|
718
|
-
import { existsSync as
|
|
718
|
+
import { existsSync as existsSync12, readFileSync as readFileSync7 } from "fs";
|
|
719
719
|
import path6, { join as join15 } from "path";
|
|
720
720
|
|
|
721
721
|
// src/utils/cliDependancyChecker.ts
|
|
722
722
|
import { spawn } from "node:child_process";
|
|
723
|
-
import { existsSync as
|
|
723
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
724
724
|
|
|
725
725
|
// src/utils/prompt.ts
|
|
726
|
-
import { existsSync as
|
|
726
|
+
import { existsSync as existsSync4, readFileSync, writeFileSync } from "node:fs";
|
|
727
727
|
import { dirname as dirname2, resolve as resolve3 } from "node:path";
|
|
728
728
|
import readline from "node:readline";
|
|
729
729
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
@@ -1093,8 +1093,8 @@ var ImportMapResolver = class {
|
|
|
1093
1093
|
|
|
1094
1094
|
// ../ap-shared-core/out/uc-dev/ConfigHandler.js
|
|
1095
1095
|
import { createRequire } from "module";
|
|
1096
|
-
import fs2, { readdirSync } from "node:fs";
|
|
1097
|
-
import path2, { join as join2, normalize as normalize2, resolve as resolve2 } from "node:path";
|
|
1096
|
+
import fs2, { existsSync as existsSync3, readdirSync } from "node:fs";
|
|
1097
|
+
import path2, { join as join2, normalize as normalize2, relative as relative2, resolve as resolve2 } from "node:path";
|
|
1098
1098
|
import url2 from "node:url";
|
|
1099
1099
|
|
|
1100
1100
|
// ../ap-shared-core/out/uc-dev/userConfigManage.js
|
|
@@ -1185,6 +1185,7 @@ var ConfigHandler = class {
|
|
|
1185
1185
|
scopes: {}
|
|
1186
1186
|
};
|
|
1187
1187
|
MAKE_IMPORTMAP = (mainProjRow) => {
|
|
1188
|
+
debugger;
|
|
1188
1189
|
const __ImpMap = {
|
|
1189
1190
|
imports: {},
|
|
1190
1191
|
scopes: {}
|
|
@@ -1203,24 +1204,20 @@ var ConfigHandler = class {
|
|
|
1203
1204
|
p = "./";
|
|
1204
1205
|
return p;
|
|
1205
1206
|
}
|
|
1207
|
+
const _this = this;
|
|
1206
1208
|
function walk(prow) {
|
|
1207
1209
|
const aliases2 = {};
|
|
1208
1210
|
const pathAlias = prow.config?.browser?.importmap ?? {};
|
|
1209
1211
|
for (let [als, relPath] of Object.entries(pathAlias)) {
|
|
1210
1212
|
als = trimPath(als);
|
|
1211
|
-
|
|
1212
|
-
let
|
|
1213
|
-
let resolvPath = normalize2(path2.join(fpath, relPath));
|
|
1214
|
-
if (!fs2.existsSync(resolvPath)) {
|
|
1215
|
-
console.warn("ImportMap path not found:", resolvPath);
|
|
1216
|
-
continue;
|
|
1217
|
-
}
|
|
1213
|
+
let ___projectRootPath = resolve2(_this.MAIN_PROJECT_PATH, prow.rootPath);
|
|
1214
|
+
let resolvPath = normalize2(path2.join(___projectRootPath, relPath));
|
|
1218
1215
|
if (!fs2.existsSync(resolvPath)) {
|
|
1219
1216
|
console.warn("ImportMap path not found:", resolvPath);
|
|
1220
1217
|
continue;
|
|
1221
1218
|
}
|
|
1222
1219
|
const isDir = fs2.statSync(resolvPath).isDirectory();
|
|
1223
|
-
let np = correctpath(path2.relative(
|
|
1220
|
+
let np = correctpath(path2.relative(_this.MAIN_PROJECT_PATH, resolvPath));
|
|
1224
1221
|
np = cpath(np, isDir);
|
|
1225
1222
|
aliases2[isDir ? `${als}/` : `${als}`] = np;
|
|
1226
1223
|
}
|
|
@@ -1253,36 +1250,35 @@ var ConfigHandler = class {
|
|
|
1253
1250
|
this.srcDirPath = this.pref.dirDeclaration[this.pref.srcDec].dirPath;
|
|
1254
1251
|
this.outDirPath = this.pref.dirDeclaration[this.pref.outDec].dirPath;
|
|
1255
1252
|
this.allConfig.sort((a, b) => b.importMetaURL.length - a.importMetaURL.length);
|
|
1256
|
-
this.
|
|
1253
|
+
this.update_Alice_To_Path(this.allConfig);
|
|
1257
1254
|
this.importmap = this.MAKE_IMPORTMAP(this.ucConfig);
|
|
1255
|
+
console.log("done.");
|
|
1258
1256
|
for (const [k, v] of Object.entries(this.importmap.scopes)) {
|
|
1259
1257
|
if (v == void 0 || Object.keys(v).length == 0)
|
|
1260
1258
|
delete this.importmap.scopes[k];
|
|
1261
1259
|
}
|
|
1262
1260
|
ImportMapResolver.init(this.importmap, this.MAIN_PROJECT_PATH);
|
|
1263
1261
|
};
|
|
1264
|
-
|
|
1262
|
+
update_Alice_To_Path(rows) {
|
|
1265
1263
|
let mainProjectPath = this.MAIN_CONFIG.projectPath;
|
|
1266
1264
|
const dict = this.ALL_PROJECTS_DIRECTORIES;
|
|
1267
1265
|
rows.forEach((row) => {
|
|
1268
|
-
for (const [pathAliasKey, pathAliasValue] of Object.entries(row.config.browser.importmap)) {
|
|
1269
|
-
let fullPath = correctpath(path2.join(mainProjectPath, pathAliasValue) + "/");
|
|
1270
|
-
let p = rows.find((s) => fullPath.startsWith(s.projectPath));
|
|
1271
|
-
if (p != void 0)
|
|
1272
|
-
row.aliceToPath[pathAliasKey] = p.projectPath;
|
|
1273
|
-
}
|
|
1274
1266
|
const cfg = row.config;
|
|
1275
1267
|
cfg.browser = cfg.browser ?? { importmap: {}, resolveProjects: [] };
|
|
1276
1268
|
cfg.browser.importmap = cfg.browser.importmap ?? {};
|
|
1277
1269
|
const imap = cfg.browser.importmap;
|
|
1278
1270
|
});
|
|
1279
1271
|
}
|
|
1272
|
+
addedProject = {};
|
|
1280
1273
|
async RecurciveFindConfigAndFill(projectDirPath, row) {
|
|
1274
|
+
const _this = this;
|
|
1281
1275
|
if (projectDirPath != void 0) {
|
|
1282
|
-
projectDirPath = path2.normalize(projectDirPath);
|
|
1283
1276
|
if (this.allConfig.findIndex((s) => isSamePath2(s.projectPath, projectDirPath)) >= 0)
|
|
1284
1277
|
return;
|
|
1285
1278
|
let projectName = GetProjectName(projectDirPath, path2, fs2);
|
|
1279
|
+
if (this.allConfig.findIndex((s) => s.projectName == projectName) >= 0)
|
|
1280
|
+
return;
|
|
1281
|
+
projectDirPath = path2.normalize(projectDirPath);
|
|
1286
1282
|
const ucConfigPath = path2.join(projectDirPath, "ucconfig.js");
|
|
1287
1283
|
if (fs2.existsSync(ucConfigPath)) {
|
|
1288
1284
|
let ucCfg = await ImportUserConfig(ucConfigPath);
|
|
@@ -1296,12 +1292,8 @@ var ConfigHandler = class {
|
|
|
1296
1292
|
row.projectPath = correctpath(projectDirPath);
|
|
1297
1293
|
const cfg = row.config;
|
|
1298
1294
|
this.ALL_PROJECTS_DIRECTORIES[row.projectName] = this.ALL_PROJECTS_DIRECTORIES[row.projectName] ?? row.projectPath;
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
row.projectPath
|
|
1302
|
-
/*join(row.projectPath, outdec.dirPath)*/
|
|
1303
|
-
)));
|
|
1304
|
-
row.rootPath = row.rootPath == "." ? "." : path2.join("./", row.rootPath, "/");
|
|
1295
|
+
const _rpath = correctpath(normalize2(relative2(this.MAIN_PROJECT_PATH, row.projectPath)));
|
|
1296
|
+
row.rootPath = _rpath == "." ? "." : path2.join("./", _rpath, "/");
|
|
1305
1297
|
cfg.browser = cfg.browser ?? new BrowserUcConfig();
|
|
1306
1298
|
cfg.browser.importmap = cfg.browser.importmap ?? {};
|
|
1307
1299
|
const pref = cfg.preference;
|
|
@@ -1310,15 +1302,20 @@ var ConfigHandler = class {
|
|
|
1310
1302
|
row.importMetaURL = url2.pathToFileURL(projectDirPath).href;
|
|
1311
1303
|
let dirs = this.listProjectPath(projectDirPath);
|
|
1312
1304
|
row.resolvablePackages = this.PACKAGE_LIST;
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1305
|
+
const browser = row.config.browser;
|
|
1306
|
+
for (const [k, pkg] of Object.entries(row.resolvablePackages)) {
|
|
1307
|
+
const als = aliceFromExternalProject(pkg, this.MAIN_PROJECT_PATH);
|
|
1308
|
+
Object.assign(browser.importmap, als);
|
|
1316
1309
|
}
|
|
1317
1310
|
for (let i = 0, ilen = dirs.length; i < ilen; i++) {
|
|
1318
1311
|
const child_project_dir = dirs[i];
|
|
1319
1312
|
let nchild = new ProjectRowBase();
|
|
1313
|
+
const chld = row.children;
|
|
1314
|
+
chld.push(nchild);
|
|
1320
1315
|
await this.RecurciveFindConfigAndFill(child_project_dir, nchild);
|
|
1321
|
-
|
|
1316
|
+
if (!existsSync3(nchild.projectPath)) {
|
|
1317
|
+
row.children = chld.filter((s) => s !== nchild);
|
|
1318
|
+
}
|
|
1322
1319
|
}
|
|
1323
1320
|
}
|
|
1324
1321
|
} else {
|
|
@@ -1409,7 +1406,7 @@ function runTemplate(tptPath, importmeta, row) {
|
|
|
1409
1406
|
return callback(row);
|
|
1410
1407
|
}
|
|
1411
1408
|
async function writeFileSafely(fpath, data, options) {
|
|
1412
|
-
if (
|
|
1409
|
+
if (existsSync4(fpath)) {
|
|
1413
1410
|
options = JSON.parse(JSON.stringify(options));
|
|
1414
1411
|
const overwrite = options.force ?? await askYesNo(
|
|
1415
1412
|
`${fpath} already exists. Overwrite?`,
|
|
@@ -1449,8 +1446,8 @@ var cliDependancyChecker = class {
|
|
|
1449
1446
|
return _deps;
|
|
1450
1447
|
}
|
|
1451
1448
|
detectPackageManager() {
|
|
1452
|
-
if (
|
|
1453
|
-
if (
|
|
1449
|
+
if (existsSync5("pnpm-lock.yaml")) return "pnpm add ";
|
|
1450
|
+
if (existsSync5("yarn.lock")) return "yarn add ";
|
|
1454
1451
|
return "npm install ";
|
|
1455
1452
|
}
|
|
1456
1453
|
installPackages(pkgs) {
|
|
@@ -1497,14 +1494,14 @@ var cliDependancyChecker = class {
|
|
|
1497
1494
|
};
|
|
1498
1495
|
|
|
1499
1496
|
// src/utils/cliFindProjects.ts
|
|
1500
|
-
import { existsSync as
|
|
1497
|
+
import { existsSync as existsSync6, realpathSync, statSync } from "fs";
|
|
1501
1498
|
import path3 from "path";
|
|
1502
1499
|
function getProjectDir(startPath) {
|
|
1503
1500
|
let dir = statSync(startPath).isFile() ? path3.dirname(startPath) : startPath;
|
|
1504
1501
|
dir = realpathSync(dir);
|
|
1505
1502
|
while (true) {
|
|
1506
1503
|
const candidate = path3.join(dir, "package.json");
|
|
1507
|
-
if (
|
|
1504
|
+
if (existsSync6(candidate)) {
|
|
1508
1505
|
return dir;
|
|
1509
1506
|
}
|
|
1510
1507
|
const parent = path3.dirname(dir);
|
|
@@ -1516,7 +1513,7 @@ function getProjectDir(startPath) {
|
|
|
1516
1513
|
}
|
|
1517
1514
|
|
|
1518
1515
|
// src/utils/inquiry/cliUcconfigInquiry.ts
|
|
1519
|
-
import { existsSync as
|
|
1516
|
+
import { existsSync as existsSync7, readFileSync as readFileSync2 } from "node:fs";
|
|
1520
1517
|
import { dirname as dirname3, join as join3, resolve as resolve4 } from "node:path";
|
|
1521
1518
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
1522
1519
|
var cliUcconfigInquiry = class {
|
|
@@ -1524,7 +1521,7 @@ var cliUcconfigInquiry = class {
|
|
|
1524
1521
|
this.main = main2;
|
|
1525
1522
|
}
|
|
1526
1523
|
get exist() {
|
|
1527
|
-
return
|
|
1524
|
+
return existsSync7(this.configFilepath);
|
|
1528
1525
|
}
|
|
1529
1526
|
async read() {
|
|
1530
1527
|
this.main.config = await ImportUserConfig(this.configFilepath);
|
|
@@ -1533,7 +1530,7 @@ var cliUcconfigInquiry = class {
|
|
|
1533
1530
|
return join3(this.main.projectDir, "ucconfig.js");
|
|
1534
1531
|
}
|
|
1535
1532
|
inferConfigFromKnownFiles() {
|
|
1536
|
-
if (
|
|
1533
|
+
if (existsSync7("tsconfig.json")) {
|
|
1537
1534
|
const ts = JSON.parse(readFileSync2("tsconfig.json", "utf-8"));
|
|
1538
1535
|
return {
|
|
1539
1536
|
srcDir: ts.compilerOptions?.rootDir ?? "src",
|
|
@@ -1808,16 +1805,16 @@ function splitCSSById(cssContent, rtrn) {
|
|
|
1808
1805
|
}
|
|
1809
1806
|
|
|
1810
1807
|
// src/lib/processes/BuildDesigner.ts
|
|
1811
|
-
import { existsSync as
|
|
1812
|
-
import { join as join6, normalize as normalize5, relative as
|
|
1808
|
+
import { existsSync as existsSync10, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
1809
|
+
import { join as join6, normalize as normalize5, relative as relative3, resolve as resolve7 } from "path";
|
|
1813
1810
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
1814
1811
|
|
|
1815
1812
|
// src/lib/processes/commonGeneratorX.ts
|
|
1816
|
-
import { existsSync as
|
|
1813
|
+
import { existsSync as existsSync9, readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
|
|
1817
1814
|
import { dirname as dirname5, join as join5, normalize as normalize4, resolve as resolve6 } from "path";
|
|
1818
1815
|
|
|
1819
1816
|
// src/lib/processes/ResourceBuildEngine.ts
|
|
1820
|
-
import { existsSync as
|
|
1817
|
+
import { existsSync as existsSync8, readFileSync as readFileSync3 } from "fs";
|
|
1821
1818
|
import { dirname as dirname4, extname, join as join4, normalize as normalize3, resolve as resolve5, sep } from "path";
|
|
1822
1819
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
1823
1820
|
var SCSS_IMPORT_RE = /@(use|import)\s+(?:url\()?["']([^"')]+)["']\)?\s*;/gi;
|
|
@@ -1936,7 +1933,7 @@ var ResourceBuildEngine = class {
|
|
|
1936
1933
|
}
|
|
1937
1934
|
return ResourceKeyBridge.makeKey(res.guid);
|
|
1938
1935
|
}
|
|
1939
|
-
if (!
|
|
1936
|
+
if (!existsSync8(absPath)) {
|
|
1940
1937
|
console.log("Missing resource:", absPath);
|
|
1941
1938
|
return void 0;
|
|
1942
1939
|
}
|
|
@@ -2062,7 +2059,7 @@ var ResourceBuildEngine = class {
|
|
|
2062
2059
|
return ResourceKeyBridge.makeKey(guid);
|
|
2063
2060
|
}
|
|
2064
2061
|
const abs = resolve5(dirname4(importerPath), rel);
|
|
2065
|
-
if (!
|
|
2062
|
+
if (!existsSync8(abs)) return rel;
|
|
2066
2063
|
return this.build(abs, _blueprint);
|
|
2067
2064
|
}
|
|
2068
2065
|
};
|
|
@@ -2148,11 +2145,11 @@ var commonGeneratorX = class _commonGeneratorX {
|
|
|
2148
2145
|
ensureDirectoryExistence(row.src.pathOf[designerFileSrctype]);
|
|
2149
2146
|
_data = this.filex(`${srctype}${uctype}.designer`)(row);
|
|
2150
2147
|
writeFileSync2(row.src.pathOf[designerFileSrctype], _data);
|
|
2151
|
-
if (!
|
|
2148
|
+
if (!existsSync9(row.src.pathOf[codeFileSrctype])) {
|
|
2152
2149
|
_data = this.filex(`${srctype}${uctype}.code`)(row);
|
|
2153
2150
|
writeFileSync2(row.src.pathOf[codeFileSrctype], _data);
|
|
2154
2151
|
}
|
|
2155
|
-
if (!
|
|
2152
|
+
if (!existsSync9(row.src.pathOf.scss)) {
|
|
2156
2153
|
_data = this.filex(`${srctype}${uctype}.style`)(row);
|
|
2157
2154
|
writeFileSync2(row.src.pathOf.scss, _data);
|
|
2158
2155
|
}
|
|
@@ -2185,13 +2182,15 @@ var commonGeneratorX = class _commonGeneratorX {
|
|
|
2185
2182
|
declareClassPath: BuildingProcess.configHandler.MAIN_CONFIG.projectName == "uc-runtime" ? "uc-runtime/src/core-main" : "uc-runtime/core-main"
|
|
2186
2183
|
};
|
|
2187
2184
|
const srcDec = x.srcDec;
|
|
2185
|
+
debugger;
|
|
2188
2186
|
let resSrcFile = resolve6(proj.projectPath, x.srcDec.dirPath, x.cli.ResourceStorageFile);
|
|
2189
2187
|
rowForRes.projectList.forEach((s) => {
|
|
2190
2188
|
const resFullpath = s.resourceRelativePath;
|
|
2191
2189
|
s.resourceRelativePath = JSON.stringify(resFullpath);
|
|
2192
2190
|
const y = extractPathConfig(s.project.config);
|
|
2193
|
-
|
|
2194
|
-
|
|
2191
|
+
let resFpath = join5(s.project.projectPath, y.outDec.dirPath, y.cli.ResourceStorageFile);
|
|
2192
|
+
resFpath = ucUtil.changeExtension(resFpath, ".ts", ".js");
|
|
2193
|
+
s.importResource = s.projectGuid != chandler.MAIN_CONFIG.config.guid && existsSync9(resFpath);
|
|
2195
2194
|
});
|
|
2196
2195
|
ensureDirectoryExistence(resSrcFile);
|
|
2197
2196
|
let resContent = this.filex("ts.resources")(rowForRes);
|
|
@@ -5437,10 +5436,10 @@ function compareDocumentPosition(nodeA, nodeB) {
|
|
|
5437
5436
|
function uniqueSort(nodes) {
|
|
5438
5437
|
nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
|
|
5439
5438
|
nodes.sort((a, b) => {
|
|
5440
|
-
const
|
|
5441
|
-
if (
|
|
5439
|
+
const relative6 = compareDocumentPosition(a, b);
|
|
5440
|
+
if (relative6 & DocumentPosition.PRECEDING) {
|
|
5442
5441
|
return -1;
|
|
5443
|
-
} else if (
|
|
5442
|
+
} else if (relative6 & DocumentPosition.FOLLOWING) {
|
|
5444
5443
|
return 1;
|
|
5445
5444
|
}
|
|
5446
5445
|
return 0;
|
|
@@ -7330,7 +7329,7 @@ var BuildDesigner = class {
|
|
|
7330
7329
|
</UCWINFRAME>
|
|
7331
7330
|
</WRAPPER>`;
|
|
7332
7331
|
}
|
|
7333
|
-
if (!
|
|
7332
|
+
if (!existsSync10(finfo.allPathOf[pref.srcDec].scss)) {
|
|
7334
7333
|
writeFileSync3(finfo.allPathOf[pref.srcDec].scss, `&{
|
|
7335
7334
|
position: relative;
|
|
7336
7335
|
display:block; width: 800px; height: 500px;
|
|
@@ -7355,7 +7354,7 @@ var BuildDesigner = class {
|
|
|
7355
7354
|
const imppath = _row.src?.projectInfo.projectName == "uc-runtime" ? relativeFilePath(_row.src.allPathOf.out.designer, join6(_row.src.projectInfo.projectPath, "out/core.js")) : "uc-runtime/core.js";
|
|
7356
7355
|
_importer.addImport(["Usercontrol", "intenseGenerator", "IUcOptions", "ResourceManage"], imppath);
|
|
7357
7356
|
this.common2(row.designer, finfo);
|
|
7358
|
-
const _exists =
|
|
7357
|
+
const _exists = existsSync10;
|
|
7359
7358
|
for (let i = 0, iObj = elements, len = iObj.length; i < len; i++) {
|
|
7360
7359
|
const element = iObj[i];
|
|
7361
7360
|
onSelect_xName(element, _row);
|
|
@@ -7401,7 +7400,7 @@ var BuildDesigner = class {
|
|
|
7401
7400
|
if (htmlcode == void 0) return void 0;
|
|
7402
7401
|
htmlcode = ucUtil.devEsc(htmlcode);
|
|
7403
7402
|
let compileedCode = ucUtil.PHP_REMOVE(htmlcode);
|
|
7404
|
-
let rootpath =
|
|
7403
|
+
let rootpath = relative3(projectPath, srcPathof.html);
|
|
7405
7404
|
try {
|
|
7406
7405
|
if (compileedCode.trim() != "") {
|
|
7407
7406
|
compileedCode = ucUtil.PHP_REMOVE(htmlcode);
|
|
@@ -7420,7 +7419,7 @@ var BuildDesigner = class {
|
|
|
7420
7419
|
);
|
|
7421
7420
|
this.common2(row.designer, finfo);
|
|
7422
7421
|
let cssContent = "";
|
|
7423
|
-
if (
|
|
7422
|
+
if (existsSync10(srcPathof.scss)) cssContent = this.gen.cssBulder.treeShakeCss(srcPathof.scss);
|
|
7424
7423
|
let cnt = {
|
|
7425
7424
|
htmlGuid: ResourceKeyBridge.extractKey(this.gen.cssBulder.build(srcPathof.html, { source: srcPathof.html })),
|
|
7426
7425
|
cssGuid: ResourceKeyBridge.extractKey(this.gen.cssBulder.build(srcPathof.scss, { source: srcPathof.scss }))
|
|
@@ -7514,7 +7513,7 @@ var BuildDesigner = class {
|
|
|
7514
7513
|
|
|
7515
7514
|
// src/lib/processes/ResourceCopy.ts
|
|
7516
7515
|
import { copyFileSync } from "fs";
|
|
7517
|
-
import { join as join7, relative as
|
|
7516
|
+
import { join as join7, relative as relative4 } from "path";
|
|
7518
7517
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
7519
7518
|
var ResourceCopy = class {
|
|
7520
7519
|
sourceFileList = [];
|
|
@@ -7561,7 +7560,7 @@ var ResourceCopy = class {
|
|
|
7561
7560
|
(s) => s.startsWith(dirDecfullPath) && res.includeExtensions.findIndex((e) => s.endsWith(e)) >= 0
|
|
7562
7561
|
);
|
|
7563
7562
|
filteed.forEach((full) => {
|
|
7564
|
-
const commonPath =
|
|
7563
|
+
const commonPath = relative4(dirDecfullPath, full);
|
|
7565
7564
|
res.toDeclares.forEach((todeclare) => {
|
|
7566
7565
|
let targetDir = dirDeclaration[todeclare].dirPath;
|
|
7567
7566
|
const dest = join7(targetDir, commonPath);
|
|
@@ -7918,7 +7917,7 @@ function _runTemplate3(rel, options) {
|
|
|
7918
7917
|
}
|
|
7919
7918
|
|
|
7920
7919
|
// src/utils/inquiry/cliTypeScriptInquiry.ts
|
|
7921
|
-
import { existsSync as
|
|
7920
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
7922
7921
|
import { dirname as dirname8, join as join11, resolve as resolve10 } from "node:path";
|
|
7923
7922
|
var cliTypeScriptInquiry = class {
|
|
7924
7923
|
constructor(main2) {
|
|
@@ -7930,7 +7929,7 @@ var cliTypeScriptInquiry = class {
|
|
|
7930
7929
|
}
|
|
7931
7930
|
async inquiry() {
|
|
7932
7931
|
const x = extractPathConfig(this.main.config);
|
|
7933
|
-
if (x.cli.useTypeScript && !
|
|
7932
|
+
if (x.cli.useTypeScript && !existsSync11(resolve10("tsconfig.json"))) {
|
|
7934
7933
|
if (await askYesNo(
|
|
7935
7934
|
`
|
|
7936
7935
|
ADD 'tsconfig.json' with required settings?
|
|
@@ -8023,7 +8022,7 @@ import { dirname as dirname11, join as join14, resolve as resolve12 } from "node
|
|
|
8023
8022
|
import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
8024
8023
|
|
|
8025
8024
|
// src/utils/inquiry/cli_sample_style1.ts
|
|
8026
|
-
import { dirname as dirname10, join as join13, relative as
|
|
8025
|
+
import { dirname as dirname10, join as join13, relative as relative5, resolve as resolve11 } from "node:path";
|
|
8027
8026
|
import { fileURLToPath as fileURLToPath11 } from "node:url";
|
|
8028
8027
|
import { readFileSync as readFileSync6 } from "node:fs";
|
|
8029
8028
|
async function cli_sample_style1(main2) {
|
|
@@ -8041,7 +8040,7 @@ async function cli_sample_style1(main2) {
|
|
|
8041
8040
|
code: resolve11(join13(sampleroot, "tptDashboard.tpt.ts"))
|
|
8042
8041
|
}
|
|
8043
8042
|
};
|
|
8044
|
-
const relHtmlPath =
|
|
8043
|
+
const relHtmlPath = relative5(resolve11(cli.srcDir), sample.frmDashboard.html);
|
|
8045
8044
|
const designerRoot = ucUtil.changeExtension(resolve11(join13(cli.srcDir, cli.designerDir, relHtmlPath)), ".html", ".designer.js");
|
|
8046
8045
|
const templateRoot = "templates/sample1";
|
|
8047
8046
|
await writeFileSafely(
|
|
@@ -8054,7 +8053,7 @@ async function cli_sample_style1(main2) {
|
|
|
8054
8053
|
_runTemplate_x(`${templateRoot}/frmDashboard.uc.scss.tp`, {}),
|
|
8055
8054
|
main2.cliOptions
|
|
8056
8055
|
);
|
|
8057
|
-
const designerReletivePath =
|
|
8056
|
+
const designerReletivePath = relative5(dirname10(sample.frmDashboard.code), designerRoot);
|
|
8058
8057
|
await writeFileSafely(
|
|
8059
8058
|
sample.frmDashboard.code,
|
|
8060
8059
|
_runTemplate4(`${templateRoot}/frmDashboard.uc.ts.tp`, {
|
|
@@ -8241,7 +8240,7 @@ var cliMain = class {
|
|
|
8241
8240
|
readConfig = async () => {
|
|
8242
8241
|
try {
|
|
8243
8242
|
const cfgPath = join15(this.projectDir, "ucconfig.js");
|
|
8244
|
-
if (
|
|
8243
|
+
if (existsSync12(cfgPath)) {
|
|
8245
8244
|
this.config = await ImportUserConfig(cfgPath);
|
|
8246
8245
|
if (this.config != void 0) {
|
|
8247
8246
|
const x = extractPathConfig(this.config);
|
|
@@ -8357,7 +8356,7 @@ Sub Directory Path (inside source directory) : `, fdec.subDirPath ?? "");
|
|
|
8357
8356
|
}
|
|
8358
8357
|
listProjectDependencies() {
|
|
8359
8358
|
const pkgPath = path6.resolve(this.projectDir, "package.json");
|
|
8360
|
-
if (!
|
|
8359
|
+
if (!existsSync12(pkgPath)) {
|
|
8361
8360
|
throw new Error("package.json not found in project directory");
|
|
8362
8361
|
}
|
|
8363
8362
|
const pkgJson = JSON.parse(
|
|
@@ -8388,6 +8387,7 @@ var copt = main.cliOptions;
|
|
|
8388
8387
|
copt.force = args.includes("--force");
|
|
8389
8388
|
copt.yes = args.includes("--yes");
|
|
8390
8389
|
var ignreq = args.includes("--ignreq");
|
|
8390
|
+
debugger;
|
|
8391
8391
|
switch (cmd) {
|
|
8392
8392
|
case "build":
|
|
8393
8393
|
if (!ignreq)
|