qcobjects-cli 2.5.143-beta → 2.5.144-beta
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/.cursor/rules/collaboration-features.mdc +25 -0
- package/.cursor/rules/development-guidelines.mdc +37 -0
- package/.cursor/rules/project-structure.mdc +36 -0
- package/.dockerignore +0 -0
- package/.github/FUNDING.yml +0 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- package/.github/ISSUE_TEMPLATE/custom.md +0 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- package/.github/ISSUE_TEMPLATE/issue-template.md +0 -0
- package/.github/workflows/ci.yml +26 -0
- package/.github/workflows/codeql-analysis.yml +0 -0
- package/.github/workflows/main-pr-source.yml +26 -0
- package/.github/workflows/npmpublish-beta.yml +20 -13
- package/.github/workflows/npmpublish-lts.yml +20 -13
- package/.github/workflows/npmpublish-main.yml +19 -12
- package/.github/workflows/open-pr-to-development.yml +70 -0
- package/.gitlab-ci.yml +0 -0
- package/.opencode/instructions/git-workflow.md +46 -0
- package/.pre-commit-config.yaml +9 -0
- package/AGENTS.md +59 -0
- package/CHANGELOG.md +0 -0
- package/README.md +75 -0
- package/VERSION +1 -1
- package/build-esbuild-esm.js +180 -0
- package/build-esbuild.js +182 -208
- package/deno.json +0 -0
- package/dev-requirements.txt +5 -0
- package/eslint.config.mjs +0 -0
- package/mod.ts +0 -0
- package/package.json +45 -44
- package/public/browser/api-client_services.js.map +1 -1
- package/public/browser/backend/backend-microservice-static.js +211 -219
- package/public/browser/backend/backend-microservice-static.js.map +2 -2
- package/public/browser/backend/backend-php.js +227 -231
- package/public/browser/backend/backend-php.js.map +3 -3
- package/public/browser/cli-commands-build-esbuild.js +326 -0
- package/public/browser/cli-commands-build-esbuild.js.map +7 -0
- package/public/browser/cli-commands-build-typescript.js +114 -0
- package/public/browser/cli-commands-build-typescript.js.map +7 -0
- package/public/browser/cli-commands-jira.js.map +1 -1
- package/public/browser/cli-commands-version.js.map +1 -1
- package/public/browser/cli-commands.js +4 -0
- package/public/browser/cli-commands.js.map +2 -2
- package/public/browser/cli-main.js.map +1 -1
- package/public/browser/client_services.js.map +1 -1
- package/public/browser/collab-server.js.map +1 -1
- package/public/browser/common-pipelog.js.map +1 -1
- package/public/browser/defaultsettings.js +68 -27
- package/public/browser/defaultsettings.js.map +3 -3
- package/public/browser/enterprise-commands.js.map +1 -1
- package/public/browser/main-file.js.map +1 -1
- package/public/browser/main-http-gae-server.js.map +1 -1
- package/public/browser/main-http-server.js.map +1 -1
- package/public/browser/main-http2-server.js.map +1 -1
- package/public/browser/qcobjects-cli.js.map +1 -1
- package/public/browser/qcobjects-collab.js +16 -24
- package/public/browser/qcobjects-collab.js.map +2 -2
- package/public/browser/qcobjects-createcert.js +46 -54
- package/public/browser/qcobjects-createcert.js.map +2 -2
- package/public/browser/qcobjects-gae-http-server.js +16 -24
- package/public/browser/qcobjects-gae-http-server.js.map +2 -2
- package/public/browser/qcobjects-http-server.js +16 -24
- package/public/browser/qcobjects-http-server.js.map +2 -2
- package/public/browser/qcobjects-http2-server.js +21 -30
- package/public/browser/qcobjects-http2-server.js.map +2 -2
- package/public/browser/qcobjects-shell.js.map +1 -1
- package/public/browser/templates/apps/spa-local.html +0 -0
- package/public/browser/templates/apps/spa-local.js +0 -0
- package/public/browser/templates/pwa/sw.js +0 -0
- package/public/browser/types/global/index.d.js +0 -9
- package/public/browser/types/global/index.d.js.map +3 -3
- package/public/cjs/api-client_services.js +74 -0
- package/public/cjs/api-client_services.js.map +1 -0
- package/public/cjs/backend/backend-microservice-static.js +255 -0
- package/public/cjs/backend/backend-microservice-static.js.map +1 -0
- package/public/cjs/backend/backend-php.js +317 -0
- package/public/cjs/backend/backend-php.js.map +1 -0
- package/public/cjs/cli-commands-build-esbuild.js +341 -0
- package/public/cjs/cli-commands-build-esbuild.js.map +1 -0
- package/public/cjs/cli-commands-build-typescript.js +127 -0
- package/public/cjs/cli-commands-build-typescript.js.map +1 -0
- package/public/cjs/cli-commands-jira.js +115 -0
- package/public/cjs/cli-commands-jira.js.map +1 -0
- package/public/cjs/cli-commands-publish-static.js +108 -0
- package/public/cjs/cli-commands-publish-static.js.map +1 -0
- package/public/cjs/cli-commands-version.js +250 -0
- package/public/cjs/cli-commands-version.js.map +1 -0
- package/public/cjs/cli-commands.js +73 -0
- package/public/cjs/cli-commands.js.map +1 -0
- package/public/cjs/cli-main.js +487 -0
- package/public/cjs/cli-main.js.map +1 -0
- package/public/cjs/client_services.js +80 -0
- package/public/cjs/client_services.js.map +1 -0
- package/public/cjs/collab-server.js +404 -0
- package/public/cjs/collab-server.js.map +1 -0
- package/public/cjs/common-pipelog.js +57 -0
- package/public/cjs/common-pipelog.js.map +1 -0
- package/public/cjs/defaultsettings.js +496 -0
- package/public/cjs/defaultsettings.js.map +1 -0
- package/public/cjs/enterprise-commands.js +173 -0
- package/public/cjs/enterprise-commands.js.map +1 -0
- package/public/cjs/index.js +38 -0
- package/public/cjs/index.js.map +1 -0
- package/public/cjs/main-file.js +161 -0
- package/public/cjs/main-file.js.map +1 -0
- package/public/cjs/main-http-gae-server.js +498 -0
- package/public/cjs/main-http-gae-server.js.map +1 -0
- package/public/cjs/main-http-server.js +540 -0
- package/public/cjs/main-http-server.js.map +1 -0
- package/public/cjs/main-http2-server.js +398 -0
- package/public/cjs/main-http2-server.js.map +1 -0
- package/public/cjs/qcobjects-cli.js +105 -0
- package/public/cjs/qcobjects-cli.js.map +1 -0
- package/public/cjs/qcobjects-collab.js +51 -0
- package/public/cjs/qcobjects-collab.js.map +1 -0
- package/public/cjs/qcobjects-createcert.js +89 -0
- package/public/cjs/qcobjects-createcert.js.map +1 -0
- package/public/cjs/qcobjects-gae-http-server.js +51 -0
- package/public/cjs/qcobjects-gae-http-server.js.map +1 -0
- package/public/cjs/qcobjects-http-server.js +51 -0
- package/public/cjs/qcobjects-http-server.js.map +1 -0
- package/public/cjs/qcobjects-http2-server.js +54 -0
- package/public/cjs/qcobjects-http2-server.js.map +1 -0
- package/public/cjs/qcobjects-shell.js +145 -0
- package/public/cjs/qcobjects-shell.js.map +1 -0
- package/public/cjs/templates/apps/spa-local.html +0 -0
- package/public/cjs/templates/apps/spa-local.js +0 -0
- package/public/cjs/templates/pwa/sw.js +0 -0
- package/public/esm/api-client_services.mjs.map +1 -1
- package/public/esm/backend/backend-microservice-static.mjs +207 -216
- package/public/esm/backend/backend-microservice-static.mjs.map +2 -2
- package/public/esm/backend/backend-php.mjs +228 -232
- package/public/esm/backend/backend-php.mjs.map +2 -2
- package/public/esm/cli-commands-build-esbuild.mjs +295 -0
- package/public/esm/cli-commands-build-esbuild.mjs.map +7 -0
- package/public/esm/cli-commands-build-typescript.mjs +83 -0
- package/public/esm/cli-commands-build-typescript.mjs.map +7 -0
- package/public/esm/cli-commands-jira.mjs +1 -1
- package/public/esm/cli-commands-jira.mjs.map +1 -1
- package/public/esm/cli-commands-version.mjs.map +1 -1
- package/public/esm/cli-commands.mjs +7 -3
- package/public/esm/cli-commands.mjs.map +2 -2
- package/public/esm/cli-main.mjs +6 -6
- package/public/esm/cli-main.mjs.map +1 -1
- package/public/esm/client_services.mjs.map +1 -1
- package/public/esm/collab-server.mjs.map +1 -1
- package/public/esm/common-pipelog.mjs.map +1 -1
- package/public/esm/defaultsettings.mjs +68 -27
- package/public/esm/defaultsettings.mjs.map +3 -3
- package/public/esm/enterprise-commands.mjs.map +1 -1
- package/public/esm/index.mjs +1 -1
- package/public/esm/main-file.mjs.map +1 -1
- package/public/esm/main-http-gae-server.mjs +2 -2
- package/public/esm/main-http-gae-server.mjs.map +1 -1
- package/public/esm/main-http-server.mjs +2 -2
- package/public/esm/main-http-server.mjs.map +1 -1
- package/public/esm/main-http2-server.mjs +2 -2
- package/public/esm/main-http2-server.mjs.map +1 -1
- package/public/esm/qcobjects-cli.mjs +2 -2
- package/public/esm/qcobjects-cli.mjs.map +1 -1
- package/public/esm/qcobjects-collab.mjs +14 -23
- package/public/esm/qcobjects-collab.mjs.map +2 -2
- package/public/esm/qcobjects-createcert.mjs +43 -52
- package/public/esm/qcobjects-createcert.mjs.map +2 -2
- package/public/esm/qcobjects-gae-http-server.mjs +14 -23
- package/public/esm/qcobjects-gae-http-server.mjs.map +2 -2
- package/public/esm/qcobjects-http-server.mjs +14 -23
- package/public/esm/qcobjects-http-server.mjs.map +2 -2
- package/public/esm/qcobjects-http2-server.mjs +21 -31
- package/public/esm/qcobjects-http2-server.mjs.map +2 -2
- package/public/esm/qcobjects-shell.mjs +1 -1
- package/public/esm/qcobjects-shell.mjs.map +1 -1
- package/public/esm/templates/apps/spa-local.html +0 -0
- package/public/esm/templates/apps/spa-local.js +0 -0
- package/public/esm/templates/pwa/sw.js +0 -0
- package/public/esm/types/global/index.d.mjs +0 -9
- package/public/esm/types/global/index.d.mjs.map +3 -3
- package/public/types/index.d.ts +29 -3
- package/spec/support/jasmine.json +0 -0
- package/spec/testsSpec.ts +0 -0
- package/src/api-client_services.ts +1 -1
- package/src/backend/backend-microservice-static.ts +196 -196
- package/src/backend/backend-php.ts +240 -245
- package/src/cli-commands-build-esbuild.ts +375 -0
- package/src/cli-commands-build-typescript.ts +139 -0
- package/src/cli-commands-jira.ts +1 -1
- package/src/cli-commands-publish-static.ts +0 -0
- package/src/cli-commands-version.ts +1 -1
- package/src/cli-commands.ts +3 -1
- package/src/cli-main.ts +1 -1
- package/src/client_services.ts +1 -1
- package/src/collab-server.ts +1 -1
- package/src/common-pipelog.ts +1 -1
- package/src/defaultsettings.ts +65 -19
- package/src/enterprise-commands.ts +1 -1
- package/src/index.ts +0 -0
- package/src/main-file.ts +1 -1
- package/src/main-http-gae-server.ts +1 -1
- package/src/main-http-server.ts +1 -1
- package/src/main-http2-server.ts +1 -1
- package/src/qcobjects-cli.ts +1 -1
- package/src/qcobjects-collab.ts +1 -1
- package/src/qcobjects-createcert.ts +1 -1
- package/src/qcobjects-gae-http-server.ts +1 -1
- package/src/qcobjects-http-server.ts +1 -1
- package/src/qcobjects-http2-server.ts +4 -5
- package/src/qcobjects-shell.ts +1 -1
- package/src/templates/apps/spa-local.html +0 -0
- package/src/templates/apps/spa-local.js +0 -0
- package/src/templates/pwa/sw.js +0 -0
- package/src/types/global/index.d.ts +0 -0
- package/transpile.js +0 -0
- package/tsconfig.d.json +0 -0
- package/tsconfig.jasmine.json +0 -0
- package/tsconfig.json +3 -3
- package/public/cjs/api-client_services.cjs +0 -79
- package/public/cjs/api-client_services.cjs.map +0 -7
- package/public/cjs/backend/backend-microservice-static.cjs +0 -245
- package/public/cjs/backend/backend-microservice-static.cjs.map +0 -7
- package/public/cjs/backend/backend-php.cjs +0 -301
- package/public/cjs/backend/backend-php.cjs.map +0 -7
- package/public/cjs/cli-commands-jira.cjs +0 -112
- package/public/cjs/cli-commands-jira.cjs.map +0 -7
- package/public/cjs/cli-commands-publish-static.cjs +0 -109
- package/public/cjs/cli-commands-publish-static.cjs.map +0 -7
- package/public/cjs/cli-commands-version.cjs +0 -252
- package/public/cjs/cli-commands-version.cjs.map +0 -7
- package/public/cjs/cli-commands.cjs +0 -45
- package/public/cjs/cli-commands.cjs.map +0 -7
- package/public/cjs/cli-main.cjs +0 -417
- package/public/cjs/cli-main.cjs.map +0 -7
- package/public/cjs/client_services.cjs +0 -86
- package/public/cjs/client_services.cjs.map +0 -7
- package/public/cjs/collab-server.cjs +0 -444
- package/public/cjs/collab-server.cjs.map +0 -7
- package/public/cjs/common-pipelog.cjs +0 -50
- package/public/cjs/common-pipelog.cjs.map +0 -7
- package/public/cjs/defaultsettings.cjs +0 -432
- package/public/cjs/defaultsettings.cjs.map +0 -7
- package/public/cjs/enterprise-commands.cjs +0 -175
- package/public/cjs/enterprise-commands.cjs.map +0 -7
- package/public/cjs/index.cjs +0 -36
- package/public/cjs/index.cjs.map +0 -7
- package/public/cjs/main-file.cjs +0 -194
- package/public/cjs/main-file.cjs.map +0 -7
- package/public/cjs/main-http-gae-server.cjs +0 -522
- package/public/cjs/main-http-gae-server.cjs.map +0 -7
- package/public/cjs/main-http-server.cjs +0 -588
- package/public/cjs/main-http-server.cjs.map +0 -7
- package/public/cjs/main-http2-server.cjs +0 -431
- package/public/cjs/main-http2-server.cjs.map +0 -7
- package/public/cjs/qcobjects-cli.cjs +0 -92
- package/public/cjs/qcobjects-cli.cjs.map +0 -7
- package/public/cjs/qcobjects-collab.cjs +0 -43
- package/public/cjs/qcobjects-collab.cjs.map +0 -7
- package/public/cjs/qcobjects-createcert.cjs +0 -75
- package/public/cjs/qcobjects-createcert.cjs.map +0 -7
- package/public/cjs/qcobjects-gae-http-server.cjs +0 -43
- package/public/cjs/qcobjects-gae-http-server.cjs.map +0 -7
- package/public/cjs/qcobjects-http-server.cjs +0 -43
- package/public/cjs/qcobjects-http-server.cjs.map +0 -7
- package/public/cjs/qcobjects-http2-server.cjs +0 -49
- package/public/cjs/qcobjects-http2-server.cjs.map +0 -7
- package/public/cjs/qcobjects-shell.cjs +0 -185
- package/public/cjs/qcobjects-shell.cjs.map +0 -7
- package/public/cjs/types/global/index.d.cjs +0 -2
- package/public/cjs/types/global/index.d.cjs.map +0 -7
- package/public/types/index.d.ts.map +0 -1
- package/src/index.cts +0 -2
- package/src/index.mts +0 -2
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
5
|
+
import fs from "node:fs/promises";
|
|
6
|
+
import glob from "glob";
|
|
7
|
+
import esbuild from "esbuild";
|
|
8
|
+
import alias from "esbuild-plugin-alias";
|
|
9
|
+
import { Package, InheritClass, logger } from "qcobjects";
|
|
10
|
+
const externalPackages = [
|
|
11
|
+
"node:fs",
|
|
12
|
+
"node:path",
|
|
13
|
+
"node:os",
|
|
14
|
+
"node:util",
|
|
15
|
+
"node:events",
|
|
16
|
+
"node:stream",
|
|
17
|
+
"node:http",
|
|
18
|
+
"node:https",
|
|
19
|
+
"node:crypto",
|
|
20
|
+
"node:zlib",
|
|
21
|
+
"node:buffer",
|
|
22
|
+
"node:url",
|
|
23
|
+
"node:querystring",
|
|
24
|
+
"node:child_process",
|
|
25
|
+
"node:cluster",
|
|
26
|
+
"node:dgram",
|
|
27
|
+
"node:dns",
|
|
28
|
+
"node:net",
|
|
29
|
+
"node:readline",
|
|
30
|
+
"node:repl",
|
|
31
|
+
"node:tls",
|
|
32
|
+
"node:tty",
|
|
33
|
+
"node:vm",
|
|
34
|
+
"node:worker_threads"
|
|
35
|
+
];
|
|
36
|
+
const nameToExtension = /* @__PURE__ */ __name((name, ext, settings) => {
|
|
37
|
+
function isPackage(name2) {
|
|
38
|
+
return !name2.startsWith(".") && !name2.startsWith("/") && !name2.includes("/");
|
|
39
|
+
}
|
|
40
|
+
__name(isPackage, "isPackage");
|
|
41
|
+
const hasExtension = /\.[^/\\]+$/.test(name);
|
|
42
|
+
const isExternalPackage = name.startsWith("qcobjects") || name.startsWith("qcobjects-sdk") || name.startsWith("node:") || name.startsWith("fs") || name.startsWith("path") || name.startsWith("os") || name.startsWith("util") || name.startsWith("events") || name.startsWith("stream") || name.startsWith("http") || name.startsWith("https") || name.startsWith("crypto") || name.startsWith("zlib") || name.startsWith("buffer") || name.startsWith("url") || name.startsWith("querystring") || name.startsWith("child_process") || name.startsWith("cluster") || name.startsWith("dgram") || name.startsWith("dns") || name.startsWith("net") || name.startsWith("readline") || name.startsWith("repl") || name.startsWith("tls") || name.startsWith("tty") || name.startsWith("vm") || name.startsWith("worker_threads") || externalPackages.includes(name);
|
|
43
|
+
if (!hasExtension && !isPackage(name) && !isExternalPackage) {
|
|
44
|
+
name += ext;
|
|
45
|
+
}
|
|
46
|
+
return name;
|
|
47
|
+
}, "nameToExtension");
|
|
48
|
+
const addExtensions = /* @__PURE__ */ __name((filePath, toExt, settings) => {
|
|
49
|
+
const content = readFileSync(filePath, "utf8");
|
|
50
|
+
const updatedContent = content.replace(/(from\s+['"])(.*?)(['"])/g, (match, p1, p2, p3) => {
|
|
51
|
+
return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;
|
|
52
|
+
}).replace(/(import\s+['"])(.*?)(['"])/g, (match, p1, p2, p3) => {
|
|
53
|
+
return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;
|
|
54
|
+
}).replace(/(export\s+['"])(.*?)(['"])/g, (match, p1, p2, p3) => {
|
|
55
|
+
return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;
|
|
56
|
+
}).replace(/(require\s*\(\s*['"])(.*?)(['"]\s*\))/g, (match, p1, p2, p3) => {
|
|
57
|
+
return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;
|
|
58
|
+
});
|
|
59
|
+
writeFileSync(filePath, updatedContent, "utf8");
|
|
60
|
+
}, "addExtensions");
|
|
61
|
+
const copyDir = /* @__PURE__ */ __name(async (source, dest, exclude) => {
|
|
62
|
+
source = path.resolve(source);
|
|
63
|
+
dest = path.resolve(dest);
|
|
64
|
+
const dname = path.basename(source);
|
|
65
|
+
const dirExcluded = exclude.includes(dname);
|
|
66
|
+
const isDir = /* @__PURE__ */ __name(async (d) => {
|
|
67
|
+
try {
|
|
68
|
+
const stat = await fs.stat(d);
|
|
69
|
+
return stat.isDirectory();
|
|
70
|
+
} catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}, "isDir");
|
|
74
|
+
const isFile = /* @__PURE__ */ __name(async (d) => {
|
|
75
|
+
try {
|
|
76
|
+
const stat = await fs.stat(d);
|
|
77
|
+
return stat.isFile();
|
|
78
|
+
} catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}, "isFile");
|
|
82
|
+
if (await isDir(source) && !dirExcluded) {
|
|
83
|
+
await fs.mkdir(dest, { recursive: true });
|
|
84
|
+
const paths = await fs.readdir(source, { withFileTypes: true });
|
|
85
|
+
const dirs = paths.filter((d) => d.isDirectory());
|
|
86
|
+
const files = paths.filter((f) => f.isFile());
|
|
87
|
+
for (const f of files) {
|
|
88
|
+
const sourceFile = path.resolve(source, f.name);
|
|
89
|
+
const destFile = path.resolve(dest, f.name);
|
|
90
|
+
const fileExcluded = exclude.includes(f.name);
|
|
91
|
+
if (await isFile(sourceFile) && !fileExcluded) {
|
|
92
|
+
logger.debug(`[build:esbuild] Copying files from ${sourceFile} to ${destFile} excluding ${exclude}...`);
|
|
93
|
+
await fs.copyFile(sourceFile, destFile);
|
|
94
|
+
logger.debug(`[build:esbuild] Copying files from ${sourceFile} to ${destFile} excluding ${exclude}...DONE!`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const d of dirs) {
|
|
98
|
+
const sourceDir = path.resolve(source, d.name);
|
|
99
|
+
const destDir = path.resolve(dest, d.name);
|
|
100
|
+
await copyDir(sourceDir, destDir, exclude);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, "copyDir");
|
|
104
|
+
const ignorePlugin = {
|
|
105
|
+
name: "transform-qcobjects-imports",
|
|
106
|
+
setup(build) {
|
|
107
|
+
build.onResolve({ filter: /^(qcobjects|qcobjects-sdk)$/ }, (args) => {
|
|
108
|
+
if (args.kind === "dynamic-import") {
|
|
109
|
+
return {
|
|
110
|
+
path: args.path,
|
|
111
|
+
namespace: "qcobjects-transform"
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
external: true,
|
|
116
|
+
path: args.path
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
build.onResolve({ filter: /.*/, namespace: "file" }, (args) => {
|
|
120
|
+
if (args.kind === "dynamic-import") {
|
|
121
|
+
return {
|
|
122
|
+
external: true,
|
|
123
|
+
path: args.path
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
});
|
|
128
|
+
build.onLoad({ filter: /.*/, namespace: "qcobjects-transform" }, (args) => {
|
|
129
|
+
return {
|
|
130
|
+
contents: `
|
|
131
|
+
module.exports = __toESM(require("${args.path}"), true);
|
|
132
|
+
`,
|
|
133
|
+
loader: "js"
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
class CommandHandler extends InheritClass {
|
|
139
|
+
static {
|
|
140
|
+
__name(this, "CommandHandler");
|
|
141
|
+
}
|
|
142
|
+
choiceOption;
|
|
143
|
+
constructor({
|
|
144
|
+
switchCommander
|
|
145
|
+
}) {
|
|
146
|
+
super({ switchCommander });
|
|
147
|
+
this.choiceOption = {
|
|
148
|
+
async build_esbuild() {
|
|
149
|
+
try {
|
|
150
|
+
logger.info("[build:esbuild] Starting esbuild process...");
|
|
151
|
+
const entryPoints = glob.sync("src/**/*.ts");
|
|
152
|
+
await copyDir("./src/templates", "./build/templates", []);
|
|
153
|
+
await copyDir("./src/templates", "./public/cjs/templates", []);
|
|
154
|
+
await copyDir("./src/templates", "./public/esm/templates", []);
|
|
155
|
+
await copyDir("./src/templates", "./public/browser/templates", []);
|
|
156
|
+
const baseSettings = {
|
|
157
|
+
entryPoints,
|
|
158
|
+
bundle: false,
|
|
159
|
+
outdir: "public/cjs",
|
|
160
|
+
format: "cjs",
|
|
161
|
+
target: ["node22"],
|
|
162
|
+
tsconfig: "tsconfig.json",
|
|
163
|
+
globalName: "global",
|
|
164
|
+
minify: false,
|
|
165
|
+
keepNames: true,
|
|
166
|
+
sourcemap: true,
|
|
167
|
+
splitting: false,
|
|
168
|
+
chunkNames: "chunks/[name]-[hash]",
|
|
169
|
+
plugins: [
|
|
170
|
+
ignorePlugin,
|
|
171
|
+
alias({
|
|
172
|
+
"types": path.join(process.cwd(), "src/types/global/index.d.ts")
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
};
|
|
176
|
+
const cjsSettings = {
|
|
177
|
+
...baseSettings,
|
|
178
|
+
outdir: "public/cjs",
|
|
179
|
+
format: "cjs",
|
|
180
|
+
platform: "node",
|
|
181
|
+
outExtension: {
|
|
182
|
+
".js": ".cjs"
|
|
183
|
+
},
|
|
184
|
+
plugins: [
|
|
185
|
+
ignorePlugin,
|
|
186
|
+
{
|
|
187
|
+
name: "transform-dynamic-imports",
|
|
188
|
+
setup(build) {
|
|
189
|
+
build.onEnd(() => {
|
|
190
|
+
const files = glob.sync("public/cjs/**/*.cjs");
|
|
191
|
+
for (const file of files) {
|
|
192
|
+
let content = readFileSync(file, "utf8");
|
|
193
|
+
content = content.replace(
|
|
194
|
+
/await\s+import\(['"]([^'"]+)['"]\)/g,
|
|
195
|
+
'__toESM(require("$1"), true)'
|
|
196
|
+
);
|
|
197
|
+
writeFileSync(file, content, "utf8");
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "add-extensions",
|
|
204
|
+
setup(build) {
|
|
205
|
+
build.onEnd(() => {
|
|
206
|
+
entryPoints.forEach((entry) => {
|
|
207
|
+
const outputFilePath = path.join("./public/cjs", entry.replace("src/", "").replace(".ts", ".cjs"));
|
|
208
|
+
addExtensions(outputFilePath, ".cjs", cjsSettings);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
const esmSettings = {
|
|
216
|
+
...baseSettings,
|
|
217
|
+
outdir: "public/esm",
|
|
218
|
+
format: "esm",
|
|
219
|
+
platform: "browser",
|
|
220
|
+
outExtension: {
|
|
221
|
+
".js": ".mjs"
|
|
222
|
+
},
|
|
223
|
+
plugins: [
|
|
224
|
+
{
|
|
225
|
+
name: "transform-requires",
|
|
226
|
+
setup(build) {
|
|
227
|
+
build.onEnd(() => {
|
|
228
|
+
const files = glob.sync("public/esm/**/*.mjs");
|
|
229
|
+
for (const file of files) {
|
|
230
|
+
let content = readFileSync(file, "utf8");
|
|
231
|
+
content = content.replace(
|
|
232
|
+
/const\s+{([^}]+)}\s*=\s*require\(['"]([^'"]+)['"]\)/g,
|
|
233
|
+
'import { $1 } from "$2"'
|
|
234
|
+
);
|
|
235
|
+
content = content.replace(
|
|
236
|
+
/const\s+([^=]+)\s*=\s*require\(['"]([^'"]+)['"]\)/g,
|
|
237
|
+
'import $1 from "$2"'
|
|
238
|
+
);
|
|
239
|
+
writeFileSync(file, content, "utf8");
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "add-extensions",
|
|
246
|
+
setup(build) {
|
|
247
|
+
build.onEnd(() => {
|
|
248
|
+
entryPoints.forEach((entry) => {
|
|
249
|
+
const outputFilePath = path.join("./public/esm", entry.replace("src/", "").replace(".ts", ".mjs"));
|
|
250
|
+
addExtensions(outputFilePath, ".mjs", esmSettings);
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
};
|
|
257
|
+
const browserSettings = {
|
|
258
|
+
...baseSettings,
|
|
259
|
+
outdir: "public/browser",
|
|
260
|
+
format: "iife",
|
|
261
|
+
platform: "browser",
|
|
262
|
+
outExtension: {
|
|
263
|
+
".js": ".js"
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
await Promise.all([
|
|
267
|
+
esbuild.build(cjsSettings),
|
|
268
|
+
esbuild.build(esmSettings),
|
|
269
|
+
esbuild.build(browserSettings)
|
|
270
|
+
]);
|
|
271
|
+
logger.info("[build:esbuild] Build process completed successfully!");
|
|
272
|
+
} catch (e) {
|
|
273
|
+
logger.error(`[build:esbuild] Build process failed: ${e.message}`);
|
|
274
|
+
process.exit(1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
const commandHandler = this;
|
|
279
|
+
logger.debug("Loading command build:esbuild...");
|
|
280
|
+
switchCommander.program.command("build:esbuild").allowExcessArguments(false).description("Builds the project using esbuild for CJS, ESM, and browser formats").action(function() {
|
|
281
|
+
commandHandler.choiceOption.build_esbuild.call(commandHandler);
|
|
282
|
+
});
|
|
283
|
+
switchCommander.program.command("build:esb").allowExcessArguments(false).description("Alias for build:esbuild - Builds the project using esbuild").action(function() {
|
|
284
|
+
commandHandler.choiceOption.build_esbuild.call(commandHandler);
|
|
285
|
+
});
|
|
286
|
+
logger.debug("Loading command build:esbuild... DONE.");
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
Package("com.qcobjects.cli.commands.build.esbuild", [
|
|
290
|
+
CommandHandler
|
|
291
|
+
]);
|
|
292
|
+
export {
|
|
293
|
+
CommandHandler
|
|
294
|
+
};
|
|
295
|
+
//# sourceMappingURL=cli-commands-build-esbuild.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/cli-commands-build-esbuild.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * QCObjects CLI 2.5\n * ________________\n *\n * Author: Jean Machuca <correojean@gmail.com>\n *\n * Cross Browser Javascript Framework for MVC Patterns\n * QuickCorp/QCObjects is licensed under the\n * GNU Lesser General Public License v3.0\n * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)\n *\n * Permissions of this copyleft license are conditioned on making available\n * complete source code of licensed works and modifications under the same\n * license or the GNU GPLv3. Copyright and license notices must be preserved.\n * Contributors provide an express grant of patent rights. However, a larger\n * work using the licensed work through interfaces provided by the licensed\n * work may be distributed under different terms and without source code for\n * the larger work.\n *\n * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>\n *\n * Everyone is permitted to copy and distribute verbatim copies of this\n * license document, but changing it is not allowed.\n*/\n/*eslint no-unused-vars: \"off\"*/\n/*eslint no-redeclare: \"off\"*/\n/*eslint no-empty: \"off\"*/\n/*eslint strict: \"off\"*/\n/*eslint no-mixed-operators: \"off\"*/\n/*eslint no-undef: \"off\"*/\n\"use strict\";\nimport path from \"node:path\";\nimport { readFileSync, writeFileSync } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport glob from \"glob\";\nimport esbuild, { BuildOptions, Format } from \"esbuild\";\nimport alias from \"esbuild-plugin-alias\";\nimport { Package, InheritClass, logger } from \"qcobjects\";\n\nconst externalPackages = [\n \"node:fs\", \"node:path\", \"node:os\", \"node:util\", \"node:events\", \n \"node:stream\", \"node:http\", \"node:https\", \"node:crypto\", \"node:zlib\", \n \"node:buffer\", \"node:url\", \"node:querystring\", \"node:child_process\", \n \"node:cluster\", \"node:dgram\", \"node:dns\", \"node:net\", \"node:readline\", \n \"node:repl\", \"node:tls\", \"node:tty\", \"node:vm\", \"node:worker_threads\"\n];\n\n// Function to detect and add the extension\nconst nameToExtension = (name: string, ext: string, settings: BuildOptions): string => {\n function isPackage(name: string): boolean {\n return !name.startsWith(\".\") && !name.startsWith(\"/\") && !name.includes(\"/\");\n }\n\n const hasExtension = /\\.[^/\\\\]+$/.test(name);\n const isExternalPackage = name.startsWith(\"qcobjects\") || \n name.startsWith(\"qcobjects-sdk\") ||\n name.startsWith(\"node:\") ||\n name.startsWith(\"fs\") ||\n name.startsWith(\"path\") ||\n name.startsWith(\"os\") ||\n name.startsWith(\"util\") ||\n name.startsWith(\"events\") ||\n name.startsWith(\"stream\") ||\n name.startsWith(\"http\") ||\n name.startsWith(\"https\") ||\n name.startsWith(\"crypto\") ||\n name.startsWith(\"zlib\") ||\n name.startsWith(\"buffer\") ||\n name.startsWith(\"url\") ||\n name.startsWith(\"querystring\") ||\n name.startsWith(\"child_process\") ||\n name.startsWith(\"cluster\") ||\n name.startsWith(\"dgram\") ||\n name.startsWith(\"dns\") ||\n name.startsWith(\"net\") ||\n name.startsWith(\"readline\") ||\n name.startsWith(\"repl\") ||\n name.startsWith(\"tls\") ||\n name.startsWith(\"tty\") ||\n name.startsWith(\"vm\") ||\n name.startsWith(\"worker_threads\")\n || externalPackages.includes(name);\n \n if (!hasExtension && !isPackage(name) && !isExternalPackage) {\n name += ext;\n }\n\n return name;\n};\n\n// Function to add .cjs and .mjs extensions to import/export/require statements\nconst addExtensions = (filePath: string, toExt: string, settings: BuildOptions): void => {\n const content = readFileSync(filePath, \"utf8\");\n const updatedContent = content\n .replace(/(from\\s+['\"])(.*?)(['\"])/g, (match, p1, p2, p3) => {\n return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;\n })\n .replace(/(import\\s+['\"])(.*?)(['\"])/g, (match, p1, p2, p3) => {\n return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;\n })\n .replace(/(export\\s+['\"])(.*?)(['\"])/g, (match, p1, p2, p3) => {\n return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;\n })\n .replace(/(require\\s*\\(\\s*['\"])(.*?)(['\"]\\s*\\))/g, (match, p1, p2, p3) => {\n return `${p1}${nameToExtension(p2, toExt, settings)}${p3}`;\n });\n writeFileSync(filePath, updatedContent, \"utf8\");\n};\n\nconst copyDir = async (source: string, dest: string, exclude: string[]): Promise<void> => {\n source = path.resolve(source);\n dest = path.resolve(dest);\n const dname = path.basename(source);\n const dirExcluded = exclude.includes(dname);\n\n const isDir = async (d: string): Promise<boolean> => {\n try {\n const stat = await fs.stat(d);\n return stat.isDirectory();\n } catch {\n return false;\n }\n };\n\n const isFile = async (d: string): Promise<boolean> => {\n try {\n const stat = await fs.stat(d);\n return stat.isFile();\n } catch {\n return false;\n }\n };\n\n if (await isDir(source) && !dirExcluded) {\n await fs.mkdir(dest, { recursive: true });\n const paths = await fs.readdir(source, { withFileTypes: true });\n const dirs = paths.filter(d => d.isDirectory());\n const files = paths.filter(f => f.isFile());\n\n for (const f of files) {\n const sourceFile = path.resolve(source, f.name);\n const destFile = path.resolve(dest, f.name);\n const fileExcluded = exclude.includes(f.name);\n if (await isFile(sourceFile) && !fileExcluded) {\n logger.debug(`[build:esbuild] Copying files from ${sourceFile} to ${destFile} excluding ${exclude}...`);\n await fs.copyFile(sourceFile, destFile);\n logger.debug(`[build:esbuild] Copying files from ${sourceFile} to ${destFile} excluding ${exclude}...DONE!`);\n }\n }\n\n for (const d of dirs) {\n const sourceDir = path.resolve(source, d.name);\n const destDir = path.resolve(dest, d.name);\n await copyDir(sourceDir, destDir, exclude);\n }\n }\n};\n\nconst ignorePlugin = {\n name: \"transform-qcobjects-imports\",\n setup(build: any) {\n build.onResolve({ filter: /^(qcobjects|qcobjects-sdk)$/ }, (args: any) => {\n if (args.kind === \"dynamic-import\") {\n return { \n path: args.path,\n namespace: \"qcobjects-transform\"\n };\n }\n return {\n external: true,\n path: args.path\n };\n });\n\n build.onResolve({ filter: /.*/, namespace: \"file\" }, (args: any) => {\n if (args.kind === \"dynamic-import\") {\n return {\n external: true,\n path: args.path\n };\n }\n return null;\n });\n\n build.onLoad({ filter: /.*/, namespace: \"qcobjects-transform\" }, (args: any) => {\n return {\n contents: `\n module.exports = __toESM(require(\"${args.path}\"), true);\n `,\n loader: \"js\"\n };\n });\n }\n};\n\nexport class CommandHandler extends InheritClass {\n choiceOption: {\n [x: string]: any;\n build_esbuild: () => Promise<void>;\n };\n\n constructor({\n switchCommander\n }: { switchCommander: any }) {\n super({ switchCommander });\n this.choiceOption = {\n async build_esbuild() {\n try {\n logger.info(\"[build:esbuild] Starting esbuild process...\");\n\n // Get all TypeScript entry points\n const entryPoints = glob.sync(\"src/**/*.ts\");\n\n // Copy templates\n await copyDir(\"./src/templates\", \"./build/templates\", []);\n await copyDir(\"./src/templates\", \"./public/cjs/templates\", []);\n await copyDir(\"./src/templates\", \"./public/esm/templates\", []);\n await copyDir(\"./src/templates\", \"./public/browser/templates\", []);\n\n const baseSettings: BuildOptions = {\n entryPoints,\n bundle: false,\n outdir: \"public/cjs\",\n format: \"cjs\" as Format, \n target: [\"node22\"],\n tsconfig: \"tsconfig.json\",\n globalName: \"global\",\n minify: false,\n keepNames: true,\n sourcemap: true,\n splitting: false,\n chunkNames: \"chunks/[name]-[hash]\",\n plugins: [\n ignorePlugin,\n alias({\n \"types\": path.join(process.cwd(), \"src/types/global/index.d.ts\")\n })\n ]\n };\n\n const cjsSettings: BuildOptions = {\n ...baseSettings,\n outdir: \"public/cjs\",\n format: \"cjs\" as Format,\n platform: \"node\",\n outExtension: {\n \".js\": \".cjs\"\n },\n plugins: [\n ignorePlugin,\n {\n name: \"transform-dynamic-imports\",\n setup(build: any) {\n build.onEnd(() => {\n const files = glob.sync(\"public/cjs/**/*.cjs\");\n for (const file of files) {\n let content = readFileSync(file, \"utf8\");\n content = content.replace(\n /await\\s+import\\(['\"]([^'\"]+)['\"]\\)/g,\n \"__toESM(require(\\\"$1\\\"), true)\"\n );\n writeFileSync(file, content, \"utf8\");\n }\n });\n }\n },\n {\n name: \"add-extensions\",\n setup(build: any) {\n build.onEnd(() => {\n entryPoints.forEach((entry: string) => {\n const outputFilePath = path.join(\"./public/cjs\", entry.replace(\"src/\", \"\").replace(\".ts\", \".cjs\"));\n addExtensions(outputFilePath, \".cjs\", cjsSettings);\n });\n });\n }\n }\n ]\n };\n\n const esmSettings: BuildOptions = {\n ...baseSettings,\n outdir: \"public/esm\",\n format: \"esm\" as Format,\n platform: \"browser\",\n outExtension: {\n \".js\": \".mjs\"\n },\n plugins: [\n {\n name: \"transform-requires\",\n setup(build: any) {\n build.onEnd(() => {\n const files = glob.sync(\"public/esm/**/*.mjs\");\n for (const file of files) {\n let content = readFileSync(file, \"utf8\");\n // Transform require statements to dynamic imports\n content = content.replace(\n /const\\s+{([^}]+)}\\s*=\\s*require\\(['\"]([^'\"]+)['\"]\\)/g,\n \"import { $1 } from \\\"$2\\\"\"\n );\n content = content.replace(\n /const\\s+([^=]+)\\s*=\\s*require\\(['\"]([^'\"]+)['\"]\\)/g,\n \"import $1 from \\\"$2\\\"\"\n );\n writeFileSync(file, content, \"utf8\");\n }\n });\n }\n },\n {\n name: \"add-extensions\",\n setup(build: any) {\n build.onEnd(() => {\n entryPoints.forEach((entry: string) => {\n const outputFilePath = path.join(\"./public/esm\", entry.replace(\"src/\", \"\").replace(\".ts\", \".mjs\"));\n addExtensions(outputFilePath, \".mjs\", esmSettings);\n });\n });\n }\n }\n ]\n };\n\n const browserSettings: BuildOptions = {\n ...baseSettings,\n outdir: \"public/browser\",\n format: \"iife\" as Format,\n platform: \"browser\",\n outExtension: {\n \".js\": \".js\"\n }\n };\n\n // Build all formats\n await Promise.all([\n esbuild.build(cjsSettings),\n esbuild.build(esmSettings),\n esbuild.build(browserSettings)\n ]);\n\n logger.info(\"[build:esbuild] Build process completed successfully!\");\n } catch (e: any) {\n logger.error(`[build:esbuild] Build process failed: ${e.message}`);\n process.exit(1);\n }\n }\n };\n\n const commandHandler = this;\n logger.debug(\"Loading command build:esbuild...\");\n\n // Register both commands\n switchCommander.program.command(\"build:esbuild\")\n .allowExcessArguments(false)\n .description(\"Builds the project using esbuild for CJS, ESM, and browser formats\")\n .action(function () {\n commandHandler.choiceOption.build_esbuild.call(commandHandler);\n });\n\n // Add alias\n switchCommander.program.command(\"build:esb\")\n .allowExcessArguments(false)\n .description(\"Alias for build:esbuild - Builds the project using esbuild\")\n .action(function () {\n commandHandler.choiceOption.build_esbuild.call(commandHandler);\n });\n\n logger.debug(\"Loading command build:esbuild... DONE.\");\n }\n}\n\nPackage(\"com.qcobjects.cli.commands.build.esbuild\", [\n CommandHandler\n]);"],
|
|
5
|
+
"mappings": ";;AA+BA,OAAO,UAAU;AACjB,SAAS,cAAc,qBAAqB;AAC5C,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,aAAuC;AAC9C,OAAO,WAAW;AAClB,SAAS,SAAS,cAAc,cAAc;AAE9C,MAAM,mBAAmB;AAAA,EACvB;AAAA,EAAW;AAAA,EAAa;AAAA,EAAW;AAAA,EAAa;AAAA,EAChD;AAAA,EAAe;AAAA,EAAa;AAAA,EAAc;AAAA,EAAe;AAAA,EACzD;AAAA,EAAe;AAAA,EAAY;AAAA,EAAoB;AAAA,EAC/C;AAAA,EAAgB;AAAA,EAAc;AAAA,EAAY;AAAA,EAAY;AAAA,EACtD;AAAA,EAAa;AAAA,EAAY;AAAA,EAAY;AAAA,EAAW;AAClD;AAGA,MAAM,kBAAkB,wBAAC,MAAc,KAAa,aAAmC;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
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import ts from "typescript";
|
|
5
|
+
import { Package, InheritClass, logger } from "qcobjects";
|
|
6
|
+
class CommandHandler extends InheritClass {
|
|
7
|
+
static {
|
|
8
|
+
__name(this, "CommandHandler");
|
|
9
|
+
}
|
|
10
|
+
choiceOption;
|
|
11
|
+
constructor({
|
|
12
|
+
switchCommander
|
|
13
|
+
}) {
|
|
14
|
+
super({ switchCommander });
|
|
15
|
+
this.choiceOption = {
|
|
16
|
+
build_typescript(configFile) {
|
|
17
|
+
try {
|
|
18
|
+
logger.info(`[build:typescript] Building TypeScript with config file: ${configFile}...`);
|
|
19
|
+
const configPath = path.resolve(process.cwd(), configFile);
|
|
20
|
+
const parsedCommandLine = ts.getParsedCommandLineOfConfigFile(configPath, {}, {
|
|
21
|
+
...ts.sys,
|
|
22
|
+
onUnRecoverableConfigFileDiagnostic: /* @__PURE__ */ __name((diagnostic) => {
|
|
23
|
+
logger.warn(ts.formatDiagnostic(diagnostic, {
|
|
24
|
+
getCanonicalFileName: /* @__PURE__ */ __name((fileName) => fileName, "getCanonicalFileName"),
|
|
25
|
+
getCurrentDirectory: ts.sys.getCurrentDirectory,
|
|
26
|
+
getNewLine: /* @__PURE__ */ __name(() => ts.sys.newLine, "getNewLine")
|
|
27
|
+
}));
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}, "onUnRecoverableConfigFileDiagnostic")
|
|
30
|
+
});
|
|
31
|
+
if (!parsedCommandLine) {
|
|
32
|
+
logger.warn("Failed to parse tsconfig file");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
const program = ts.createProgram({
|
|
36
|
+
rootNames: parsedCommandLine.fileNames,
|
|
37
|
+
options: parsedCommandLine.options
|
|
38
|
+
});
|
|
39
|
+
const emitResult = program.emit();
|
|
40
|
+
const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
41
|
+
allDiagnostics.forEach((diagnostic) => {
|
|
42
|
+
if (diagnostic.file && diagnostic.start) {
|
|
43
|
+
const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
|
|
44
|
+
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
45
|
+
logger.warn(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
|
46
|
+
} else {
|
|
47
|
+
logger.warn(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const emittedFiles = emitResult.emittedFiles || [];
|
|
51
|
+
if (emittedFiles.length > 0) {
|
|
52
|
+
logger.info("Emitted files:");
|
|
53
|
+
emittedFiles.forEach((file) => logger.info(file));
|
|
54
|
+
}
|
|
55
|
+
const exitCode = emitResult.emitSkipped ? 1 : 0;
|
|
56
|
+
logger.info(`Process completed with code '${exitCode}'.`);
|
|
57
|
+
if (exitCode !== 0) {
|
|
58
|
+
process.exit(exitCode);
|
|
59
|
+
}
|
|
60
|
+
} catch (e) {
|
|
61
|
+
logger.warn(`Something went wrong trying to build TypeScript: ${e.message}`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const commandHandler = this;
|
|
67
|
+
logger.debug("Loading command build:typescript...");
|
|
68
|
+
const buildCommand = switchCommander.program.command("build:typescript <configFile>").allowExcessArguments(false).description("Builds TypeScript files using the specified config file").action(function(configFile) {
|
|
69
|
+
commandHandler.choiceOption.build_typescript.call(commandHandler, configFile);
|
|
70
|
+
});
|
|
71
|
+
switchCommander.program.command("build:ts <configFile>").allowExcessArguments(false).description("Alias for build:typescript - Builds TypeScript files using the specified config file").action(function(configFile) {
|
|
72
|
+
commandHandler.choiceOption.build_typescript.call(commandHandler, configFile);
|
|
73
|
+
});
|
|
74
|
+
logger.debug("Loading command build:typescript... DONE.");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
Package("com.qcobjects.cli.commands.build.typescript", [
|
|
78
|
+
CommandHandler
|
|
79
|
+
]);
|
|
80
|
+
export {
|
|
81
|
+
CommandHandler
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=cli-commands-build-typescript.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/cli-commands-build-typescript.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * QCObjects CLI 2.5\n * ________________\n *\n * Author: Jean Machuca <correojean@gmail.com>\n *\n * Cross Browser Javascript Framework for MVC Patterns\n * QuickCorp/QCObjects is licensed under the\n * GNU Lesser General Public License v3.0\n * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)\n *\n * Permissions of this copyleft license are conditioned on making available\n * complete source code of licensed works and modifications under the same\n * license or the GNU GPLv3. Copyright and license notices must be preserved.\n * Contributors provide an express grant of patent rights. However, a larger\n * work using the licensed work through interfaces provided by the licensed\n * work may be distributed under different terms and without source code for\n * the larger work.\n *\n * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>\n *\n * Everyone is permitted to copy and distribute verbatim copies of this\n * license document, but changing it is not allowed.\n*/\n/*eslint no-unused-vars: \"off\"*/\n/*eslint no-redeclare: \"off\"*/\n/*eslint no-empty: \"off\"*/\n/*eslint strict: \"off\"*/\n/*eslint no-mixed-operators: \"off\"*/\n/*eslint no-undef: \"off\"*/\n\"use strict\";\nimport path from \"node:path\";\nimport ts from \"typescript\";\nimport { Package, InheritClass, logger } from \"qcobjects\";\n\nexport class CommandHandler extends InheritClass {\n choiceOption: {\n [x: string]: any;\n build_typescript: (configFile: string) => void;\n };\n\n constructor({\n switchCommander\n }: { switchCommander: any }) {\n super({ switchCommander });\n this.choiceOption = {\n build_typescript(configFile) {\n try {\n logger.info(`[build:typescript] Building TypeScript with config file: ${configFile}...`);\n \n // Resolve the path to the tsconfig file\n const configPath = path.resolve(process.cwd(), configFile);\n\n // Parse the tsconfig file\n const parsedCommandLine = ts.getParsedCommandLineOfConfigFile(configPath, {}, {\n ...ts.sys,\n onUnRecoverableConfigFileDiagnostic: diagnostic => {\n logger.warn(ts.formatDiagnostic(diagnostic, {\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n }));\n process.exit(1);\n }\n });\n\n if (!parsedCommandLine) {\n logger.warn('Failed to parse tsconfig file');\n process.exit(1);\n }\n\n // Create a program with the parsed settings\n const program = ts.createProgram({\n rootNames: parsedCommandLine.fileNames,\n options: parsedCommandLine.options,\n });\n\n // Emit the compiled files\n const emitResult = program.emit();\n\n // Report any diagnostics (errors or warnings)\n const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);\n\n allDiagnostics.forEach(diagnostic => {\n if (diagnostic.file && diagnostic.start) {\n const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\\n');\n logger.warn(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);\n } else {\n logger.warn(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\\n'));\n }\n });\n\n // Check if any files were emitted\n const emittedFiles = emitResult.emittedFiles || [];\n if (emittedFiles.length > 0) {\n logger.info('Emitted files:');\n emittedFiles.forEach(file => logger.info(file));\n }\n\n // Exit with an appropriate code\n const exitCode = emitResult.emitSkipped ? 1 : 0;\n logger.info(`Process completed with code '${exitCode}'.`);\n if (exitCode !== 0) {\n process.exit(exitCode);\n }\n } catch (e: any) {\n logger.warn(`Something went wrong trying to build TypeScript: ${e.message}`);\n process.exit(1);\n }\n }\n };\n\n const commandHandler = this;\n logger.debug(\"Loading command build:typescript...\");\n\n // Register both commands\n const buildCommand = switchCommander.program.command(\"build:typescript <configFile>\")\n .allowExcessArguments(false)\n .description(\"Builds TypeScript files using the specified config file\")\n .action(function (configFile: string) {\n commandHandler.choiceOption.build_typescript.call(commandHandler, configFile);\n });\n\n // Add alias\n switchCommander.program.command(\"build:ts <configFile>\")\n .allowExcessArguments(false)\n .description(\"Alias for build:typescript - Builds TypeScript files using the specified config file\")\n .action(function (configFile: string) {\n commandHandler.choiceOption.build_typescript.call(commandHandler, configFile);\n });\n\n logger.debug(\"Loading command build:typescript... DONE.\");\n }\n}\n\nPackage(\"com.qcobjects.cli.commands.build.typescript\", [\n CommandHandler\n]); "],
|
|
5
|
+
"mappings": ";;AA+BA,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,SAAS,cAAc,cAAc;AAEvC,MAAM,uBAAuB,aAAa;AAAA,EAnCjD,OAmCiD;AAAA;AAAA;AAAA,EAC/C;AAAA,EAKA,YAAY;AAAA,IACV;AAAA,EACF,GAA6B;AAC3B,UAAM,EAAE,gBAAgB,CAAC;AACzB,SAAK,eAAe;AAAA,MAClB,iBAAiB,YAAY;AAC3B,YAAI;AACF,iBAAO,KAAK,4DAA4D,UAAU,KAAK;AAGvF,gBAAM,aAAa,KAAK,QAAQ,QAAQ,IAAI,GAAG,UAAU;AAGzD,gBAAM,oBAAoB,GAAG,iCAAiC,YAAY,CAAC,GAAG;AAAA,YAC5E,GAAG,GAAG;AAAA,YACN,qCAAqC,uCAAc;AACjD,qBAAO,KAAK,GAAG,iBAAiB,YAAY;AAAA,gBAC1C,sBAAsB,wBAAC,aAAa,UAAd;AAAA,gBACtB,qBAAqB,GAAG,IAAI;AAAA,gBAC5B,YAAY,6BAAM,GAAG,IAAI,SAAb;AAAA,cACd,CAAC,CAAC;AACF,sBAAQ,KAAK,CAAC;AAAA,YAChB,GAPqC;AAAA,UAQvC,CAAC;AAED,cAAI,CAAC,mBAAmB;AACtB,mBAAO,KAAK,+BAA+B;AAC3C,oBAAQ,KAAK,CAAC;AAAA,UAChB;AAGA,gBAAM,UAAU,GAAG,cAAc;AAAA,YAC/B,WAAW,kBAAkB;AAAA,YAC7B,SAAS,kBAA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AAqB,KAAK,EAC1B,YAAY,sFAAsF,EAClG,OAAO,SAAU,YAAoB;AACpC,qBAAe,aAAa,iBAAiB,KAAK,gBAAgB,UAAU;AAAA,IAC9E,CAAC;AAEH,WAAO,MAAM,2CAA2C;AAAA,EAC1D;AACF;AAEA,QAAQ,+CAA+C;AAAA,EACrD;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { JiraCloud } from "./client_services
|
|
4
|
+
import { JiraCloud } from "./client_services";
|
|
5
5
|
import { Package, InheritClass, _DataStringify, New, CONFIG, logger } from "qcobjects";
|
|
6
6
|
const absolutePath = path.resolve(__dirname, "./");
|
|
7
7
|
class CommandHandler extends InheritClass {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cli-commands-jira.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * QCObjects CLI 2.
|
|
4
|
+
"sourcesContent": ["/**\n * QCObjects CLI 2.5\n * ________________\n *\n * Author: Jean Machuca <correojean@gmail.com>\n *\n * Cross Browser Javascript Framework for MVC Patterns\n * QuickCorp/QCObjects is licensed under the\n * GNU Lesser General Public License v3.0\n * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)\n *\n * Permissions of this copyleft license are conditioned on making available\n * complete source code of licensed works and modifications under the same\n * license or the GNU GPLv3. Copyright and license notices must be preserved.\n * Contributors provide an express grant of patent rights. However, a larger\n * work using the licensed work through interfaces provided by the licensed\n * work may be distributed under different terms and without source code for\n * the larger work.\n *\n * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>\n *\n * Everyone is permitted to copy and distribute verbatim copies of this\n * license document, but changing it is not allowed.\n*/\n/*eslint no-unused-vars: \"off\"*/\n/*eslint no-redeclare: \"off\"*/\n/*eslint no-empty: \"off\"*/\n/*eslint strict: \"off\"*/\n/*eslint no-mixed-operators: \"off\"*/\n/*eslint no-undef: \"off\"*/\n\"use strict\";\nimport path from \"node:path\";\n\nimport { JiraCloud } from \"./client_services\";\nimport { Package, InheritClass, _DataStringify, New, CONFIG, logger } from \"qcobjects\";\nconst absolutePath = path.resolve(__dirname, \"./\");\n\nexport class CommandHandler extends InheritClass {\n choiceOption: {\n [x: string]: any; issues: () => void;\n };\n constructor({\n switchCommander\n }: { switchCommander: any }) {\n super({ switchCommander });\n this.choiceOption = {\n issues: function () {\n\n this.getIssueList().then(function (response: any) {\n console.log(_DataStringify(response));\n }).catch((e: any) => {\n console.log(e);\n process.exit(1);\n });\n\n }\n };\n\n const commandHandler = this;\n\n switchCommander.program.command(\"jira <subcommand>\")\n .option(\"-u, --from-user [username]\", \"User name\")\n .option(\"-fp,--from-project <projectName>\", \"Project name\")\n .option(\"-p, --pwd <password>\", \"Password\")\n .option(\"-f, --format <format>\", \"Format (json, table)\")\n .description(`Jira Integration:\n Sub-Commands can be:\n issues: To get the issues list from JIRA\n `)\n .action(function (subcommand: string | number, options: any) {\n if (commandHandler.choiceOption.hasOwnProperty.call(commandHandler.choiceOption, subcommand)) {\n commandHandler.choiceOption[subcommand].call(commandHandler, subcommand, options);\n } else {\n console.error(`Sub-Command (jira ${subcommand}... ) is not available`);\n process.exit(1);\n }\n });\n\n }\n\n getIssueList() {\n return new Promise<void>(function (resolve, reject) {\n logger.info(\"I'm going to get the issue list from the jira cloud...\");\n const jira_config = CONFIG.get(\"jira\", null);\n if (jira_config !== null) {\n const jira_username = jira_config.username;\n const jira_password = jira_config.auth_token;\n const jira_project = jira_config.project;\n const jira_domain = jira_config.domain;\n const jira_issue_fields = [\"id\", \"key\", \"summary\", \"timetracking\"];\n const cloudClient = New(JiraCloud, {\n domain: `${jira_domain}`,\n username: `${jira_username}`,\n password: `${jira_password}`,\n apiMethod: \"rest/api/latest/search\",\n data: {\n \"jql\": `project = ${jira_project}`,\n \"startAt\": 0,\n \"maxResults\": 5000,\n \"fields\": jira_issue_fields\n }\n });\n try {\n } catch (e) {\n console.error(\"\\u{1F926} Something went wrong \\u{1F926} when trying to get jira issues from the cloud\");\n reject(e as Error);\n }\n\n } else {\n console.error(\"\\u{1F926} Something went wrong \\u{1F926} You need to set the jira config settings\");\n reject(new Error(\"\\u{1F926} Something went wrong \\u{1F926} You need to set the jira config settings\"));\n }\n\n });\n }\n\n\n}\n\n\nPackage(\"com.qcobjects.cli.commands.jira\", [\n CommandHandler\n]);\n"],
|
|
5
5
|
"mappings": ";;AA+BA,OAAO,UAAU;AAEjB,SAAS,iBAAiB;AAC1B,SAAS,SAAS,cAAc,gBAAgB,KAAK,QAAQ,cAAc;AAC3E,MAAM,eAAe,KAAK,QAAQ,WAAW,IAAI;AAE1C,MAAM,uBAAuB,aAAa;AAAA,EArCjD,OAqCiD;AAAA;AAAA;AAAA,EAC/C;AAAA,EAGA,YAAY;AAAA,IACV;AAAA,EACF,GAA6B;AAC3B,UAAM,EAAE,gBAAgB,CAAC;AACzB,SAAK,eAAe;AAAA,MAClB,QAAQ,kCAAY;AAElB,aAAK,aAAa,EAAE,KAAK,SAAU,UAAe;AAChD,kBAAQ,IAAI,eAAe,QAAQ,CAAC;AAAA,QACtC,CAAC,EAAE,MAAM,CAAC,MAAW;AACnB,kBAAQ,IAAI,CAAC;AACb,kBAAQ,KAAK,CAAC;AAAA,QAChB,CAAC;AAAA,MAEH,GATQ;AAAA,IAUV;AAEA,UAAM,iBAAiB;AAEvB,oBAAgB,QAAQ,QAAQ,mBAAmB,EAChD,OAAO,8BAA8B,WAAW,EAChD,OAAO,oCAAoC,cAAc,EACzD,OAAO,wBAAwB,UAAU,EACzC,OAAO,yBAAyB,sBAAsB,EACtD,YAAY;AAAA;AAAA;AAAA,SAGV,EACF,OAAO,SAAU,YAA6B,SAAc;AAC3D,UAAI,eAAe,aAAa,eAAe,KAAK,e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I 2.4.x\n * ________________\n *\n * Author: Jean Machuca <correojean@gmail.com>\n *\n * Cross Browser Javascript Framework for MVC Patterns\n * QuickCorp/QCObjects is licensed under the\n * GNU Lesser General Public License v3.0\n * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)\n *\n * Permissions of this copyleft license are conditioned on making available\n * complete source code of licensed works and modifications under the same\n * license or the GNU GPLv3. Copyright and license notices must be preserved.\n * Contributors provide an express grant of patent rights. However, a larger\n * work using the licensed work through interfaces provided by the licensed\n * work may be distributed under different terms and without source code for\n * the larger work.\n *\n * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>\n *\n * Everyone is permitted to copy and distribute verbatim copies of this\n * license document, but changing it is not allowed.\n*/\n/*eslint no-unused-vars: \"off\"*/\n/*eslint no-redeclare: \"off\"*/\n/*eslint no-empty: \"off\"*/\n/*eslint strict: \"off\"*/\n/*eslint no-mixed-operators: \"off\"*/\n/*eslint no-undef: \"off\"*/\n\"use strict\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { exec, execSync } from \"node:child_process\";\n\nimport { Package, InheritClass, logger } from \"qcobjects\";\nimport { SwitchCommander } from \"./cli-main\";\n\nexport class CommandHandler extends InheritClass {\n choiceOption: {\n getVersionStringFromFile(filename: string): string;\n parseVersionSuffix(versionString: any): string;\n parseVersionString(versionString: any): string;\n buildNewVersionString(arg0: { major: number; minor: number; patch: number; }, versionSuffix: any): string;\n saveNewVersionFile(filename: string, newVersion: any): string;\n syncGit(newVersion: any, commitMsg: any, syncNpm: any): string;\n switchCommander: any; v_major(filename: string, options: any): void; v_minor(filename: string, options: any): void; v_patch(filename: string, options: any): void; v_sync(filename: string, options: any): void; v_changelog(): void;\n };\n switchCommander: SwitchCommander;\n\n constructor({ switchCommander }:{switchCommander:SwitchCommander}) {\n super({ switchCommander });\n this.switchCommander = switchCommander;\n\n const commandHandler = this;\n\n this.choiceOption = {\n v_major(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n const versionString = this.getVersionStringFromFile(filename);\n const versionSuffix = this.parseVersionSuffix(versionString);\n const versionObject = this.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = this.buildNewVersionString({ major: major + 1, minor: minor, patch: patch }, versionSuffix);\n this.saveNewVersionFile(filename, newVersion);\n if (options.syncGit) {\n var commitMsg = options.commitMsg || `New Version v${newVersion}`;\n this.syncGit(newVersion, commitMsg, options.syncNpm);\n }\n },\n v_minor(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n const versionString = this.getVersionStringFromFile(filename);\n const versionSuffix = this.parseVersionSuffix(versionString);\n const versionObject = this.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = this.buildNewVersionString({ major: major, minor: minor + 1, patch: patch }, versionSuffix);\n this.saveNewVersionFile(filename, newVersion);\n if (options.syncGit) {\n var commitMsg = options.commitMsg || `New Version v${newVersion}`;\n this.syncGit(newVersion, commitMsg, options.syncNpm);\n }\n },\n v_patch(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n const versionString = this.getVersionStringFromFile(filename);\n const versionSuffix = this.parseVersionSuffix(versionString);\n const versionObject = this.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = this.buildNewVersionString({ major: major, minor: minor, patch: patch + 1 }, versionSuffix);\n this.saveNewVersionFile(filename, newVersion);\n if (options.syncGit) {\n var commitMsg = options.commitMsg || `New Version v${newVersion}`;\n this.syncGit(newVersion, commitMsg, options.syncNpm);\n }\n },\n v_sync(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n var commandHandler = this;\n commandHandler.switchCommander.shellCommands([\n \"echo $(git describe)\"\n ]).then(function (response: any) {\n const versionString = response[0].split(\"-\")[0].slice(1).replace(\"\\n\", \"\");\n console.log(versionString);\n const versionSuffix = commandHandler.parseVersionSuffix(versionString);\n const versionObject = commandHandler.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = commandHandler.buildNewVersionString({ major: major, minor: minor, patch: patch }, versionSuffix);\n commandHandler.saveNewVersionFile(filename, newVersion);\n var commitMsg = options.commitMsg || `Synced Version v${newVersion}`;\n commandHandler.switchCommander.shellCommands(\n [\n \"git fetch --tags -f\",\n `git add . && git commit -am \"${commitMsg}\"`,\n \"git fetch origin --tags\",\n \"git tag -ln\",\n `npm version \"${newVersion}\" --allow-same-version -m \"${commitMsg}\"`,\n \"git push && git push --tags\"\n ]\n ).then(function (response: any) {\n console.log(response);\n });\n });\n },\n v_changelog() {\n const commandHandler = this;\n commandHandler.switchCommander.shellCommands(\n [\n \"git tag -ln\"\n ]\n ).then(function (response: any) {\n var versionTags = response[0].split(\"\\n\").map((tag: any) => tag.split(\" \").unique()).unique().map(\n (tag: any) => {\n return {\n \"version\": tag[0],\n \"major\": tag[0].split(\".\")[0],\n \"minor\": tag[0].split(\".\")[0] + \".\" + tag[0].split(\".\")[1],\n \"description\": tag.slice(1).join(\" \").trim()\n };\n }\n );\n var minorVersionTags = versionTags.filter((tag: { version: string; }) => tag.version !== \"\").map((tag: { version: string; }) => tag.version.split(\".\")[0] + \".\" + tag.version.split(\".\")[1]).unique();\n var history = minorVersionTags.map((minor: string) => {\n return {\n \"major\": minor.split(\".\")[0],\n \"minor\": minor,\n \"history\": \"\\n\\t- \" + versionTags.filter((tag: { minor: any; }) => tag.minor === minor).map(\n function (tag: { description: any; }) {\n return tag.description;\n }\n ).filter((desc: string) => !desc.startsWith(minor.slice(1))).sort().unique().join(\"\\n\\t- \")\n };\n }).map((hist: { major: any; minor: any; history: string; }) => { return `## ${hist.major} -> ${hist.minor}` + \"\\n\" + hist.history; }).join(\"\\n\");\n const subtitle = \"This is an automatic Changelog history of versions generated using the command: **qcobjects v-changelog > CHANGELOG.md**\";\n console.log(\"# Changelog \\n\\n\" + subtitle + \"\\n\\n\" + history);\n\n });\n }\n } as any;\n\n switchCommander.program.command(\"v-major [filename]\")\n .option(\"--git, --sync-git\", \"Sync with Git\")\n .option(\"--npm, --sync-npm\", \"Sync with NPM\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Upgrade to a new major version\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_major.call(commandHandler, args, options);\n });\n switchCommander.program.command(\"v-minor [filename]\")\n .option(\"--git, --sync-git\", \"Sync with Git\")\n .option(\"--npm, --sync-npm\", \"Sync with NPM\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Upgrade to a new minor version\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_minor.call(commandHandler, args, options);\n });\n\n switchCommander.program.command(\"v-patch [filename]\")\n .option(\"--git, --sync-git\", \"Sync with Git\")\n .option(\"--npm, --sync-npm\", \"Sync with NPM\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Upgrade to a new patch version\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_patch.call(commandHandler, args, options);\n });\n\n switchCommander.program.command(\"v-sync [filename]\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Sync the version of NPM with version of GIT\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_sync.call(commandHandler, args, options);\n });\n\n switchCommander.program.command(\"v-changelog\")\n .description(\"Semantic Versioning: Shows a changelog using Semantic Versioning\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_changelog.call(commandHandler);\n });\n\n\n }\n\n\n syncGit(versionString: any, commitMsg: any, syncNpm = false) {\n let _commands_: any[] = [];\n if (syncNpm) {\n _commands_ = _commands_.concat(\n [\n \"git fetch --tags -f\",\n `npm version \"${versionString}\" -m \"${commitMsg}\"`\n ]\n );\n }\n _commands_ = _commands_.concat(\n [\n `git add . && git commit -am \"${commitMsg}\"`,\n \"git fetch origin --tags\",\n \"git tag -ln\"\n ]);\n\n if (!syncNpm) {\n _commands_ = _commands_.concat(\n [\n `git tag -a \"v${versionString}\" -m \"${commitMsg}\"`,\n ]\n );\n }\n\n _commands_ = _commands_.concat([\n \"git push && git push --tags\"\n ]\n );\n\n this.switchCommander.shellCommands(_commands_).then(function (response: any) {\n logger.info(\"Synced to Git\");\n logger.debug(response);\n }).catch(function (e: any) {\n logger.info(\"Something went wrong trying to sync to git\");\n logger.debug(e);\n });\n }\n\n parseVersionString(versionString: string): { major: string, minor: string, patch: string } {\n versionString = versionString.replace(\"\\n\", \"\");\n const regexpVer = /^(?<major>0|[1-9]\\d*)\\.(?<minor>0|[1-9]\\d*)\\.(?<patch>0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n const versionObject = { ...versionString.match(regexpVer)?.groups };\n return versionObject as { major: string, minor: string, patch: string };\n }\n\n getVersionStringFromFile(filename: any) {\n let versionString;\n try {\n versionString = fs.readFileSync(filename).toString().replace(\"\\n\", \"\");\n } catch (e) {\n versionString = \"0.0.1\";\n }\n return versionString;\n }\n\n buildNewSemVersionString({ major, minor, patch }: { major: string, minor: string, patch: string }) {\n return `${major}.${minor}.${patch}`;\n }\n\n parseVersionSuffix(versionString: string) {\n versionString = versionString.replace(\"\\n\", \"\");\n const versionObject = this.parseVersionString(versionString);\n const semVersionString = this.buildNewSemVersionString(versionObject);\n return versionString.replace(semVersionString, \"\");\n }\n\n buildNewVersionString({ major, minor, patch }: any, suffix: any) {\n const semVersionString = this.buildNewSemVersionString({ major, minor, patch });\n return `${semVersionString}${suffix}`;\n }\n\n saveNewVersionFile(filename: any, versionString: any) {\n fs.writeFileSync(filename, versionString);\n }\n\n\n\n\n\n}\n\n\nPackage(\"com.qcobjects.cli.commands.version\", [\n CommandHandler\n]);\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * QCObjects CLI 2.5\n * ________________\n *\n * Author: Jean Machuca <correojean@gmail.com>\n *\n * Cross Browser Javascript Framework for MVC Patterns\n * QuickCorp/QCObjects is licensed under the\n * GNU Lesser General Public License v3.0\n * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)\n *\n * Permissions of this copyleft license are conditioned on making available\n * complete source code of licensed works and modifications under the same\n * license or the GNU GPLv3. Copyright and license notices must be preserved.\n * Contributors provide an express grant of patent rights. However, a larger\n * work using the licensed work through interfaces provided by the licensed\n * work may be distributed under different terms and without source code for\n * the larger work.\n *\n * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>\n *\n * Everyone is permitted to copy and distribute verbatim copies of this\n * license document, but changing it is not allowed.\n*/\n/*eslint no-unused-vars: \"off\"*/\n/*eslint no-redeclare: \"off\"*/\n/*eslint no-empty: \"off\"*/\n/*eslint strict: \"off\"*/\n/*eslint no-mixed-operators: \"off\"*/\n/*eslint no-undef: \"off\"*/\n\"use strict\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { exec, execSync } from \"node:child_process\";\n\nimport { Package, InheritClass, logger } from \"qcobjects\";\nimport { SwitchCommander } from \"./cli-main\";\n\nexport class CommandHandler extends InheritClass {\n choiceOption: {\n getVersionStringFromFile(filename: string): string;\n parseVersionSuffix(versionString: any): string;\n parseVersionString(versionString: any): string;\n buildNewVersionString(arg0: { major: number; minor: number; patch: number; }, versionSuffix: any): string;\n saveNewVersionFile(filename: string, newVersion: any): string;\n syncGit(newVersion: any, commitMsg: any, syncNpm: any): string;\n switchCommander: any; v_major(filename: string, options: any): void; v_minor(filename: string, options: any): void; v_patch(filename: string, options: any): void; v_sync(filename: string, options: any): void; v_changelog(): void;\n };\n switchCommander: SwitchCommander;\n\n constructor({ switchCommander }:{switchCommander:SwitchCommander}) {\n super({ switchCommander });\n this.switchCommander = switchCommander;\n\n const commandHandler = this;\n\n this.choiceOption = {\n v_major(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n const versionString = this.getVersionStringFromFile(filename);\n const versionSuffix = this.parseVersionSuffix(versionString);\n const versionObject = this.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = this.buildNewVersionString({ major: major + 1, minor: minor, patch: patch }, versionSuffix);\n this.saveNewVersionFile(filename, newVersion);\n if (options.syncGit) {\n var commitMsg = options.commitMsg || `New Version v${newVersion}`;\n this.syncGit(newVersion, commitMsg, options.syncNpm);\n }\n },\n v_minor(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n const versionString = this.getVersionStringFromFile(filename);\n const versionSuffix = this.parseVersionSuffix(versionString);\n const versionObject = this.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = this.buildNewVersionString({ major: major, minor: minor + 1, patch: patch }, versionSuffix);\n this.saveNewVersionFile(filename, newVersion);\n if (options.syncGit) {\n var commitMsg = options.commitMsg || `New Version v${newVersion}`;\n this.syncGit(newVersion, commitMsg, options.syncNpm);\n }\n },\n v_patch(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n const versionString = this.getVersionStringFromFile(filename);\n const versionSuffix = this.parseVersionSuffix(versionString);\n const versionObject = this.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = this.buildNewVersionString({ major: major, minor: minor, patch: patch + 1 }, versionSuffix);\n this.saveNewVersionFile(filename, newVersion);\n if (options.syncGit) {\n var commitMsg = options.commitMsg || `New Version v${newVersion}`;\n this.syncGit(newVersion, commitMsg, options.syncNpm);\n }\n },\n v_sync(filename: string, options: any) {\n filename = (typeof filename === \"undefined\") ? (\"VERSION\") : (filename);\n var commandHandler = this;\n commandHandler.switchCommander.shellCommands([\n \"echo $(git describe)\"\n ]).then(function (response: any) {\n const versionString = response[0].split(\"-\")[0].slice(1).replace(\"\\n\", \"\");\n console.log(versionString);\n const versionSuffix = commandHandler.parseVersionSuffix(versionString);\n const versionObject = commandHandler.parseVersionString(versionString);\n const major = parseInt(versionObject.major);\n const minor = parseInt(versionObject.minor);\n const patch = parseInt(versionObject.patch);\n const newVersion = commandHandler.buildNewVersionString({ major: major, minor: minor, patch: patch }, versionSuffix);\n commandHandler.saveNewVersionFile(filename, newVersion);\n var commitMsg = options.commitMsg || `Synced Version v${newVersion}`;\n commandHandler.switchCommander.shellCommands(\n [\n \"git fetch --tags -f\",\n `git add . && git commit -am \"${commitMsg}\"`,\n \"git fetch origin --tags\",\n \"git tag -ln\",\n `npm version \"${newVersion}\" --allow-same-version -m \"${commitMsg}\"`,\n \"git push && git push --tags\"\n ]\n ).then(function (response: any) {\n console.log(response);\n });\n });\n },\n v_changelog() {\n const commandHandler = this;\n commandHandler.switchCommander.shellCommands(\n [\n \"git tag -ln\"\n ]\n ).then(function (response: any) {\n var versionTags = response[0].split(\"\\n\").map((tag: any) => tag.split(\" \").unique()).unique().map(\n (tag: any) => {\n return {\n \"version\": tag[0],\n \"major\": tag[0].split(\".\")[0],\n \"minor\": tag[0].split(\".\")[0] + \".\" + tag[0].split(\".\")[1],\n \"description\": tag.slice(1).join(\" \").trim()\n };\n }\n );\n var minorVersionTags = versionTags.filter((tag: { version: string; }) => tag.version !== \"\").map((tag: { version: string; }) => tag.version.split(\".\")[0] + \".\" + tag.version.split(\".\")[1]).unique();\n var history = minorVersionTags.map((minor: string) => {\n return {\n \"major\": minor.split(\".\")[0],\n \"minor\": minor,\n \"history\": \"\\n\\t- \" + versionTags.filter((tag: { minor: any; }) => tag.minor === minor).map(\n function (tag: { description: any; }) {\n return tag.description;\n }\n ).filter((desc: string) => !desc.startsWith(minor.slice(1))).sort().unique().join(\"\\n\\t- \")\n };\n }).map((hist: { major: any; minor: any; history: string; }) => { return `## ${hist.major} -> ${hist.minor}` + \"\\n\" + hist.history; }).join(\"\\n\");\n const subtitle = \"This is an automatic Changelog history of versions generated using the command: **qcobjects v-changelog > CHANGELOG.md**\";\n console.log(\"# Changelog \\n\\n\" + subtitle + \"\\n\\n\" + history);\n\n });\n }\n } as any;\n\n switchCommander.program.command(\"v-major [filename]\")\n .option(\"--git, --sync-git\", \"Sync with Git\")\n .option(\"--npm, --sync-npm\", \"Sync with NPM\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Upgrade to a new major version\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_major.call(commandHandler, args, options);\n });\n switchCommander.program.command(\"v-minor [filename]\")\n .option(\"--git, --sync-git\", \"Sync with Git\")\n .option(\"--npm, --sync-npm\", \"Sync with NPM\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Upgrade to a new minor version\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_minor.call(commandHandler, args, options);\n });\n\n switchCommander.program.command(\"v-patch [filename]\")\n .option(\"--git, --sync-git\", \"Sync with Git\")\n .option(\"--npm, --sync-npm\", \"Sync with NPM\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Upgrade to a new patch version\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_patch.call(commandHandler, args, options);\n });\n\n switchCommander.program.command(\"v-sync [filename]\")\n .option(\"-m, --commit-msg [message]\", \"Commit Message\")\n .description(\"Semantic Versioning: Sync the version of NPM with version of GIT\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_sync.call(commandHandler, args, options);\n });\n\n switchCommander.program.command(\"v-changelog\")\n .description(\"Semantic Versioning: Shows a changelog using Semantic Versioning\")\n .action(function (args: any, options: any) {\n commandHandler.choiceOption.v_changelog.call(commandHandler);\n });\n\n\n }\n\n\n syncGit(versionString: any, commitMsg: any, syncNpm = false) {\n let _commands_: any[] = [];\n if (syncNpm) {\n _commands_ = _commands_.concat(\n [\n \"git fetch --tags -f\",\n `npm version \"${versionString}\" -m \"${commitMsg}\"`\n ]\n );\n }\n _commands_ = _commands_.concat(\n [\n `git add . && git commit -am \"${commitMsg}\"`,\n \"git fetch origin --tags\",\n \"git tag -ln\"\n ]);\n\n if (!syncNpm) {\n _commands_ = _commands_.concat(\n [\n `git tag -a \"v${versionString}\" -m \"${commitMsg}\"`,\n ]\n );\n }\n\n _commands_ = _commands_.concat([\n \"git push && git push --tags\"\n ]\n );\n\n this.switchCommander.shellCommands(_commands_).then(function (response: any) {\n logger.info(\"Synced to Git\");\n logger.debug(response);\n }).catch(function (e: any) {\n logger.info(\"Something went wrong trying to sync to git\");\n logger.debug(e);\n });\n }\n\n parseVersionString(versionString: string): { major: string, minor: string, patch: string } {\n versionString = versionString.replace(\"\\n\", \"\");\n const regexpVer = /^(?<major>0|[1-9]\\d*)\\.(?<minor>0|[1-9]\\d*)\\.(?<patch>0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n const versionObject = { ...versionString.match(regexpVer)?.groups };\n return versionObject as { major: string, minor: string, patch: string };\n }\n\n getVersionStringFromFile(filename: any) {\n let versionString;\n try {\n versionString = fs.readFileSync(filename).toString().replace(\"\\n\", \"\");\n } catch (e) {\n versionString = \"0.0.1\";\n }\n return versionString;\n }\n\n buildNewSemVersionString({ major, minor, patch }: { major: string, minor: string, patch: string }) {\n return `${major}.${minor}.${patch}`;\n }\n\n parseVersionSuffix(versionString: string) {\n versionString = versionString.replace(\"\\n\", \"\");\n const versionObject = this.parseVersionString(versionString);\n const semVersionString = this.buildNewSemVersionString(versionObject);\n return versionString.replace(semVersionString, \"\");\n }\n\n buildNewVersionString({ major, minor, patch }: any, suffix: any) {\n const semVersionString = this.buildNewSemVersionString({ major, minor, patch });\n return `${semVersionString}${suffix}`;\n }\n\n saveNewVersionFile(filename: any, versionString: any) {\n fs.writeFileSync(filename, versionString);\n }\n\n\n\n\n\n}\n\n\nPackage(\"com.qcobjects.cli.commands.version\", [\n CommandHandler\n]);\n"],
|
|
5
5
|
"mappings": ";;AA+BA,OAAO,QAAQ;AAIf,SAAS,SAAS,cAAc,cAAc;AAGvC,MAAM,uBAAuB,aAAa;AAAA,EAtCjD,OAsCiD;AAAA;AAAA;AAAA,EAC/C;AAAA,EASA;AAAA,EAEA,YAAY,EAAE,gBAAgB,GAAqC;AACjE,UAAM,EAAE,gBAAgB,CAAC;AACzB,SAAK,kBAAkB;AAEvB,UAAM,iBAAiB;AAEvB,SAAK,eAAe;AAAA,MAClB,QAAQ,UAAkB,SAAc;AACtC,mBAAY,OAAO,aAAa,cAAgB,YAAc;AAC9D,cAAM,gBAAgB,KAAK,yBAAyB,QAAQ;AAC5D,cAAM,gBAAgB,KAAK,mBAAmB,aAAa;AAC3D,cAAM,gBAAgB,KAAK,mBAAmB,aAAa;AAC3D,cAAM,QAAQ,SAAS,cAAc,KAAK;AAC1C,cAAM,QAAQ,SAAS,cAAc,KAAK;AAC1C,cAAM,QAAQ,SAAS,cAAc,KAAK;AAC1C,cAAM,aAAa,KAAK,sBAAsB,EAAE,OAAO,QAAQ,GAAG,OAAc,MAAa,GAAG,aAAa;AAC7G,aAAK,mBAAmB,UAAU,UAAU;AAC5C,YAAI,QAAQ,SAAS;AACnB,cAAI,YAAY,QAAQ,aAAa,gBAAgB,UAAU;AAC/D,eAAK,QAAQ,YAAY,WAAW,QAAQ,OAAO;AAAA,QAC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AM,CAAC;AAC9E,WAAO,GAAG,gBAAgB,GAAG,MAAM;AAAA,EACrC;AAAA,EAEA,mBAAmB,UAAe,eAAoB;AACpD,OAAG,cAAc,UAAU,aAAa;AAAA,EAC1C;AAMF;AAGA,QAAQ,sCAAsC;AAAA,EAC5C;AACF,CAAC;",
|
|
6
6
|
"names": ["commandHandler", "response"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import * as versionCommand from "./cli-commands-version
|
|
2
|
-
import * as jiraCommand from "./cli-commands-jira
|
|
3
|
-
import * as publishStatic from "./cli-commands-publish-static
|
|
1
|
+
import * as versionCommand from "./cli-commands-version";
|
|
2
|
+
import * as jiraCommand from "./cli-commands-jira";
|
|
3
|
+
import * as publishStatic from "./cli-commands-publish-static";
|
|
4
|
+
import * as buildTypescript from "./cli-commands-build-typescript";
|
|
5
|
+
import * as buildEsbuild from "./cli-commands-build-esbuild";
|
|
4
6
|
export {
|
|
7
|
+
buildEsbuild,
|
|
8
|
+
buildTypescript,
|
|
5
9
|
jiraCommand,
|
|
6
10
|
publishStatic,
|
|
7
11
|
versionCommand
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cli-commands.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * QCObjects CLI 2.
|
|
5
|
-
"mappings": "AAkCA,YAAY,oBAAoB;AAChC,YAAY,iBAAiB;AAC7B,YAAY,mBAAmB;",
|
|
4
|
+
"sourcesContent": ["/**\n * QCObjects CLI 2.5\n * ________________\n *\n * Author: Jean Machuca <correojean@gmail.com>\n *\n * Cross Browser Javascript Framework for MVC Patterns\n * QuickCorp/QCObjects is licensed under the\n * GNU Lesser General Public License v3.0\n * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)\n *\n * Permissions of this copyleft license are conditioned on making available\n * complete source code of licensed works and modifications under the same\n * license or the GNU GPLv3. Copyright and license notices must be preserved.\n * Contributors provide an express grant of patent rights. However, a larger\n * work using the licensed work through interfaces provided by the licensed\n * work may be distributed under different terms and without source code for\n * the larger work.\n *\n * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>\n *\n * Everyone is permitted to copy and distribute verbatim copies of this\n * license document, but changing it is not allowed.\n*/\n/*eslint no-unused-vars: \"off\"*/\n/*eslint no-redeclare: \"off\"*/\n/*eslint no-empty: \"off\"*/\n/*eslint strict: \"off\"*/\n/*eslint no-mixed-operators: \"off\"*/\n/*eslint no-undef: \"off\"*/\n\"use strict\";\n\n// plugin commands here\n\nexport * as versionCommand from \"./cli-commands-version\";\nexport * as jiraCommand from \"./cli-commands-jira\";\nexport * as publishStatic from \"./cli-commands-publish-static\";\nexport * as buildTypescript from \"./cli-commands-build-typescript\";\nexport * as buildEsbuild from \"./cli-commands-build-esbuild\";"],
|
|
5
|
+
"mappings": "AAkCA,YAAY,oBAAoB;AAChC,YAAY,iBAAiB;AAC7B,YAAY,mBAAmB;AAC/B,YAAY,qBAAqB;AACjC,YAAY,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|