@lotics/cli 0.238.0 → 0.238.1
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/dist/src/cli.js +17 -11
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -46090,18 +46090,26 @@ function widthOf(prefix) {
|
|
|
46090
46090
|
}
|
|
46091
46091
|
var SCHEMA_PREFIXES = ["tbl", "fld", "opt", "dtl", "grp", "cac"];
|
|
46092
46092
|
var SHORTEST_SCHEMA_BODY = Math.min(...SCHEMA_PREFIXES.map(widthOf));
|
|
46093
|
+
var ID_BOUNDARY = "(?:^|[^0-9A-Za-z])";
|
|
46093
46094
|
var CONCRETE_ID_SCAN = new RegExp(
|
|
46094
|
-
|
|
46095
|
+
`${ID_BOUNDARY}(?<id>(?:${SCHEMA_PREFIXES.join("|")})_[0-9A-Za-z]{${SHORTEST_SCHEMA_BODY},})`,
|
|
46095
46096
|
"g"
|
|
46096
46097
|
);
|
|
46097
46098
|
var WORKSPACE_ID_SCAN = new RegExp(
|
|
46098
|
-
|
|
46099
|
+
`${ID_BOUNDARY}(?<id>organization-(?:[0-9a-z]+-)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|wsp_[0-9A-Za-z]{${widthOf("wsp")}}(?![0-9A-Za-z])|app_[0-9A-Za-z]{${widthOf("app")}}(?![0-9A-Za-z])|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})`,
|
|
46099
46100
|
"g"
|
|
46100
46101
|
);
|
|
46101
46102
|
var ID_PLACEHOLDER_SCAN = new RegExp(
|
|
46102
|
-
`(["'\`])((?:${SCHEMA_PREFIXES.join("|")})_[0-9A-Za-z]+)\\1`,
|
|
46103
|
+
`(["'\`])(?<id>(?:${SCHEMA_PREFIXES.join("|")})_[0-9A-Za-z]+)\\1`,
|
|
46103
46104
|
"g"
|
|
46104
46105
|
);
|
|
46106
|
+
function matchIds(text, scan) {
|
|
46107
|
+
return [...text.matchAll(scan)].map((match2) => {
|
|
46108
|
+
const id = match2.groups?.id;
|
|
46109
|
+
if (id === void 0) throw new Error(`concrete_ids: ${scan.source} has no \`id\` group`);
|
|
46110
|
+
return { id, index: match2.index + match2[0].indexOf(id) };
|
|
46111
|
+
});
|
|
46112
|
+
}
|
|
46105
46113
|
function isGeneratedIdBody(id) {
|
|
46106
46114
|
const underscore = id.indexOf("_");
|
|
46107
46115
|
if (underscore === -1) return true;
|
|
@@ -46141,8 +46149,7 @@ function isIdPlaceholderScanPath(path26) {
|
|
|
46141
46149
|
}
|
|
46142
46150
|
function firstLines(text, pattern, keep, into) {
|
|
46143
46151
|
text.split("\n").forEach((line, index) => {
|
|
46144
|
-
for (const
|
|
46145
|
-
const id = match2[2] ?? match2[0];
|
|
46152
|
+
for (const { id } of matchIds(line, pattern)) {
|
|
46146
46153
|
if (!keep(id) || into.has(id)) continue;
|
|
46147
46154
|
into.set(id, index + 1);
|
|
46148
46155
|
}
|
|
@@ -47605,7 +47612,7 @@ function validatePackageContract(contract, options = { require_template_sha: tru
|
|
|
47605
47612
|
};
|
|
47606
47613
|
const namedConnections = /* @__PURE__ */ new Set();
|
|
47607
47614
|
const checkBodyTokens = (body, path26) => {
|
|
47608
|
-
for (const id of new Set(body.
|
|
47615
|
+
for (const id of new Set(matchIds(body, CONCRETE_ID_SCAN).map((match2) => match2.id))) {
|
|
47609
47616
|
errors.push({
|
|
47610
47617
|
severity: "error",
|
|
47611
47618
|
path: path26,
|
|
@@ -55569,7 +55576,7 @@ function resultSideEffects(result) {
|
|
|
55569
55576
|
|
|
55570
55577
|
// src/version.ts
|
|
55571
55578
|
init_define_LOTICS_KIT_VERSIONS();
|
|
55572
|
-
var VERSION = "0.238.
|
|
55579
|
+
var VERSION = "0.238.1";
|
|
55573
55580
|
|
|
55574
55581
|
// src/timezone.ts
|
|
55575
55582
|
init_define_LOTICS_KIT_VERSIONS();
|
|
@@ -79256,11 +79263,10 @@ function pastedAppIds(projectDir) {
|
|
|
79256
79263
|
if (!fs12.existsSync(file2)) return [];
|
|
79257
79264
|
const text = fs12.readFileSync(file2, "utf8");
|
|
79258
79265
|
const boundBefore = new RegExp(`"${BOUND_APP_ID_KEY}"\\s*:\\s*"$`);
|
|
79259
|
-
return
|
|
79260
|
-
const id = match2[0];
|
|
79266
|
+
return matchIds(text, WORKSPACE_ID_SCAN).flatMap(({ id, index }) => {
|
|
79261
79267
|
if (!id.startsWith("app_") || !isGeneratedIdBody(id)) return [];
|
|
79262
|
-
const bound = boundBefore.test(text.slice(Math.max(0,
|
|
79263
|
-
const line = text.slice(0,
|
|
79268
|
+
const bound = boundBefore.test(text.slice(Math.max(0, index - 64), index)) && text[index + id.length] === '"';
|
|
79269
|
+
const line = text.slice(0, index).split("\n").length;
|
|
79264
79270
|
return bound ? [] : [{ at: `${APP_SPEC_PATH}:${line}`, id }];
|
|
79265
79271
|
});
|
|
79266
79272
|
}
|