@veryfront/ext-content-mdx 0.1.1191 → 0.1.1193

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 CHANGED
@@ -420,6 +420,7 @@ declare namespace _default {
420
420
  "lint:esm-sh-codemod": string;
421
421
  "lint:test-typecheck": string;
422
422
  docs: string;
423
+ "docs:api-reference:check": string;
423
424
  "docs:coverage": string;
424
425
  "docs:copy": string;
425
426
  "docs:validate": string;
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.1191",
3
+ "version": "0.1.1193",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -487,8 +487,8 @@ export default {
487
487
  "fmt": "deno fmt src/ cli/ react/ && deno fmt --config=scripts/test.deno.json scripts/test/ scripts/build/dnt-polyfill.ts scripts/build/dnt-polyfill.test.ts scripts/build/prepare-framework-sources.test.ts && deno fmt --config=scripts/codemods/deno.json scripts/codemods/",
488
488
  "fmt:check": "deno fmt --check src/ cli/ react/ && deno fmt --check --config=scripts/test.deno.json scripts/test/ scripts/build/dnt-polyfill.ts scripts/build/dnt-polyfill.test.ts scripts/build/prepare-framework-sources.test.ts && deno fmt --check --config=scripts/codemods/deno.json scripts/codemods/",
489
489
  "typecheck": "deno task generate:manifests:check && deno check src/index.ts cli/main.ts src/server/index.ts src/routing/api/index.ts src/rendering/index.ts src/platform/index.ts src/platform/adapters/index.ts src/build/index.ts src/build/production-build/index.ts src/transforms/index.ts src/config/index.ts src/utils/index.ts src/data/index.ts src/security/index.ts src/middleware/index.ts src/server/handlers/dev/index.ts src/server/handlers/request/api/index.ts src/rendering/cache/index.ts src/rendering/cache/stores/index.ts src/rendering/rsc/actions/index.ts src/html/index.ts src/html/hydration-script-builder/runtime/main.ts src/modules/index.ts src/proxy/main.ts src/react/components/ui/index.ts src/chat/index.ts src/markdown/index.ts src/mdx/index.ts src/fs/index.ts src/oauth/index.ts src/agent/index.ts src/agent/service/route-export.check.ts src/eval/index.ts src/tool/index.ts src/workflow/index.ts src/prompt/index.ts src/resource/index.ts src/runs/index.ts src/mcp/index.ts src/provider/index.ts",
490
- "verify": "deno task generate:manifests:check && deno task fmt:check && deno task lint && 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:core-deps && deno task lint:dependency-boundaries && deno task lint:module-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck && deno task typecheck:consumer && deno task test && deno task test:e2e:binary",
491
- "verify:quick": "deno task generate:manifests:check && deno task fmt:check && deno task lint && 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:core-deps && deno task lint:dependency-boundaries && deno task lint:module-boundaries && deno task lint:extension-contracts && deno task lint:extension-capabilities && deno task docs:validate && deno task typecheck",
490
+ "verify": "deno task generate:manifests:check && deno task fmt:check && deno task lint && 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:core-deps && 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:validate && deno task typecheck && deno task typecheck:consumer && deno task test && deno task test:e2e:binary",
491
+ "verify:quick": "deno task generate:manifests:check && deno task fmt:check && deno task lint && 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:core-deps && 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:validate && deno task typecheck",
492
492
  "typecheck:consumer": "deno run --allow-read --allow-run --allow-env --allow-write scripts/typecheck/run-consumer-typecheck.ts",
493
493
  "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",
494
494
  "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",
@@ -496,6 +496,7 @@ export default {
496
496
  "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 scripts/codemods/migrate-esm-sh-imports.test.ts",
497
497
  "lint:test-typecheck": "deno run --allow-read --allow-run scripts/lint/check-test-typecheck-baseline.ts",
498
498
  "docs": "deno run --allow-read --allow-write --allow-run --allow-env scripts/docs/generate-api-reference.ts",
499
+ "docs:api-reference:check": "deno run --allow-read --allow-write --allow-run --allow-env scripts/docs/generate-api-reference.ts --check",
499
500
  "docs:coverage": "deno run --allow-read scripts/docs/docs-coverage.ts",
500
501
  "docs:copy": "rm -rf ../../docs/docs/code/api-reference && cp -r docs/api-reference/ ../../docs/docs/code/api-reference/",
501
502
  "docs:validate": "deno run --allow-read scripts/docs/validate-api-reference.ts && deno run --allow-read scripts/docs/validate-guides.ts && deno run --allow-read scripts/docs/validate-public-docs.ts && deno test --config=scripts/test.deno.json --no-check --allow-read scripts/docs/docs-coverage.test.ts && deno test --no-check --allow-read tests/docs/guide-contracts.test.ts tests/docs/guide-content.test.ts && DENO_TESTING=1 deno test --no-check --allow-all tests/docs/guide-examples.test.ts tests/docs/guide-code-examples.test.ts && deno run -A scripts/lint/check-doc-links.ts",
@@ -524,7 +525,7 @@ export default {
524
525
  "lint:ban-test-only": "deno run --allow-read scripts/lint/ban-test-only.ts",
525
526
  "lint:sanitizer-baseline": "deno run --allow-read scripts/lint/check-sanitizer-baseline.ts",
526
527
  "lint:skipped-tests": "deno run --allow-read scripts/lint/check-skipped-tests-baseline.ts",
527
- "test:scripts": "deno test --config=scripts/test.deno.json --no-check --allow-read --allow-write --allow-run scripts/ci/publish-npm-packages.test.ts scripts/build/compile-binary.test.ts scripts/build/dnt-polyfill.test.ts scripts/build/generate-sbom.test.ts scripts/build/npm-dependency-sources.test.ts scripts/build/npm-extension-package-metadata.test.ts scripts/build/npm-package-metadata.test.ts scripts/build/npm-react-shims.test.ts scripts/build/prepare-framework-sources.test.ts scripts/docs/docs-coverage.test.ts scripts/docs/generate-api-reference.test.ts scripts/docs/guide-validation.test.ts scripts/lint/audit-core-deps.test.ts scripts/lint/audit-dependency-boundaries.test.ts scripts/lint/audit-extension-capabilities.test.ts scripts/lint/audit-extension-contracts.test.ts scripts/lint/audit-deps.test.ts scripts/lint/check-module-boundaries.test.ts scripts/lint/lint-config.test.ts scripts/lint/ban-test-only.test.ts scripts/lint/check-sanitizer-baseline.test.ts scripts/lint/check-skipped-tests-baseline.test.ts scripts/lint/check-test-typecheck-baseline.test.ts scripts/lint/check-coverage.test.ts scripts/security/audit-npm.test.ts scripts/security/submit-dependency-snapshot.test.ts && deno task test:tool-search-live",
528
+ "test:scripts": "deno test --config=scripts/test.deno.json --no-check --allow-read --allow-write --allow-run scripts/ci/publish-npm-packages.test.ts scripts/ci/setup-deno-workflow.test.ts scripts/build/compile-binary.test.ts scripts/build/dnt-polyfill.test.ts scripts/build/generate-sbom.test.ts scripts/build/npm-dependency-sources.test.ts scripts/build/npm-extension-package-metadata.test.ts scripts/build/npm-package-metadata.test.ts scripts/build/npm-react-shims.test.ts scripts/build/npm-runtime-helper-contract.test.ts scripts/build/prepare-framework-sources.test.ts scripts/docs/docs-coverage.test.ts scripts/docs/generate-api-reference.test.ts scripts/docs/guide-validation.test.ts scripts/lint/audit-core-deps.test.ts scripts/lint/audit-dependency-boundaries.test.ts scripts/lint/audit-extension-capabilities.test.ts scripts/lint/audit-extension-contracts.test.ts scripts/lint/audit-deps.test.ts scripts/lint/check-module-boundaries.test.ts scripts/lint/lint-config.test.ts scripts/lint/ban-test-only.test.ts scripts/lint/check-sanitizer-baseline.test.ts scripts/lint/check-skipped-tests-baseline.test.ts scripts/lint/check-test-typecheck-baseline.test.ts scripts/lint/check-coverage.test.ts scripts/security/audit-npm.test.ts scripts/security/submit-dependency-snapshot.test.ts && deno task test:tool-search-live",
528
529
  "test:sentry-runtime-packages": "deno test --config=scripts/test.deno.json --no-check --no-lock --allow-read --allow-write --allow-run --allow-env=DENO_DIR,HOME,XDG_CACHE_HOME,LOCALAPPDATA,USERPROFILE scripts/build/sentry-runtime-packages.test.ts",
529
530
  "test:tool-search-live": "VF_DISABLE_LRU_INTERVAL=1 deno test --no-check -A tests/agent/verify-tool-search-live.test.ts",
530
531
  "test:cross-runtime": "deno run --allow-all src/platform/compat/cross-runtime.test.ts",
@@ -545,7 +546,7 @@ export default {
545
546
  "sbom": "deno run --allow-read --allow-write scripts/build/generate-sbom.ts",
546
547
  "sbom:all": "deno run --allow-read --allow-write scripts/build/generate-sbom.ts --all-manifests",
547
548
  "submit-deps": "deno run --allow-read --allow-env --allow-net=api.github.com scripts/security/submit-dependency-snapshot.ts",
548
- "audit": "deno run --allow-read --allow-run --allow-write scripts/security/audit-npm.ts"
549
+ "audit": "deno run --allow-read --allow-run --allow-write scripts/security/audit-npm.ts && npm --prefix storybook audit --package-lock-only --audit-level=high"
549
550
  },
550
551
  "lint": {
551
552
  "include": [
@@ -66,6 +66,12 @@ export declare function appendSameOriginDependencyPinningPathKey(url: string, de
66
66
  * Foreign origins and flag-off requests are preserved byte-for-byte.
67
67
  */
68
68
  export declare function appendSameOriginSSRDependencyPinningKey(url: string, dependencyPinningCacheKey?: string, moduleServerOrigin?: string): string;
69
+ /**
70
+ * Bind a same-origin absolute module URL to an SSR dependency snapshot using
71
+ * the module-server path transport. Use this only when the consumer resolves
72
+ * `/_vf_modules/` paths through the module server instead of generic fetch.
73
+ */
74
+ export declare function appendSameOriginSSRDependencyPinningPathKey(url: string, dependencyPinningCacheKey?: string, moduleServerOrigin?: string): string;
69
75
  export interface ExtractedDependencyPinningPath {
70
76
  pathname: string;
71
77
  cacheKey?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"url-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/import-rewriter/url-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,2BAA2B;AAC3B,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,kEAAkE;AAClE,eAAO,MAAM,eAAe,UAAU,CAAC;AAEvC,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AA0BF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,CAQR;AAgBD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,GAAG,WAAW,EAC1B,OAAO,EAAE,MAAM,E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AG5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAGhG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAgDtE"}
1
+ {"version":3,"file":"url-builder.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/import-rewriter/url-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,2BAA2B;AAC3B,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,kEAAkE;AAClE,eAAO,MAAM,eAAe,UAAU,CAAC;AAEvC,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AA0BF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,CAQR;AAgBD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,OAAO,GAAG,WAAW,EAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,UAAQ,GACf,MAAM,CAKR;AAYD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAazE;AAED;;GA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kB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAGhG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAgDtE"}
@@ -120,6 +120,17 @@ export function appendDependencyPinningKey(url, dependencyPinningCacheKey) {
120
120
  const DEPENDENCY_PINNING_PATH_MARKER = "_pins/";
121
121
  const MODULE_SERVER_PATH_PREFIXES = ["/_vf_modules/"];
122
122
  const DEPENDENCY_PINNING_PATH_KEY_PATTERN = /^on:[A-Za-z0-9._-]+$/;
123
+ function splitUrlComponents(url) {
124
+ const hashIndex = url.indexOf("#");
125
+ const hash = hashIndex === -1 ? "" : url.slice(hashIndex);
126
+ const urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
127
+ const queryIndex = urlWithoutHash.indexOf("?");
128
+ return {
129
+ path: queryIndex === -1 ? urlWithoutHash : urlWithoutHash.slice(0, queryIndex),
130
+ params: new URLSearchParams(queryIndex === -1 ? "" : urlWithoutHash.slice(queryIndex + 1)),
131
+ hash,
132
+ };
133
+ }
123
134
  function decodeDependencyPinningPathKey(encodedKey) {
124
135
  try {
125
136
  const cacheKey = decodeURIComponent(encodedKey);
@@ -129,6 +140,15 @@ function decodeDependencyPinningPathKey(encodedKey) {
129
140
  return undefined;
130
141
  }
131
142
  }
143
+ function hasMalformedPercentEncoding(value) {
144
+ try {
145
+ decodeURIComponent(value);
146
+ return false;
147
+ }
148
+ catch {
149
+ return true;
150
+ }
151
+ }
132
152
  /**
133
153
  * Bind an import-map prefix target to a dependency snapshot without adding a
134
154
  * query string. Import-map prefix targets must end in `/`; placing the token in
@@ -138,12 +158,7 @@ function decodeDependencyPinningPathKey(encodedKey) {
138
158
  export function appendDependencyPinningPathKey(url, dependencyPinningCacheKey) {
139
159
  if (!dependencyPinningCacheKey?.startsWith("on:"))
140
160
  return url;
141
- const hashIndex = url.indexOf("#");
142
- const hash = hashIndex === -1 ? "" : url.slice(hashIndex);
143
- const urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
144
- const queryIndex = urlWithoutHash.indexOf("?");
145
- const path = queryIndex === -1 ? urlWithoutHash : urlWithoutHash.slice(0, queryIndex);
146
- const params = new URLSearchParams(queryIndex === -1 ? "" : urlWithoutHash.slice(queryIndex + 1));
161
+ const { path, params, hash } = splitUrlComponents(url);
147
162
  for (const prefix of MODULE_SERVER_PATH_PREFIXES) {
148
163
  const prefixIndex = path.indexOf(prefix);
149
164
  if (prefixIndex === -1)
@@ -213,8 +228,37 @@ export function appendSameOriginSSRDependencyPinningKey(url, dependencyPinningCa
213
228
  !target.pathname.startsWith("/_vf_modules/")) {
214
229
  return url;
215
230
  }
216
- target.searchParams.set("ssr", "true");
217
- return appendDependencyPinningKey(target.href, dependencyPinningCacheKey);
231
+ const params = target.searchParams;
232
+ params.set("pins", dependencyPinningCacheKey);
233
+ params.set("ssr", "true");
234
+ return target.toString();
235
+ }
236
+ catch {
237
+ return url;
238
+ }
239
+ }
240
+ /**
241
+ * Bind a same-origin absolute module URL to an SSR dependency snapshot using
242
+ * the module-server path transport. Use this only when the consumer resolves
243
+ * `/_vf_modules/` paths through the module server instead of generic fetch.
244
+ */
245
+ export function appendSameOriginSSRDependencyPinningPathKey(url, dependencyPinningCacheKey, moduleServerOrigin) {
246
+ if (!dependencyPinningCacheKey?.startsWith("on:") ||
247
+ !moduleServerOrigin ||
248
+ (!/^https?:\/\//i.test(url) && !url.startsWith("//"))) {
249
+ return url;
250
+ }
251
+ try {
252
+ const requestOrigin = new URL(moduleServerOrigin);
253
+ const target = new URL(url, requestOrigin);
254
+ if (target.origin !== requestOrigin.origin ||
255
+ !target.pathname.startsWith("/_vf_modules/")) {
256
+ return url;
257
+ }
258
+ const moduleUrl = appendDependencyPinningPathKey(`${target.pathname}${target.search}${target.hash}`, dependencyPinningCacheKey);
259
+ const { path, params, hash } = splitUrlComponents(moduleUrl);
260
+ params.set("ssr", "true");
261
+ return `${path}?${params.toString()}${hash}`;
218
262
  }
219
263
  catch {
220
264
  return url;
@@ -235,6 +279,9 @@ export function extractDependencyPinningPathKey(pathname) {
235
279
  const encodedKey = separatorIndex === -1
236
280
  ? encodedKeyAndPath
237
281
  : encodedKeyAndPath.slice(0, separatorIndex);
282
+ if (hasMalformedPercentEncoding(encodedKey)) {
283
+ return { pathname, found: true, malformed: true };
284
+ }
238
285
  const cacheKey = decodeDependencyPinningPathKey(encodedKey);
239
286
  if (!cacheKey) {
240
287
  return { pathname, found: false, malformed: false };
@@ -244,13 +291,7 @@ export function extractDependencyPinningPathKey(pathname) {
244
291
  }
245
292
  const modulePath = encodedKeyAndPath.slice(separatorIndex + 1);
246
293
  if (modulePath.startsWith(DEPENDENCY_PINNING_PATH_MARKER)) {
247
- const nestedKeyEnd = modulePath.indexOf("/", DEPENDENCY_PINNING_PATH_MARKER.length);
248
- const nestedEncodedKey = nestedKeyEnd === -1
249
- ? modulePath.slice(DEPENDENCY_PINNING_PATH_MARKER.length)
250
- : modulePath.slice(DEPENDENCY_PINNING_PATH_MARKER.length, nestedKeyEnd);
251
- if (decodeDependencyPinningPathKey(nestedEncodedKey)) {
252
- return { pathname, found: true, malformed: true };
253
- }
294
+ return { pathname, found: true, malformed: true };
254
295
  }
255
296
  return {
256
297
  pathname: `${prefix}${modulePath}`,
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.1191";
2
+ export declare const VERSION = "0.1.1193";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.1191";
4
+ export const VERSION = "0.1.1193";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veryfront/ext-content-mdx",
3
- "version": "0.1.1191",
3
+ "version": "0.1.1193",
4
4
  "description": "Veryfront first-party extension package for ext-content-mdx",
5
5
  "keywords": [
6
6
  "veryfront",
@@ -67,7 +67,7 @@
67
67
  "vfile": "6.0.3"
68
68
  },
69
69
  "peerDependencies": {
70
- "veryfront": "^0.1.1191"
70
+ "veryfront": "^0.1.1193"
71
71
  },
72
72
  "type": "module",
73
73
  "types": "./esm/extensions/ext-content-mdx/src/index.d.ts",