@anvil-works/anvil-cli 0.8.0-canary.0 → 0.8.0-canary.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/SavePathRouter.d.ts.map +1 -1
- package/dist/cli.js +17 -6
- package/dist/index.js +17 -6
- package/dist/validators.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavePathRouter.d.ts","sourceRoot":"","sources":["../src/SavePathRouter.ts"],"names":[],"mappings":"AAMA,OAAO,EAGH,KAAK,uBAAuB,EAE/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAmB,MAAM,cAAc,CAAC;AAMlE,KAAK,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAG3B,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,MAAM,QAAQ,GAAG,uBAAuB,CAAC;AAE/C,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AASD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhE,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjH,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,iBAAiB,CAAC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AE,MAAM,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAwWD;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC9F,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgEtF;AAED,wBAAsB,eAAe,CACjC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,YAAY,GACtB,OAAO,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC,CAqBpC;AA8zBD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACrC,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAC1C,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,CAiE7C"}
|
package/dist/cli.js
CHANGED
|
@@ -16773,6 +16773,9 @@ print(json.dumps({"issues": issues}))
|
|
|
16773
16773
|
if (void 0 === services || !Array.isArray(services)) return issues;
|
|
16774
16774
|
services.forEach((service, index)=>{
|
|
16775
16775
|
if (!validators_isPlainObject(service) || "/runtime/services/anvil/users.yml" !== service.source) return;
|
|
16776
|
+
if (validators_isPlainObject(service.server_config) && void 0 !== service.server_config.user_table) {
|
|
16777
|
+
if ("string" != typeof service.server_config.user_table && "number" != typeof service.server_config.user_table) validators_pushIssue(issues, `${path}[${index}].server_config.user_table`, "must be a table Python name string or legacy table id number");
|
|
16778
|
+
} else validators_pushIssue(issues, `${path}[${index}].server_config.user_table`, 'is required for the Users service; this is usually "users"');
|
|
16776
16779
|
if (!validators_isPlainObject(service.client_config)) return;
|
|
16777
16780
|
if (true === service.client_config.allow_remember_me && void 0 === service.client_config.remember_me_days) validators_pushIssue(issues, `${path}[${index}].client_config.remember_me_days`, "must be set if allow_remember_me is true");
|
|
16778
16781
|
});
|
|
@@ -17068,6 +17071,10 @@ print(json.dumps({"issues": issues}))
|
|
|
17068
17071
|
function normalizeClientCodePath(relativePath) {
|
|
17069
17072
|
return relativePath.replace(/\\/g, "/");
|
|
17070
17073
|
}
|
|
17074
|
+
function isRootCodePackageMarkerPath(relativePath) {
|
|
17075
|
+
const normalized = relativePath.replace(/\\/g, "/");
|
|
17076
|
+
return "client_code/__init__.py" === normalized || "server_code/__init__.py" === normalized;
|
|
17077
|
+
}
|
|
17071
17078
|
function isServerRequirementsPath(relativePath) {
|
|
17072
17079
|
return "server_code/requirements.txt" === relativePath.replace(/\\/g, "/");
|
|
17073
17080
|
}
|
|
@@ -17163,8 +17170,12 @@ print(json.dumps({"issues": issues}))
|
|
|
17163
17170
|
const parts = relativePath.split("/");
|
|
17164
17171
|
if (2 === parts.length) return "scripts";
|
|
17165
17172
|
}
|
|
17166
|
-
if (relativePath.startsWith("server_code/") && relativePath.endsWith(".py"))
|
|
17173
|
+
if (relativePath.startsWith("server_code/") && relativePath.endsWith(".py")) {
|
|
17174
|
+
if (isRootCodePackageMarkerPath(relativePath)) return null;
|
|
17175
|
+
return "server_modules";
|
|
17176
|
+
}
|
|
17167
17177
|
if (relativePath.startsWith("client_code/") && relativePath.endsWith(".py")) {
|
|
17178
|
+
if (isRootCodePackageMarkerPath(relativePath)) return null;
|
|
17168
17179
|
const isPackageInit = relativePath.endsWith("__init__.py");
|
|
17169
17180
|
const kind = isPackageInit ? "package" : "module";
|
|
17170
17181
|
const className = extractPythonName(relativePath);
|
|
@@ -17379,11 +17390,11 @@ print(json.dumps({"issues": issues}))
|
|
|
17379
17390
|
handle: handleScriptsChange
|
|
17380
17391
|
},
|
|
17381
17392
|
{
|
|
17382
|
-
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py"),
|
|
17393
|
+
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py") && !isRootCodePackageMarkerPath(relativePath),
|
|
17383
17394
|
handle: handleServerCodeChange
|
|
17384
17395
|
},
|
|
17385
17396
|
{
|
|
17386
|
-
matches: (relativePath)=>relativePath.startsWith("client_code/") && relativePath.endsWith(".py"),
|
|
17397
|
+
matches: (relativePath)=>relativePath.startsWith("client_code/") && relativePath.endsWith(".py") && !isRootCodePackageMarkerPath(relativePath),
|
|
17387
17398
|
handle: handleClientCodeChange
|
|
17388
17399
|
},
|
|
17389
17400
|
{
|
|
@@ -17919,7 +17930,7 @@ print(json.dumps({"issues": issues}))
|
|
|
17919
17930
|
const DELETION_ROUTES = [
|
|
17920
17931
|
{
|
|
17921
17932
|
matches: (relativePath, editorYaml)=>{
|
|
17922
|
-
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py")) return false;
|
|
17933
|
+
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py") || isRootCodePackageMarkerPath(relativePath)) return false;
|
|
17923
17934
|
const className = extractPythonName(relativePath);
|
|
17924
17935
|
return editorYaml.hasId("forms", className);
|
|
17925
17936
|
},
|
|
@@ -17931,7 +17942,7 @@ print(json.dumps({"issues": issues}))
|
|
|
17931
17942
|
},
|
|
17932
17943
|
{
|
|
17933
17944
|
matches: (relativePath, editorYaml)=>{
|
|
17934
|
-
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py")) return false;
|
|
17945
|
+
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py") || isRootCodePackageMarkerPath(relativePath)) return false;
|
|
17935
17946
|
const className = extractPythonName(relativePath);
|
|
17936
17947
|
return !editorYaml.hasId("forms", className);
|
|
17937
17948
|
},
|
|
@@ -17954,7 +17965,7 @@ print(json.dumps({"issues": issues}))
|
|
|
17954
17965
|
]
|
|
17955
17966
|
},
|
|
17956
17967
|
{
|
|
17957
|
-
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py"),
|
|
17968
|
+
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py") && !isRootCodePackageMarkerPath(relativePath),
|
|
17958
17969
|
entityType: "server_modules",
|
|
17959
17970
|
extractName: extractPythonName,
|
|
17960
17971
|
savePathPrefix: [
|
package/dist/index.js
CHANGED
|
@@ -16802,6 +16802,9 @@ print(json.dumps({"issues": issues}))
|
|
|
16802
16802
|
if (void 0 === services || !Array.isArray(services)) return issues;
|
|
16803
16803
|
services.forEach((service, index)=>{
|
|
16804
16804
|
if (!validators_isPlainObject(service) || "/runtime/services/anvil/users.yml" !== service.source) return;
|
|
16805
|
+
if (validators_isPlainObject(service.server_config) && void 0 !== service.server_config.user_table) {
|
|
16806
|
+
if ("string" != typeof service.server_config.user_table && "number" != typeof service.server_config.user_table) validators_pushIssue(issues, `${path}[${index}].server_config.user_table`, "must be a table Python name string or legacy table id number");
|
|
16807
|
+
} else validators_pushIssue(issues, `${path}[${index}].server_config.user_table`, 'is required for the Users service; this is usually "users"');
|
|
16805
16808
|
if (!validators_isPlainObject(service.client_config)) return;
|
|
16806
16809
|
if (true === service.client_config.allow_remember_me && void 0 === service.client_config.remember_me_days) validators_pushIssue(issues, `${path}[${index}].client_config.remember_me_days`, "must be set if allow_remember_me is true");
|
|
16807
16810
|
});
|
|
@@ -17097,6 +17100,10 @@ print(json.dumps({"issues": issues}))
|
|
|
17097
17100
|
function normalizeClientCodePath(relativePath) {
|
|
17098
17101
|
return relativePath.replace(/\\/g, "/");
|
|
17099
17102
|
}
|
|
17103
|
+
function isRootCodePackageMarkerPath(relativePath) {
|
|
17104
|
+
const normalized = relativePath.replace(/\\/g, "/");
|
|
17105
|
+
return "client_code/__init__.py" === normalized || "server_code/__init__.py" === normalized;
|
|
17106
|
+
}
|
|
17100
17107
|
function isServerRequirementsPath(relativePath) {
|
|
17101
17108
|
return "server_code/requirements.txt" === relativePath.replace(/\\/g, "/");
|
|
17102
17109
|
}
|
|
@@ -17192,8 +17199,12 @@ print(json.dumps({"issues": issues}))
|
|
|
17192
17199
|
const parts = relativePath.split("/");
|
|
17193
17200
|
if (2 === parts.length) return "scripts";
|
|
17194
17201
|
}
|
|
17195
|
-
if (relativePath.startsWith("server_code/") && relativePath.endsWith(".py"))
|
|
17202
|
+
if (relativePath.startsWith("server_code/") && relativePath.endsWith(".py")) {
|
|
17203
|
+
if (isRootCodePackageMarkerPath(relativePath)) return null;
|
|
17204
|
+
return "server_modules";
|
|
17205
|
+
}
|
|
17196
17206
|
if (relativePath.startsWith("client_code/") && relativePath.endsWith(".py")) {
|
|
17207
|
+
if (isRootCodePackageMarkerPath(relativePath)) return null;
|
|
17197
17208
|
const isPackageInit = relativePath.endsWith("__init__.py");
|
|
17198
17209
|
const kind = isPackageInit ? "package" : "module";
|
|
17199
17210
|
const className = extractPythonName(relativePath);
|
|
@@ -17408,11 +17419,11 @@ print(json.dumps({"issues": issues}))
|
|
|
17408
17419
|
handle: handleScriptsChange
|
|
17409
17420
|
},
|
|
17410
17421
|
{
|
|
17411
|
-
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py"),
|
|
17422
|
+
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py") && !isRootCodePackageMarkerPath(relativePath),
|
|
17412
17423
|
handle: handleServerCodeChange
|
|
17413
17424
|
},
|
|
17414
17425
|
{
|
|
17415
|
-
matches: (relativePath)=>relativePath.startsWith("client_code/") && relativePath.endsWith(".py"),
|
|
17426
|
+
matches: (relativePath)=>relativePath.startsWith("client_code/") && relativePath.endsWith(".py") && !isRootCodePackageMarkerPath(relativePath),
|
|
17416
17427
|
handle: handleClientCodeChange
|
|
17417
17428
|
},
|
|
17418
17429
|
{
|
|
@@ -17948,7 +17959,7 @@ print(json.dumps({"issues": issues}))
|
|
|
17948
17959
|
const DELETION_ROUTES = [
|
|
17949
17960
|
{
|
|
17950
17961
|
matches: (relativePath, editorYaml)=>{
|
|
17951
|
-
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py")) return false;
|
|
17962
|
+
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py") || isRootCodePackageMarkerPath(relativePath)) return false;
|
|
17952
17963
|
const className = extractPythonName(relativePath);
|
|
17953
17964
|
return editorYaml.hasId("forms", className);
|
|
17954
17965
|
},
|
|
@@ -17960,7 +17971,7 @@ print(json.dumps({"issues": issues}))
|
|
|
17960
17971
|
},
|
|
17961
17972
|
{
|
|
17962
17973
|
matches: (relativePath, editorYaml)=>{
|
|
17963
|
-
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py")) return false;
|
|
17974
|
+
if (!relativePath.startsWith("client_code/") || !relativePath.endsWith(".py") || isRootCodePackageMarkerPath(relativePath)) return false;
|
|
17964
17975
|
const className = extractPythonName(relativePath);
|
|
17965
17976
|
return !editorYaml.hasId("forms", className);
|
|
17966
17977
|
},
|
|
@@ -17983,7 +17994,7 @@ print(json.dumps({"issues": issues}))
|
|
|
17983
17994
|
]
|
|
17984
17995
|
},
|
|
17985
17996
|
{
|
|
17986
|
-
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py"),
|
|
17997
|
+
matches: (relativePath)=>relativePath.startsWith("server_code/") && relativePath.endsWith(".py") && !isRootCodePackageMarkerPath(relativePath),
|
|
17987
17998
|
entityType: "server_modules",
|
|
17988
17999
|
extractName: extractPythonName,
|
|
17989
18000
|
savePathPrefix: [
|
package/dist/validators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EA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