@veryfront/ext-content-mdx 0.1.1257 → 0.1.1258-rc.18787
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/esm/deno.d.ts +3 -0
- package/esm/deno.js +6 -3
- package/esm/src/platform/compat/process/env.d.ts +42 -0
- package/esm/src/platform/compat/process/env.d.ts.map +1 -1
- package/esm/src/platform/compat/process/env.js +162 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.d.ts.map +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +4 -4
package/esm/deno.d.ts
CHANGED
|
@@ -324,9 +324,12 @@ declare namespace _default {
|
|
|
324
324
|
"#cli/observability/error-collector": string;
|
|
325
325
|
"#cli/observability/log-buffer": string;
|
|
326
326
|
"#cli/production-error-reporting": string;
|
|
327
|
+
"#cli/environment-config": string;
|
|
328
|
+
"#cli/host-api-base": string;
|
|
327
329
|
"#cli/host-runtime": string;
|
|
328
330
|
"#cli/platform-runtime": string;
|
|
329
331
|
"#cli/process-env": string;
|
|
332
|
+
"#cli/outbound-fetch": string;
|
|
330
333
|
"#cli/process-command": string;
|
|
331
334
|
"#cli/process-lifecycle": string;
|
|
332
335
|
"#cli/logger-config": string;
|
package/esm/deno.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1258-rc.18787",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"nodeModulesDir": "auto",
|
|
6
6
|
"minimumDependencyAge": {
|
|
@@ -395,9 +395,12 @@ export default {
|
|
|
395
395
|
"#cli/observability/error-collector": "./src/observability/error-collector.ts",
|
|
396
396
|
"#cli/observability/log-buffer": "./src/observability/log-buffer.ts",
|
|
397
397
|
"#cli/production-error-reporting": "./src/server/production-error-reporting.ts",
|
|
398
|
+
"#cli/environment-config": "./src/config/environment-config.ts",
|
|
399
|
+
"#cli/host-api-base": "./src/config/host-api-base.ts",
|
|
398
400
|
"#cli/host-runtime": "./src/platform/compat/process/host-runtime.ts",
|
|
399
401
|
"#cli/platform-runtime": "./src/platform/compat/runtime.ts",
|
|
400
402
|
"#cli/process-env": "./src/platform/compat/process/env.ts",
|
|
403
|
+
"#cli/outbound-fetch": "./src/security/http/outbound-fetch.ts",
|
|
401
404
|
"#cli/process-command": "./src/platform/compat/process/command.ts",
|
|
402
405
|
"#cli/process-lifecycle": "./src/platform/compat/process/lifecycle.ts",
|
|
403
406
|
"#cli/logger-config": "./src/utils/logger/logger.ts",
|
|
@@ -530,9 +533,9 @@ export default {
|
|
|
530
533
|
"verify:quick": "deno task generate:manifests:check && deno task test:layout && deno task fmt:check && deno task lint && deno task lint:ci-typescript && deno task lint:style && deno task lint:chat-composability && deno task lint:chat-ratchets && deno task lint:esm-sh-codemod && deno task lint:cli-boundary && deno task lint:wildcard-exports && deno task lint:barrel-jsdoc && deno task lint:ban-test-only && deno task lint:sanitizer-baseline && deno task lint:skipped-tests && deno task lint:ban-zod && deno task lint:cwd-relative-test-reads && deno task lint:test-semantic-dispositions && deno task lint:anti-slop && deno task lint:render-mode-defaults && deno task lint:core-deps && deno task lint:cross-runtime-jsr && deno task lint:dependency-boundaries && deno task lint:module-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:api-reference:check && deno task docs:errors:check && deno task docs:validate && deno task typecheck",
|
|
531
534
|
"typecheck:consumer": "deno run --allow-read --allow-run --allow-env --allow-write scripts/typecheck/run-consumer-typecheck.ts",
|
|
532
535
|
"codemod:chat": "deno run --frozen --config=scripts/codemods/deno.json --allow-read --allow-write --allow-env=BABEL_TYPES_8_BREAKING scripts/codemods/migrate-chat-composition.ts",
|
|
533
|
-
"codemod:esm-sh": "deno run --frozen --config=scripts/codemods/deno.json --allow-read --allow-write --allow-env=BABEL_TYPES_8_BREAKING scripts/codemods/migrate-esm-sh-imports.ts",
|
|
536
|
+
"codemod:esm-sh": "deno run --frozen --config=scripts/codemods/deno.json --allow-read --allow-write --allow-ffi --allow-env=BABEL_TYPES_8_BREAKING scripts/codemods/migrate-esm-sh-imports.ts",
|
|
534
537
|
"lint:chat-ratchets": "deno run --allow-read scripts/lint/ban-chat-antipatterns.ts && deno check --no-config --frozen --lock=deno.lock scripts/codemods/migrate-chat-composition.ts && deno check --config=deno.json --frozen --lock=deno.lock src/react/chat-barrels.check.ts && deno test --frozen --config=scripts/codemods/deno.json --no-check --allow-read --allow-write --allow-env=BABEL_TYPES_8_BREAKING scripts/codemods/migrate-chat-composition.test.ts",
|
|
535
|
-
"lint:esm-sh-codemod": "deno check --no-config --frozen --lock=deno.lock scripts/codemods/migrate-esm-sh-imports.ts && deno test --frozen --config=scripts/codemods/deno.json --no-check --allow-read --allow-write --allow-env=BABEL_TYPES_8_BREAKING
|
|
538
|
+
"lint:esm-sh-codemod": "deno check --no-config --frozen --lock=deno.lock scripts/codemods/migrate-esm-sh-imports.ts && deno task test:file scripts/codemods/pinned-directory.test.ts && deno test --frozen --config=scripts/codemods/deno.json --no-check --allow-read --allow-write --allow-ffi --allow-env=BABEL_TYPES_8_BREAKING tests/integration/codemods/",
|
|
536
539
|
"lint:test-typecheck": "deno run --allow-read --allow-run scripts/lint/check-test-typecheck-baseline.ts",
|
|
537
540
|
"lint:client-bundle": "deno lint --config=scripts/test.deno.json scripts/lint/client-bundle-graph.ts scripts/lint/audit-client-bundle.ts scripts/lint/client-bundle-graph.test.ts && deno run --allow-read scripts/lint/audit-client-bundle.ts && deno test --frozen --config=scripts/test.deno.json --no-check --allow-read scripts/lint/client-bundle-graph.test.ts",
|
|
538
541
|
"lint:client-bundle:update": "deno run --allow-read --allow-write scripts/lint/audit-client-bundle.ts --update",
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { ProjectEnvSnapshot } from "./project-env-contract.js";
|
|
2
|
+
/** Capture operator-owned API routing before project modules can mutate the process. */
|
|
3
|
+
export declare function captureHostApiEnvironment(): void;
|
|
4
|
+
/** @internal Record that an environment value came from a project env file. */
|
|
5
|
+
export declare function markEnvFileValue(key: string): void;
|
|
6
|
+
/** @internal Record that a non-env-file write replaced prior env-file provenance. */
|
|
7
|
+
export declare function clearEnvFileValueSource(key: string): void;
|
|
8
|
+
/** @internal Clear project env provenance alongside the env loader's test reset. */
|
|
9
|
+
export declare function clearEnvFileValueSources(): void;
|
|
10
|
+
/** @internal Report whether the current process value was copied from a project env file. */
|
|
11
|
+
export declare function hasEnvFileValueSource(key: string): boolean;
|
|
2
12
|
export type EnvOverlayStorage = {
|
|
3
13
|
getStore: () => unknown;
|
|
4
14
|
run?: <T>(store: unknown, fn: () => T) => T;
|
|
@@ -6,11 +16,43 @@ export type EnvOverlayStorage = {
|
|
|
6
16
|
};
|
|
7
17
|
/** Read and write process environment variables. */
|
|
8
18
|
export declare function env(): Record<string, string>;
|
|
19
|
+
/**
|
|
20
|
+
* Register a host-private credential under `key`.
|
|
21
|
+
*
|
|
22
|
+
* The value is held in memory only: it never reaches `Deno.env`,
|
|
23
|
+
* `process.env`, a child process environment, or {@link getEnv}, so project
|
|
24
|
+
* code running in the same process cannot read it. {@link getHostEnv} resolves
|
|
25
|
+
* it after the real environment, so an explicitly exported variable still wins.
|
|
26
|
+
*
|
|
27
|
+
* Part of the contract for every registered key: a host variable that is
|
|
28
|
+
* exported but blank (empty or whitespace-only) does not shadow the
|
|
29
|
+
* credential — {@link getHostEnv} treats such a value as unset for that key
|
|
30
|
+
* and returns the registered credential instead. Register a credential only
|
|
31
|
+
* when a blank export must not suppress it; a caller that needs a blank
|
|
32
|
+
* export to win must not use this store.
|
|
33
|
+
*/
|
|
34
|
+
export declare function setHostSecret(key: string, value: string): void;
|
|
35
|
+
/** Read a host-private credential registered by {@link setHostSecret}. */
|
|
36
|
+
export declare function getHostSecret(key: string): string | undefined;
|
|
37
|
+
/** Forget a host-private credential registered by {@link setHostSecret}. */
|
|
38
|
+
export declare function deleteHostSecret(key: string): void;
|
|
9
39
|
/**
|
|
10
40
|
* Read outside the project snapshot. Test overlays require a captured host DENO_TESTING=1.
|
|
11
41
|
* Tenant project scopes and later global mutations cannot shadow this read.
|
|
42
|
+
*
|
|
43
|
+
* Host-private credentials registered with {@link setHostSecret} resolve here
|
|
44
|
+
* and only here, so framework code reaches them while `getEnv()` — the reader
|
|
45
|
+
* project code can reach — does not.
|
|
46
|
+
*
|
|
47
|
+
* A host value that is defined but blank does not shadow a registered
|
|
48
|
+
* credential. The CLI normalizes `VERYFRONT_API_TOKEN=""` (or whitespace) to
|
|
49
|
+
* "unset" when it decides to register the stored login token, so treating that
|
|
50
|
+
* blank value as authoritative here would strand the credential and leave
|
|
51
|
+
* `dev`, `start`, workflow, and eval consumers with no usable token.
|
|
12
52
|
*/
|
|
13
53
|
export declare function getHostEnv(key: string): string | undefined;
|
|
54
|
+
/** Read host environment while excluding values copied from project env files. */
|
|
55
|
+
export declare function getHostEnvExcludingEnvFile(key: string): string | undefined;
|
|
14
56
|
/**
|
|
15
57
|
* Register the server-owned project environment snapshot bridge.
|
|
16
58
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/env.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/env.ts"],"names":[],"mappings":"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"}
|
|
@@ -20,9 +20,105 @@ const allowHostEnvTestOverlay = (() => {
|
|
|
20
20
|
return hostProcessEnv?.DENO_TESTING === "1";
|
|
21
21
|
})();
|
|
22
22
|
const MapConstructor = Map;
|
|
23
|
+
const mapDelete = Map.prototype.delete;
|
|
23
24
|
const mapEntries = Map.prototype.entries;
|
|
24
25
|
const mapGet = Map.prototype.get;
|
|
25
26
|
const mapHas = Map.prototype.has;
|
|
27
|
+
const mapSet = Map.prototype.set;
|
|
28
|
+
const SetConstructor = Set;
|
|
29
|
+
const setAdd = Set.prototype.add;
|
|
30
|
+
const setClear = Set.prototype.clear;
|
|
31
|
+
const setDelete = Set.prototype.delete;
|
|
32
|
+
const setForEach = Set.prototype.forEach;
|
|
33
|
+
const setHas = Set.prototype.has;
|
|
34
|
+
// Captured before project code runs: `getHostEnv` is on the credential path,
|
|
35
|
+
// so a project that replaces `String.prototype.trim` must not observe — or
|
|
36
|
+
// influence — how a host value is classified as blank.
|
|
37
|
+
const stringTrim = String.prototype.trim;
|
|
38
|
+
const stringToLowerCase = String.prototype.toLowerCase;
|
|
39
|
+
/**
|
|
40
|
+
* Host-private credentials, deliberately kept out of the process environment.
|
|
41
|
+
*
|
|
42
|
+
* The CLI resolves the developer's stored login token before it starts a
|
|
43
|
+
* server. In local development project route modules are imported into that
|
|
44
|
+
* same process, so anything placed in the environment — `Deno.env`,
|
|
45
|
+
* `process.env`, a spawned child's inherited env, or `getEnv()` — is readable
|
|
46
|
+
* by project-authored code, and a hostile project could exfiltrate the token
|
|
47
|
+
* just by being served. Values registered here are resolved only through
|
|
48
|
+
* {@link getHostEnv}, which the public `veryfront/*` entry points do not
|
|
49
|
+
* export, so framework code can still read them while project code reaching
|
|
50
|
+
* for a supported export cannot.
|
|
51
|
+
*
|
|
52
|
+
* The boundary is the export surface, not a realm: project modules are loaded
|
|
53
|
+
* with a plain dynamic `import()` into this same process, so code that
|
|
54
|
+
* resolves this file directly rather than through a `veryfront/*` entry shares
|
|
55
|
+
* the module instance and can still call {@link getHostSecret}. The import map
|
|
56
|
+
* and the module-boundary lint are what keep that path closed, exactly as for
|
|
57
|
+
* {@link registerTrustedProjectEnvSnapshot}. What this store buys is that the
|
|
58
|
+
* credential is no longer reachable through the ordinary, fully supported
|
|
59
|
+
* readers — `Deno.env`, `process.env`, {@link getEnv}, and a spawned child's
|
|
60
|
+
* inherited environment.
|
|
61
|
+
*/
|
|
62
|
+
const hostSecrets = new MapConstructor();
|
|
63
|
+
const envFileValueKeys = new SetConstructor();
|
|
64
|
+
const hostApiEnvSnapshot = new MapConstructor();
|
|
65
|
+
const HOST_API_ENV_KEYS = ["VERYFRONT_API_URL", "VERYFRONT_API_BASE_URL"];
|
|
66
|
+
/** Capture operator-owned API routing before project modules can mutate the process. */
|
|
67
|
+
export function captureHostApiEnvironment() {
|
|
68
|
+
for (const apiKey of HOST_API_ENV_KEYS) {
|
|
69
|
+
if (apply(mapHas, hostApiEnvSnapshot, [apiKey]))
|
|
70
|
+
continue;
|
|
71
|
+
const trustedValue = hasEnvFileValueSource(apiKey) ? undefined : readHostProcessEnv(apiKey);
|
|
72
|
+
apply(mapSet, hostApiEnvSnapshot, [apiKey, trustedValue]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** @internal Record that an environment value came from a project env file. */
|
|
76
|
+
export function markEnvFileValue(key) {
|
|
77
|
+
apply(setAdd, envFileValueKeys, [key]);
|
|
78
|
+
}
|
|
79
|
+
/** @internal Record that a non-env-file write replaced prior env-file provenance. */
|
|
80
|
+
export function clearEnvFileValueSource(key) {
|
|
81
|
+
const foldedKey = apply(stringToLowerCase, key, []);
|
|
82
|
+
apply(setForEach, envFileValueKeys, [
|
|
83
|
+
(recordedKey) => {
|
|
84
|
+
if (apply(stringToLowerCase, recordedKey, []) === foldedKey) {
|
|
85
|
+
apply(setDelete, envFileValueKeys, [recordedKey]);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
/** @internal Clear project env provenance alongside the env loader's test reset. */
|
|
91
|
+
export function clearEnvFileValueSources() {
|
|
92
|
+
if (!allowHostEnvTestOverlay)
|
|
93
|
+
return;
|
|
94
|
+
apply(setClear, envFileValueKeys, []);
|
|
95
|
+
}
|
|
96
|
+
/** @internal Report whether the current process value was copied from a project env file. */
|
|
97
|
+
export function hasEnvFileValueSource(key) {
|
|
98
|
+
if (apply(setHas, envFileValueKeys, [key]))
|
|
99
|
+
return true;
|
|
100
|
+
// Windows aliases environment names case-insensitively, while the env
|
|
101
|
+
// loader records the spelling used in the file. Confirm an alias against
|
|
102
|
+
// the live value before accepting it. Running the verified check on every
|
|
103
|
+
// host is conservative: on a case-sensitive host it can only classify two
|
|
104
|
+
// differently cased keys as the same source when their values are equal.
|
|
105
|
+
const value = readHostProcessEnv(key);
|
|
106
|
+
if (value === undefined)
|
|
107
|
+
return false;
|
|
108
|
+
const foldedKey = apply(stringToLowerCase, key, []);
|
|
109
|
+
let matchesAlias = false;
|
|
110
|
+
apply(setForEach, envFileValueKeys, [
|
|
111
|
+
(recordedKey) => {
|
|
112
|
+
if (matchesAlias || recordedKey === key)
|
|
113
|
+
return;
|
|
114
|
+
const foldedRecordedKey = apply(stringToLowerCase, recordedKey, []);
|
|
115
|
+
if (foldedRecordedKey !== foldedKey)
|
|
116
|
+
return;
|
|
117
|
+
matchesAlias = readHostProcessEnv(recordedKey) === value;
|
|
118
|
+
},
|
|
119
|
+
]);
|
|
120
|
+
return matchesAlias;
|
|
121
|
+
}
|
|
26
122
|
function getEnvOverlayStore() {
|
|
27
123
|
const storage = getEnvOverlayStorage();
|
|
28
124
|
const store = storage?.getStore();
|
|
@@ -63,11 +159,73 @@ export function env() {
|
|
|
63
159
|
}
|
|
64
160
|
return base;
|
|
65
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Register a host-private credential under `key`.
|
|
164
|
+
*
|
|
165
|
+
* The value is held in memory only: it never reaches `Deno.env`,
|
|
166
|
+
* `process.env`, a child process environment, or {@link getEnv}, so project
|
|
167
|
+
* code running in the same process cannot read it. {@link getHostEnv} resolves
|
|
168
|
+
* it after the real environment, so an explicitly exported variable still wins.
|
|
169
|
+
*
|
|
170
|
+
* Part of the contract for every registered key: a host variable that is
|
|
171
|
+
* exported but blank (empty or whitespace-only) does not shadow the
|
|
172
|
+
* credential — {@link getHostEnv} treats such a value as unset for that key
|
|
173
|
+
* and returns the registered credential instead. Register a credential only
|
|
174
|
+
* when a blank export must not suppress it; a caller that needs a blank
|
|
175
|
+
* export to win must not use this store.
|
|
176
|
+
*/
|
|
177
|
+
export function setHostSecret(key, value) {
|
|
178
|
+
if (key === "VERYFRONT_API_TOKEN") {
|
|
179
|
+
captureHostApiEnvironment();
|
|
180
|
+
}
|
|
181
|
+
apply(mapSet, hostSecrets, [key, value]);
|
|
182
|
+
}
|
|
183
|
+
/** Read a host-private credential registered by {@link setHostSecret}. */
|
|
184
|
+
export function getHostSecret(key) {
|
|
185
|
+
return apply(mapGet, hostSecrets, [key]);
|
|
186
|
+
}
|
|
187
|
+
/** Forget a host-private credential registered by {@link setHostSecret}. */
|
|
188
|
+
export function deleteHostSecret(key) {
|
|
189
|
+
apply(mapDelete, hostSecrets, [key]);
|
|
190
|
+
if (key === "VERYFRONT_API_TOKEN") {
|
|
191
|
+
for (const apiKey of HOST_API_ENV_KEYS)
|
|
192
|
+
apply(mapDelete, hostApiEnvSnapshot, [apiKey]);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
66
195
|
/**
|
|
67
196
|
* Read outside the project snapshot. Test overlays require a captured host DENO_TESTING=1.
|
|
68
197
|
* Tenant project scopes and later global mutations cannot shadow this read.
|
|
198
|
+
*
|
|
199
|
+
* Host-private credentials registered with {@link setHostSecret} resolve here
|
|
200
|
+
* and only here, so framework code reaches them while `getEnv()` — the reader
|
|
201
|
+
* project code can reach — does not.
|
|
202
|
+
*
|
|
203
|
+
* A host value that is defined but blank does not shadow a registered
|
|
204
|
+
* credential. The CLI normalizes `VERYFRONT_API_TOKEN=""` (or whitespace) to
|
|
205
|
+
* "unset" when it decides to register the stored login token, so treating that
|
|
206
|
+
* blank value as authoritative here would strand the credential and leave
|
|
207
|
+
* `dev`, `start`, workflow, and eval consumers with no usable token.
|
|
69
208
|
*/
|
|
70
209
|
export function getHostEnv(key) {
|
|
210
|
+
const value = readHostProcessEnv(key);
|
|
211
|
+
if (value !== undefined && apply(stringTrim, value, []) !== "")
|
|
212
|
+
return value;
|
|
213
|
+
// Only a registered credential displaces the blank host value; without one
|
|
214
|
+
// the host environment is still reported verbatim.
|
|
215
|
+
const secret = getHostSecret(key);
|
|
216
|
+
return secret !== undefined ? secret : value;
|
|
217
|
+
}
|
|
218
|
+
/** Read host environment while excluding values copied from project env files. */
|
|
219
|
+
export function getHostEnvExcludingEnvFile(key) {
|
|
220
|
+
if (getHostSecret("VERYFRONT_API_TOKEN") !== undefined && apply(mapHas, hostApiEnvSnapshot, [key])) {
|
|
221
|
+
return apply(mapGet, hostApiEnvSnapshot, [key]);
|
|
222
|
+
}
|
|
223
|
+
if (hasEnvFileValueSource(key))
|
|
224
|
+
return getHostSecret(key);
|
|
225
|
+
return getHostEnv(key);
|
|
226
|
+
}
|
|
227
|
+
/** The host process environment alone, without host-private credentials. */
|
|
228
|
+
function readHostProcessEnv(key) {
|
|
71
229
|
if (denoRuntime && denoEnv && denoEnvGet) {
|
|
72
230
|
let value;
|
|
73
231
|
try {
|
|
@@ -191,7 +349,10 @@ export function getEnv(key) {
|
|
|
191
349
|
// the raw object resolve a key by the same rule, writes included.
|
|
192
350
|
return readProjectScopedEnv(projectEnv, key);
|
|
193
351
|
}
|
|
194
|
-
|
|
352
|
+
// Host process environment only. Host-private credentials stay out of this
|
|
353
|
+
// reader: local development imports project route modules into this process,
|
|
354
|
+
// and `getEnv()` is the accessor those modules can call.
|
|
355
|
+
return readHostProcessEnv(key);
|
|
195
356
|
}
|
|
196
357
|
const DEFAULT_ENV_TRUE_VALUES = ["1", "true", "yes"];
|
|
197
358
|
const DEFAULT_ENV_FALSE_VALUES = ["0", "false", "no"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-constant.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version-constant.ts"],"names":[],"mappings":"AAEA,4BAA4B;AAC5B,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version-constant.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version-constant.ts"],"names":[],"mappings":"AAEA,4BAA4B;AAC5B,eAAO,MAAM,OAAO,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veryfront/ext-content-mdx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1258-rc.18787",
|
|
4
4
|
"description": "Veryfront first-party extension package for ext-content-mdx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"veryfront",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/hast": "3.0.3",
|
|
54
54
|
"@types/mdast": "4.0.3",
|
|
55
55
|
"@types/unist": "3.0.2",
|
|
56
|
-
"@veryfront/ext-parser-babel": "0.1.
|
|
56
|
+
"@veryfront/ext-parser-babel": "0.1.1258-rc.18787",
|
|
57
57
|
"acorn": "8.17.0",
|
|
58
58
|
"acorn-jsx": "5.3.2",
|
|
59
59
|
"github-slugger": "2.0.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"vfile": "6.0.3"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
|
-
"veryfront": "^0.1.
|
|
85
|
+
"veryfront": "^0.1.1258-rc.18787"
|
|
86
86
|
},
|
|
87
87
|
"type": "module",
|
|
88
88
|
"types": "./esm/extensions/ext-content-mdx/src/index.d.ts",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"NOTICE",
|
|
93
93
|
"README.md"
|
|
94
94
|
],
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "f1ce510fe0df2a7a6646a13e192feb81927b75ec"
|
|
96
96
|
}
|