@geekmidas/manifest 10.0.0-alpha.2 → 10.0.0-alpha.21
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/index.cjs +49 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -109
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +59 -109
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +49 -66
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
11
9
|
var __copyProps = (to, from, except, desc) => {
|
|
12
10
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
11
|
key = keys[i];
|
|
@@ -18,11 +16,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
22
20
|
value: mod,
|
|
23
21
|
enumerable: true
|
|
24
22
|
}) : target, mod));
|
|
25
|
-
|
|
26
23
|
//#endregion
|
|
27
24
|
//#region src/declaration.ts
|
|
28
25
|
/**
|
|
@@ -36,32 +33,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
33
|
*/
|
|
37
34
|
const DEFAULT_POSTGRES_VERSION = 18;
|
|
38
35
|
/**
|
|
39
|
-
* How the process serving a declaration is built and run.
|
|
40
|
-
*
|
|
41
|
-
* The half of an application that a graph genuinely cannot derive. *What*
|
|
42
|
-
* exists — a surface, a site, the edges between them — is declared and read
|
|
43
|
-
* back from the manifest. *Where its source lives and which globs find its
|
|
44
|
-
* code* is not derivable from anything: it is a fact about a directory.
|
|
45
|
-
*
|
|
46
|
-
* It lives on the declaration rather than in a config `apps` block because the
|
|
47
|
-
* two were the same list written twice, and the copy in config was the one that
|
|
48
|
-
* could disagree. A site declared `path: 'apps/web'` and an app entry declared
|
|
49
|
-
* `path: 'apps/web'`, and nothing checked them against each other; a surface
|
|
50
|
-
* that config had no entry for simply never deployed.
|
|
51
|
-
*
|
|
52
|
-
* Only the declaration that *is* an app carries one. Two surfaces in one
|
|
53
|
-
* process means one of them has the spec and the other collapses onto it —
|
|
54
|
-
* which is the same rule that decides deploy units, now stated once.
|
|
55
|
-
*/
|
|
56
|
-
/**
|
|
57
|
-
* Where an app's code lives when nobody says otherwise.
|
|
58
|
-
*
|
|
59
|
-
* One glob, every kind — the same rule the `constructs` glob follows. A handler
|
|
60
|
-
* in one of these directories is found; anywhere else needs a `code` glob, and
|
|
61
|
-
* saying so is the whole reason the field still exists.
|
|
62
|
-
*/
|
|
63
|
-
const DEFAULT_APP_CODE = "./{endpoints,functions,crons,queues,topics,subscribers}/**/*.ts";
|
|
64
|
-
/**
|
|
65
36
|
* What each kind may derive from.
|
|
66
37
|
*
|
|
67
38
|
* Small enough to state exhaustively, and stating it makes cycles impossible
|
|
@@ -101,7 +72,6 @@ const PUBLIC = {
|
|
|
101
72
|
site: ["url"],
|
|
102
73
|
worker: []
|
|
103
74
|
};
|
|
104
|
-
|
|
105
75
|
//#endregion
|
|
106
76
|
//#region src/errors.ts
|
|
107
77
|
/**
|
|
@@ -160,20 +130,9 @@ var IllegalDerivation = class extends Error {
|
|
|
160
130
|
this.allowed = allowed;
|
|
161
131
|
}
|
|
162
132
|
};
|
|
163
|
-
|
|
164
133
|
//#endregion
|
|
165
|
-
//#region
|
|
166
|
-
var
|
|
167
|
-
/**
|
|
168
|
-
* lodash (Custom Build) <https://lodash.com/>
|
|
169
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
|
170
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
171
|
-
* Released under MIT license <https://lodash.com/license>
|
|
172
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
173
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
174
|
-
*/
|
|
175
|
-
/** Used as references for various `Number` constants. */
|
|
176
|
-
var INFINITY = Infinity;
|
|
134
|
+
//#region src/naming.ts
|
|
135
|
+
var import_lodash_snakecase = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
177
136
|
/** `Object#toString` result references. */
|
|
178
137
|
var symbolTag = "[object Symbol]";
|
|
179
138
|
/** Used to match words composed of alphanumeric characters. */
|
|
@@ -181,15 +140,46 @@ var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.snakecase@4.1
|
|
|
181
140
|
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
182
141
|
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
183
142
|
/** Used to compose unicode character classes. */
|
|
184
|
-
var rsAstralRange = "\\ud800-\\udfff"
|
|
143
|
+
var rsAstralRange = "\\ud800-\\udfff";
|
|
144
|
+
var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23";
|
|
145
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20f0";
|
|
146
|
+
var rsDingbatRange = "\\u2700-\\u27bf";
|
|
147
|
+
var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
|
|
148
|
+
var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
|
|
149
|
+
var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
|
|
150
|
+
var rsPunctuationRange = "\\u2000-\\u206f";
|
|
151
|
+
var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
|
|
152
|
+
var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
|
|
153
|
+
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
154
|
+
var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
185
155
|
/** Used to compose unicode capture groups. */
|
|
186
|
-
var rsApos = "['’]"
|
|
156
|
+
var rsApos = "['’]";
|
|
157
|
+
var rsBreak = "[" + rsBreakRange + "]";
|
|
158
|
+
var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]";
|
|
159
|
+
var rsDigits = "\\d+";
|
|
160
|
+
var rsDingbat = "[" + rsDingbatRange + "]";
|
|
161
|
+
var rsLower = "[" + rsLowerRange + "]";
|
|
162
|
+
var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
|
|
163
|
+
var rsModifier = "(?:" + rsCombo + "|\\ud83c[\\udffb-\\udfff])";
|
|
164
|
+
var rsNonAstral = "[^" + rsAstralRange + "]";
|
|
165
|
+
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
166
|
+
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
167
|
+
var rsUpper = "[" + rsUpperRange + "]";
|
|
168
|
+
var rsZWJ = "\\u200d";
|
|
187
169
|
/** Used to compose unicode regexes. */
|
|
188
|
-
var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")"
|
|
170
|
+
var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")";
|
|
171
|
+
var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")";
|
|
172
|
+
var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
|
|
173
|
+
var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
|
|
174
|
+
var reOptMod = rsModifier + "?";
|
|
175
|
+
var rsOptVar = "[" + rsVarRange + "]?";
|
|
176
|
+
var rsOptJoin = "(?:" + rsZWJ + "(?:" + [
|
|
189
177
|
rsNonAstral,
|
|
190
178
|
rsRegional,
|
|
191
179
|
rsSurrPair
|
|
192
|
-
].join("|") + ")" + rsOptVar + reOptMod + ")*"
|
|
180
|
+
].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
181
|
+
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
182
|
+
var rsEmoji = "(?:" + [
|
|
193
183
|
rsDingbat,
|
|
194
184
|
rsRegional,
|
|
195
185
|
rsSurrPair
|
|
@@ -488,18 +478,17 @@ var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.snakecase@4.1
|
|
|
488
478
|
function unicodeWords(string) {
|
|
489
479
|
return string.match(reUnicodeWord) || [];
|
|
490
480
|
}
|
|
491
|
-
/** Used for built-in method references. */
|
|
492
|
-
var objectProto = Object.prototype;
|
|
493
481
|
/**
|
|
494
482
|
* Used to resolve the
|
|
495
483
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
496
484
|
* of values.
|
|
497
485
|
*/
|
|
498
|
-
var objectToString =
|
|
486
|
+
var objectToString = Object.prototype.toString;
|
|
499
487
|
/** Built-in value references. */
|
|
500
488
|
var Symbol = root.Symbol;
|
|
501
489
|
/** Used to convert symbols to primitives and strings. */
|
|
502
|
-
var symbolProto = Symbol ? Symbol.prototype : void 0
|
|
490
|
+
var symbolProto = Symbol ? Symbol.prototype : void 0;
|
|
491
|
+
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
503
492
|
/**
|
|
504
493
|
* The base implementation of `_.toString` which doesn't convert nullish
|
|
505
494
|
* values to empty strings.
|
|
@@ -512,7 +501,7 @@ var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.snakecase@4.1
|
|
|
512
501
|
if (typeof value == "string") return value;
|
|
513
502
|
if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
|
|
514
503
|
var result = value + "";
|
|
515
|
-
return result == "0" && 1 / value == -
|
|
504
|
+
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
516
505
|
}
|
|
517
506
|
/**
|
|
518
507
|
* Creates a function like `_.camelCase`.
|
|
@@ -669,11 +658,7 @@ var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.snakecase@4.1
|
|
|
669
658
|
return string.match(pattern) || [];
|
|
670
659
|
}
|
|
671
660
|
module.exports = snakeCase;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
//#endregion
|
|
675
|
-
//#region src/naming.ts
|
|
676
|
-
var import_lodash = __toESM(require_lodash(), 1);
|
|
661
|
+
})))(), 1);
|
|
677
662
|
/**
|
|
678
663
|
* `UPPER_SNAKE_CASE`, with numbers kept against the word they follow.
|
|
679
664
|
*
|
|
@@ -685,7 +670,7 @@ var import_lodash = __toESM(require_lodash(), 1);
|
|
|
685
670
|
* @example environmentCase('api2') // 'API2' (digit joins its word)
|
|
686
671
|
*/
|
|
687
672
|
function environmentCase(name) {
|
|
688
|
-
return (0,
|
|
673
|
+
return (0, import_lodash_snakecase.default)(name).toUpperCase().replace(/_\d+/g, (r) => r.replace("_", ""));
|
|
689
674
|
}
|
|
690
675
|
/**
|
|
691
676
|
* The env key a construct provides for one of its roles.
|
|
@@ -710,7 +695,7 @@ function provideKey(id, role) {
|
|
|
710
695
|
* @example canonicalId('user-uploads') // 'UserUploads'
|
|
711
696
|
*/
|
|
712
697
|
function canonicalId(input) {
|
|
713
|
-
const id = (0,
|
|
698
|
+
const id = (0, import_lodash_snakecase.default)(input).split("_").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
714
699
|
if (!VALID_ID.test(id)) throw new InvalidConstructId(input, id);
|
|
715
700
|
return id;
|
|
716
701
|
}
|
|
@@ -862,7 +847,6 @@ function cookieDomain(urls) {
|
|
|
862
847
|
function providedKeyFor(id, kind, role) {
|
|
863
848
|
return kind === "secret" ? environmentCase(id) : provideKey(id, role);
|
|
864
849
|
}
|
|
865
|
-
|
|
866
850
|
//#endregion
|
|
867
851
|
//#region src/derive.ts
|
|
868
852
|
/** Whether a declaration names a parent. */
|
|
@@ -994,7 +978,6 @@ function publicEnvFor(declaration, manifest) {
|
|
|
994
978
|
}
|
|
995
979
|
return keys;
|
|
996
980
|
}
|
|
997
|
-
|
|
998
981
|
//#endregion
|
|
999
982
|
//#region src/index.ts
|
|
1000
983
|
/** Flatten a manifest field (array or partitioned) into a plain array. */
|
|
@@ -1002,7 +985,7 @@ function flattenManifestField(field) {
|
|
|
1002
985
|
if (!field) return [];
|
|
1003
986
|
return Array.isArray(field) ? [...field] : Object.values(field).flat();
|
|
1004
987
|
}
|
|
1005
|
-
|
|
1006
988
|
//#endregion
|
|
1007
|
-
export {
|
|
989
|
+
export { DEFAULT_POSTGRES_VERSION, DERIVES_FROM, IllegalDerivation, InvalidConstructId, PUBLIC, PUBLIC_PREFIX, UnknownParent, assertDerivations, cacheTable, canonicalId, cloudName, cookieDomain, dependenciesOf, dependentsOf, environmentCase, flattenManifestField, isDerived, kebabCase, provideKey, providedKeyFor, provisionOrder, publicEnvFor, scopedName, serviceKey };
|
|
990
|
+
|
|
1008
991
|
//# sourceMappingURL=index.mjs.map
|