@nuxt/scripts 0.4.3 → 0.4.4

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.
Files changed (76) hide show
  1. package/dist/client/200.html +14 -13
  2. package/dist/client/404.html +14 -13
  3. package/dist/client/_nuxt/Bf6Ng02J.js +31 -0
  4. package/dist/client/_nuxt/{BvCpKIQU.js → BsZo98M5.js} +1 -1
  5. package/dist/client/_nuxt/{DH8runP0.js → C0cterrC.js} +1 -1
  6. package/dist/client/_nuxt/{B9E_xdxs.js → CNkYXcD4.js} +1 -1
  7. package/dist/client/_nuxt/{DsudziMp.js → COIrKlfF.js} +1 -1
  8. package/dist/client/_nuxt/C_ZPRiAj.js +26 -0
  9. package/dist/client/_nuxt/{B4ACM-c0.js → DCjyzNN-.js} +1 -1
  10. package/dist/client/_nuxt/{DKlGn9uv.js → DGEpfOTx.js} +1 -1
  11. package/dist/client/_nuxt/Dd6f7Z5P.js +1 -0
  12. package/dist/client/_nuxt/{B9T-hdPi.js → ISosJq17.js} +1 -1
  13. package/dist/client/_nuxt/MN12aA4C.js +1 -0
  14. package/dist/client/_nuxt/builds/latest.json +1 -1
  15. package/dist/client/_nuxt/builds/meta/3255a134-7caf-4d76-96f4-05475e276415.json +1 -0
  16. package/dist/client/_nuxt/{BcF9sHHc.js → o8H-iTt6.js} +2 -2
  17. package/dist/client/_nuxt/xtV5iK4E.js +1 -0
  18. package/dist/client/index.html +14 -13
  19. package/dist/module.d.mts +1 -1
  20. package/dist/module.d.ts +1 -1
  21. package/dist/module.json +2 -2
  22. package/dist/registry.d.mts +4 -4
  23. package/dist/registry.d.ts +4 -4
  24. package/dist/runtime/composables/useAnalyticsPageEvent.d.ts +1 -4
  25. package/dist/runtime/composables/useConsentScriptTrigger.d.ts +1 -1
  26. package/dist/runtime/composables/useElementScriptTrigger.d.ts +1 -1
  27. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +4 -17
  28. package/dist/runtime/registry/{cloudflare-web-analytics.mjs → cloudflare-web-analytics.js} +1 -2
  29. package/dist/runtime/registry/fathom-analytics.d.ts +4 -29
  30. package/dist/runtime/registry/{fathom-analytics.mjs → fathom-analytics.js} +1 -1
  31. package/dist/runtime/registry/google-analytics.d.ts +4 -9
  32. package/dist/runtime/registry/{google-analytics.mjs → google-analytics.js} +1 -1
  33. package/dist/runtime/registry/google-maps.d.ts +4 -10
  34. package/dist/runtime/registry/{google-maps.mjs → google-maps.js} +1 -1
  35. package/dist/runtime/registry/google-tag-manager.d.ts +4 -6
  36. package/dist/runtime/registry/{google-tag-manager.mjs → google-tag-manager.js} +1 -1
  37. package/dist/runtime/registry/hotjar.d.ts +4 -8
  38. package/dist/runtime/registry/{hotjar.mjs → hotjar.js} +1 -1
  39. package/dist/runtime/registry/intercom.d.ts +4 -20
  40. package/dist/runtime/registry/{intercom.mjs → intercom.js} +1 -1
  41. package/dist/runtime/registry/lemon-squeezy.d.ts +3 -1
  42. package/dist/runtime/registry/{lemon-squeezy.mjs → lemon-squeezy.js} +1 -2
  43. package/dist/runtime/registry/matomo-analytics.d.ts +4 -12
  44. package/dist/runtime/registry/{matomo-analytics.mjs → matomo-analytics.js} +1 -2
  45. package/dist/runtime/registry/meta-pixel.d.ts +4 -6
  46. package/dist/runtime/registry/{meta-pixel.mjs → meta-pixel.js} +1 -2
  47. package/dist/runtime/registry/npm.d.ts +4 -12
  48. package/dist/runtime/registry/{npm.mjs → npm.js} +1 -1
  49. package/dist/runtime/registry/plausible-analytics.d.ts +4 -8
  50. package/dist/runtime/registry/{plausible-analytics.mjs → plausible-analytics.js} +1 -1
  51. package/dist/runtime/registry/segment.d.ts +4 -8
  52. package/dist/runtime/registry/{segment.mjs → segment.js} +1 -1
  53. package/dist/runtime/registry/stripe.d.ts +4 -6
  54. package/dist/runtime/registry/{stripe.mjs → stripe.js} +1 -3
  55. package/dist/runtime/registry/vimeo-player.d.ts +3 -1
  56. package/dist/runtime/registry/{vimeo-player.mjs → vimeo-player.js} +1 -1
  57. package/dist/runtime/registry/x-pixel.d.ts +4 -8
  58. package/dist/runtime/registry/{x-pixel.mjs → x-pixel.js} +1 -2
  59. package/dist/runtime/registry/youtube-player.d.ts +3 -1
  60. package/dist/runtime/registry/{youtube-player.mjs → youtube-player.js} +1 -2
  61. package/dist/runtime/types.d.ts +17 -17
  62. package/dist/runtime/utils.d.ts +5 -3
  63. package/package.json +16 -15
  64. package/dist/client/_nuxt/Bsp1M94H.js +0 -1
  65. package/dist/client/_nuxt/C9UBdavN.js +0 -1
  66. package/dist/client/_nuxt/D2Id3jI5.js +0 -31
  67. package/dist/client/_nuxt/Dz2Ca8U2.js +0 -1
  68. package/dist/client/_nuxt/builds/meta/57975886-3e65-4f06-9b8d-c072a775a94c.json +0 -1
  69. /package/dist/runtime/composables/{useAnalyticsPageEvent.mjs → useAnalyticsPageEvent.js} +0 -0
  70. /package/dist/runtime/composables/{useConsentScriptTrigger.mjs → useConsentScriptTrigger.js} +0 -0
  71. /package/dist/runtime/composables/{useElementScriptTrigger.mjs → useElementScriptTrigger.js} +0 -0
  72. /package/dist/runtime/composables/{useScript.mjs → useScript.js} +0 -0
  73. /package/dist/runtime/{types.mjs → types.js} +0 -0
  74. /package/dist/runtime/{utils.mjs → utils.js} +0 -0
  75. /package/dist/runtime/validation/{mock.mjs → mock.js} +0 -0
  76. /package/dist/runtime/validation/{valibot.mjs → valibot.js} +0 -0
@@ -1,11 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const SegmentOptions: import("valibot").ObjectSchema<{
3
- writeKey: import("valibot").StringSchema<string>;
4
- analyticsKey: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
5
- }, undefined, {
6
- writeKey: string;
7
- analyticsKey?: string | undefined;
8
- }>;
2
+ export declare const SegmentOptions: any;
9
3
  export type SegmentInput = RegistryScriptInput<typeof SegmentOptions>;
10
4
  interface AnalyticsApi {
11
5
  track: (event: string, properties?: Record<string, any>) => void;
@@ -33,5 +27,7 @@ declare global {
33
27
  interface Window extends SegmentApi {
34
28
  }
35
29
  }
36
- export declare function useScriptSegment<T extends SegmentApi>(_options?: SegmentInput): any;
30
+ export declare function useScriptSegment<T extends SegmentApi>(_options?: SegmentInput): T & {
31
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
32
+ };
37
33
  export {};
@@ -1,4 +1,4 @@
1
- import { useRegistryScript } from "../utils.mjs";
1
+ import { useRegistryScript } from "../utils.js";
2
2
  import { SegmentScriptResolver } from "../../registry";
3
3
  import { object, optional, string } from "#nuxt-scripts-validator";
4
4
  export const SegmentOptions = object({
@@ -1,10 +1,6 @@
1
1
  /// <reference types="stripe-v3" />
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- export declare const StripeOptions: import("valibot").ObjectSchema<{
4
- advancedFraudSignals: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
5
- }, undefined, {
6
- advancedFraudSignals?: boolean | undefined;
7
- }>;
3
+ export declare const StripeOptions: any;
8
4
  export type StripeInput = RegistryScriptInput<typeof StripeOptions, false>;
9
5
  export interface StripeApi {
10
6
  Stripe: stripe.StripeStatic;
@@ -13,4 +9,6 @@ declare global {
13
9
  interface Window extends StripeApi {
14
10
  }
15
11
  }
16
- export declare function useScriptStripe<T extends StripeApi>(_options?: StripeInput): any;
12
+ export declare function useScriptStripe<T extends StripeApi>(_options?: StripeInput): T & {
13
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
14
+ };
@@ -1,5 +1,5 @@
1
1
  import { withQuery } from "ufo";
2
- import { useRegistryScript } from "../utils.mjs";
2
+ import { useRegistryScript } from "../utils.js";
3
3
  import { boolean, object, optional } from "#nuxt-scripts-validator";
4
4
  export const StripeOptions = object({
5
5
  advancedFraudSignals: optional(boolean())
@@ -12,9 +12,7 @@ export function useScriptStripe(_options) {
12
12
  typeof options?.advancedFraudSignals === "boolean" && !options?.advancedFraudSignals ? { advancedFraudSignals: false } : {}
13
13
  ),
14
14
  // opt-out of privacy defaults
15
- // @ts-expect-error TODO add types
16
15
  crossorigin: false,
17
- // @ts-expect-error TODO add types
18
16
  referrerpolicy: false
19
17
  },
20
18
  schema: import.meta.dev ? StripeOptions : void 0,
@@ -10,5 +10,7 @@ declare global {
10
10
  interface Window extends VimeoPlayerApi {
11
11
  }
12
12
  }
13
- export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): any;
13
+ export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): T & {
14
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
15
+ };
14
16
  export {};
@@ -1,5 +1,5 @@
1
1
  import { watch } from "vue";
2
- import { useRegistryScript } from "../utils.mjs";
2
+ import { useRegistryScript } from "../utils.js";
3
3
  import { useHead } from "#imports";
4
4
  export function useScriptVimeoPlayer(_options) {
5
5
  const instance = useRegistryScript("vimeoPlayer", () => ({
@@ -27,13 +27,9 @@ declare global {
27
27
  interface Window extends XPixelApi {
28
28
  }
29
29
  }
30
- export declare const XPixelOptions: import("valibot").ObjectSchema<{
31
- id: import("valibot").StringSchema<string>;
32
- version: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
33
- }, undefined, {
34
- id: string;
35
- version?: string | undefined;
36
- }>;
30
+ export declare const XPixelOptions: any;
37
31
  export type XPixelInput = RegistryScriptInput<typeof XPixelOptions>;
38
- export declare function useScriptXPixel<T extends XPixelApi>(_options?: XPixelInput): any;
32
+ export declare function useScriptXPixel<T extends XPixelApi>(_options?: XPixelInput): T & {
33
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
34
+ };
39
35
  export {};
@@ -1,4 +1,4 @@
1
- import { useRegistryScript } from "../utils.mjs";
1
+ import { useRegistryScript } from "../utils.js";
2
2
  import { object, optional, string } from "#nuxt-scripts-validator";
3
3
  export const XPixelOptions = object({
4
4
  id: string(),
@@ -7,7 +7,6 @@ export const XPixelOptions = object({
7
7
  export function useScriptXPixel(_options) {
8
8
  return useRegistryScript("xPixel", (options) => {
9
9
  return {
10
- // @ts-expect-error TODO fix upstream
11
10
  scriptInput: {
12
11
  src: "https://static.ads-twitter.com/uwt.js",
13
12
  crossorigin: false
@@ -11,4 +11,6 @@ declare global {
11
11
  }
12
12
  }
13
13
  export type YouTubePlayerInput = RegistryScriptInput;
14
- export declare function useScriptYouTubePlayer<T extends YouTubePlayerApi>(_options: YouTubePlayerInput): any;
14
+ export declare function useScriptYouTubePlayer<T extends YouTubePlayerApi>(_options: YouTubePlayerInput): T & {
15
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
16
+ };
@@ -1,12 +1,11 @@
1
1
  import { watch } from "vue";
2
- import { useRegistryScript } from "../utils.mjs";
2
+ import { useRegistryScript } from "../utils.js";
3
3
  import { useHead } from "#imports";
4
4
  export function useScriptYouTubePlayer(_options) {
5
5
  let readyPromise = Promise.resolve();
6
6
  const instance = useRegistryScript("youtubePlayer", () => ({
7
7
  scriptInput: {
8
8
  src: "https://www.youtube.com/iframe_api",
9
- // @ts-expect-error TODO fix types upstream
10
9
  crossorigin: false
11
10
  // crossorigin can't be set or it breaks
12
11
  },
@@ -3,23 +3,23 @@ import type { UseScriptInput, VueScriptInstance } from '@unhead/vue';
3
3
  import type { ComputedRef, Ref } from 'vue';
4
4
  import type { Input, ObjectSchema } from 'valibot';
5
5
  import type { Import } from 'unimport';
6
- import type { SegmentInput } from './registry/segment';
7
- import type { CloudflareWebAnalyticsInput } from './registry/cloudflare-web-analytics';
8
- import type { MetaPixelInput } from './registry/meta-pixel';
9
- import type { FathomAnalyticsInput } from './registry/fathom-analytics';
10
- import type { HotjarInput } from './registry/hotjar';
11
- import type { IntercomInput } from './registry/intercom';
12
- import type { GoogleAnalyticsInput } from './registry/google-analytics';
13
- import type { GoogleMapsInput } from './registry/google-maps';
14
- import type { GoogleTagManagerInput } from './registry/google-tag-manager';
15
- import type { MatomoAnalyticsInput } from './registry/matomo-analytics';
16
- import type { StripeInput } from './registry/stripe';
17
- import type { VimeoPlayerInput } from './registry/vimeo-player';
18
- import type { XPixelInput } from './registry/x-pixel';
19
- import type { YouTubePlayerInput } from './registry/youtube-player';
20
- import type { PlausibleAnalyticsInput } from './registry/plausible-analytics';
21
- import type { NpmInput } from './registry/npm';
22
- import type { LemonSqueezyInput } from './registry/lemon-squeezy';
6
+ import type { SegmentInput } from './registry/segment.js';
7
+ import type { CloudflareWebAnalyticsInput } from './registry/cloudflare-web-analytics.js';
8
+ import type { MetaPixelInput } from './registry/meta-pixel.js';
9
+ import type { FathomAnalyticsInput } from './registry/fathom-analytics.js';
10
+ import type { HotjarInput } from './registry/hotjar.js';
11
+ import type { IntercomInput } from './registry/intercom.js';
12
+ import type { GoogleAnalyticsInput } from './registry/google-analytics.js';
13
+ import type { GoogleMapsInput } from './registry/google-maps.js';
14
+ import type { GoogleTagManagerInput } from './registry/google-tag-manager.js';
15
+ import type { MatomoAnalyticsInput } from './registry/matomo-analytics.js';
16
+ import type { StripeInput } from './registry/stripe.js';
17
+ import type { VimeoPlayerInput } from './registry/vimeo-player.js';
18
+ import type { XPixelInput } from './registry/x-pixel.js';
19
+ import type { YouTubePlayerInput } from './registry/youtube-player.js';
20
+ import type { PlausibleAnalyticsInput } from './registry/plausible-analytics.js';
21
+ import type { NpmInput } from './registry/npm.js';
22
+ import type { LemonSqueezyInput } from './registry/lemon-squeezy.js';
23
23
  export type NuxtUseScriptOptions<T = any> = Omit<UseScriptOptions<T>, 'trigger'> & {
24
24
  /**
25
25
  * The trigger to load the script:
@@ -1,5 +1,5 @@
1
1
  import type { Input, ObjectSchema } from 'valibot';
2
- import type { UseScriptInput } from '@unhead/vue';
2
+ import type { UseScriptInput, VueScriptInstance } from '@unhead/vue';
3
3
  import type { EmptyOptionsSchema, NuxtUseScriptOptions, RegistryScriptInput, ScriptRegistry } from '#nuxt-scripts';
4
4
  type OptionsFn<O extends ObjectSchema<any>> = (options: Input<O>) => ({
5
5
  scriptInput?: UseScriptInput;
@@ -7,6 +7,8 @@ type OptionsFn<O extends ObjectSchema<any>> = (options: Input<O>) => ({
7
7
  schema?: O;
8
8
  clientInit?: () => void;
9
9
  });
10
- export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry[T];
11
- export declare function useRegistryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any> = EmptyOptionsSchema>(key: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): any;
10
+ export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry;
11
+ export declare function useRegistryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any> = EmptyOptionsSchema>(key: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): T & {
12
+ $script: Promise<T> & VueScriptInstance<T>;
13
+ };
12
14
  export {};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.4.3",
5
- "packageManager": "pnpm@9.1.1",
4
+ "version": "0.4.4",
5
+ "packageManager": "pnpm@9.1.4",
6
6
  "description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
7
7
  "author": {
8
8
  "website": "https://harlanzw.com",
@@ -57,15 +57,15 @@
57
57
  ]
58
58
  },
59
59
  "dependencies": {
60
- "@nuxt/devtools-kit": "^1.3.1",
61
- "@nuxt/devtools-ui-kit": "^1.3.1",
60
+ "@nuxt/devtools-kit": "^1.3.2",
61
+ "@nuxt/devtools-ui-kit": "^1.3.2",
62
62
  "@nuxt/kit": "^3.11.2",
63
63
  "@types/google.maps": "^3.55.9",
64
64
  "@types/stripe-v3": "^3.1.33",
65
65
  "@types/vimeo__player": "^2.18.3",
66
66
  "@types/youtube": "^0.0.50",
67
- "@unhead/vue": "^1.9.10",
68
- "@vueuse/core": "^10.9.0",
67
+ "@unhead/vue": "^1.9.12",
68
+ "@vueuse/core": "^10.10.0",
69
69
  "consola": "^3.2.3",
70
70
  "defu": "^6.1.4",
71
71
  "estree-walker": "^3.0.3",
@@ -77,28 +77,29 @@
77
77
  "pathe": "^1.1.2",
78
78
  "pkg-types": "^1.1.1",
79
79
  "semver": "^7.6.2",
80
- "shiki": "^1.5.2",
80
+ "shiki": "^1.6.1",
81
81
  "sirv": "^2.0.4",
82
82
  "std-env": "^3.7.0",
83
83
  "third-party-capital": "^1.0.28",
84
84
  "ufo": "^1.5.3",
85
- "unimport": "^3.7.1",
85
+ "unimport": "^3.7.2",
86
86
  "unplugin": "^1.10.1",
87
87
  "unstorage": "^1.10.2",
88
88
  "valibot": "^0.30.0"
89
89
  },
90
90
  "devDependencies": {
91
- "@antfu/eslint-config": "2.17.0",
92
- "@nuxt/devtools-ui-kit": "^1.3.1",
93
- "@nuxt/module-builder": "^0.6.0",
94
- "@nuxt/test-utils": "3.12.1",
95
- "@unhead/schema": "^1.9.10",
91
+ "@antfu/eslint-config": "2.19.1",
92
+ "@nuxt/devtools-ui-kit": "^1.3.2",
93
+ "@nuxt/module-builder": "^0.7.0",
94
+ "@nuxt/test-utils": "3.13.1",
95
+ "@types/semver": "^7.5.8",
96
+ "@unhead/schema": "^1.9.12",
96
97
  "acorn-loose": "^8.4.0",
97
98
  "bumpp": "^9.4.1",
98
99
  "changelogen": "^0.5.5",
99
- "eslint": "9.2.0",
100
+ "eslint": "9.3.0",
100
101
  "nuxt": "^3.11.2",
101
- "playwright-core": "^1.44.0",
102
+ "playwright-core": "^1.44.1",
102
103
  "typescript": "^5.4.5",
103
104
  "vitest": "^1.6.0",
104
105
  "vue": "^3.4.27",
@@ -1 +0,0 @@
1
- const e=Object.freeze({displayName:"Zig",fileTypes:["zig","zon"],name:"zig",patterns:[{include:"#comments"},{include:"#strings"},{include:"#keywords"},{include:"#operators"},{include:"#numbers"},{include:"#support"},{include:"#variables"}],repository:{commentContents:{patterns:[{match:"\\b(TODO|FIXME|XXX|NOTE)\\b:?",name:"keyword.todo.zig"}]},comments:{patterns:[{begin:"//[!/](?=[^/])",end:"$",name:"comment.line.documentation.zig",patterns:[{include:"#commentContents"}]},{begin:"//",end:"$",name:"comment.line.double-slash.zig",patterns:[{include:"#commentContents"}]}]},keywords:{patterns:[{match:"\\binline\\b(?!\\s*\\bfn\\b)",name:"keyword.control.repeat.zig"},{match:"\\b(while|for)\\b",name:"keyword.control.repeat.zig"},{match:"\\b(extern|packed|export|pub|noalias|inline|comptime|volatile|align|linksection|threadlocal|allowzero|noinline|callconv)\\b",name:"keyword.storage.zig"},{match:"\\b(struct|enum|union|opaque)\\b",name:"keyword.structure.zig"},{match:"\\b(asm|unreachable)\\b",name:"keyword.statement.zig"},{match:"\\b(break|return|continue|defer|errdefer)\\b",name:"keyword.control.flow.zig"},{match:"\\b(await|resume|suspend|async|nosuspend)\\b",name:"keyword.control.async.zig"},{match:"\\b(try|catch)\\b",name:"keyword.control.trycatch.zig"},{match:"\\b(if|else|switch|orelse)\\b",name:"keyword.control.conditional.zig"},{match:"\\b(null|undefined)\\b",name:"keyword.constant.default.zig"},{match:"\\b(true|false)\\b",name:"keyword.constant.bool.zig"},{match:"\\b(usingnamespace|test|and|or)\\b",name:"keyword.default.zig"},{match:"\\b(bool|void|noreturn|type|error|anyerror|anyframe|anytype|anyopaque)\\b",name:"keyword.type.zig"},{match:"\\b(f16|f32|f64|f80|f128|u\\d+|i\\d+|isize|usize|comptime_int|comptime_float)\\b",name:"keyword.type.integer.zig"},{match:"\\b(c_char|c_short|c_ushort|c_int|c_uint|c_long|c_ulong|c_longlong|c_ulonglong|c_longdouble)\\b",name:"keyword.type.c.zig"}]},numbers:{patterns:[{match:"\\b0x[0-9a-fA-F][0-9a-fA-F_]*(\\.[0-9a-fA-F][0-9a-fA-F_]*)?([pP][+-]?[0-9a-fA-F_]+)?\\b",name:"constant.numeric.hexfloat.zig"},{match:"\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?\\b",name:"constant.numeric.float.zig"},{match:"\\b[0-9][0-9_]*\\b",name:"constant.numeric.decimal.zig"},{match:"\\b0x[a-fA-F0-9_]+\\b",name:"constant.numeric.hexadecimal.zig"},{match:"\\b0o[0-7_]+\\b",name:"constant.numeric.octal.zig"},{match:"\\b0b[01_]+\\b",name:"constant.numeric.binary.zig"},{match:"\\b[0-9](([eEpP][+-])|[0-9a-zA-Z_])*(\\.(([eEpP][+-])|[0-9a-zA-Z_])*)?([eEpP][+-])?[0-9a-zA-Z_]*\\b",name:"constant.numeric.invalid.zig"}]},operators:{patterns:[{match:"(?<=\\[)\\*c(?=\\])",name:"keyword.operator.c-pointer.zig"},{match:"(\\b(and|or)\\b)|(==|!=|<=|>=|<|>)",name:"keyword.operator.comparison.zig"},{match:"(-%?|\\+%?|\\*%?|/|%)=?",name:"keyword.operator.arithmetic.zig"},{match:"(<<%?|>>|!|&|\\^|\\|)=?",name:"keyword.operator.bitwise.zig"},{match:"(==|\\+\\+|\\*\\*|->)",name:"keyword.operator.special.zig"}]},stringcontent:{patterns:[{match:`\\\\([nrt'"\\\\]|(x[0-9a-fA-F]{2})|(u\\{[0-9a-fA-F]+\\}))`,name:"constant.character.escape.zig"},{match:"\\\\.",name:"invalid.illegal.unrecognized-string-escape.zig"}]},strings:{patterns:[{begin:'"',end:'"',name:"string.quoted.double.zig",patterns:[{include:"#stringcontent"}]},{begin:"\\\\\\\\",end:"$",name:"string.multiline.zig"},{match:"'([^'\\\\]|\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))'",name:"string.quoted.single.zig"}]},support:{patterns:[{comment:"Built-in functions",match:"@[_a-zA-Z][_a-zA-Z0-9]*",name:"support.function.builtin.zig"}]},variables:{patterns:[{name:"meta.function.declaration.zig",patterns:[{captures:{1:{name:"storage.type.function.zig"},2:{name:"entity.name.type.zig"}},match:"\\b(fn)\\s+([A-Z][a-zA-Z0-9]*)\\b"},{captures:{1:{name:"storage.type.function.zig"},2:{name:"entity.name.function.zig"}},match:"\\b(fn)\\s+([_a-zA-Z][_a-zA-Z0-9]*)\\b"},{begin:'\\b(fn)\\s+@"',beginCaptures:{1:{name:"storage.type.function.zig"}},end:'"',name:"entity.name.function.string.zig",patterns:[{include:"#stringcontent"}]},{match:"\\b(const|var|fn)\\b",name:"keyword.default.zig"}]},{name:"meta.function.call.zig",patterns:[{match:"([A-Z][a-zA-Z0-9]*)(?=\\s*\\()",name:"entity.name.type.zig"},{match:"([_a-zA-Z][_a-zA-Z0-9]*)(?=\\s*\\()",name:"entity.name.function.zig"}]},{name:"meta.variable.zig",patterns:[{match:"\\b[_a-zA-Z][_a-zA-Z0-9]*\\b",name:"variable.zig"},{begin:'@"',end:'"',name:"variable.string.zig",patterns:[{include:"#stringcontent"}]}]}]}},scopeName:"source.zig"});var n=[e];export{n as default};
@@ -1 +0,0 @@
1
- const e=Object.freeze({displayName:"Move",name:"move",patterns:[{include:"#address"},{include:"#comments"},{include:"#module"},{include:"#script"},{include:"#attributes"},{begin:"\\b(while)\\b",comment:"While experiment",name:"keyword.control.while.whaaat.move",while:"[a-z]"}],repository:{"=== DEPRECATED_BELOW ===":{},abilities:{comment:"Ability",match:"\\b(store|key|drop|copy)\\b",name:"support.type.ability.move"},address:{begin:"\\b(address)\\b",beginCaptures:{1:{name:"storage.modifier.type.address.keyword.move"}},comment:"Address block",end:"(?<=})",name:"meta.address_block.move",patterns:[{include:"#comments"},{begin:"(?<=address)",comment:"Address value/const",end:"(?=[{])",name:"meta.address.definition.move",patterns:[{include:"#comments"},{include:"#address_literal"},{comment:"Named Address",match:"\\b(\\w+)\\b",name:"entity.name.type.move"}]},{include:"#module"}]},as:{comment:"Keyword as (highlighted)",match:"\\b(as)\\b",name:"keyword.control.as.move"},"as-import":{comment:"Keyword as in import statement; not highlighted",match:"\\b(as)\\b",name:"meta.import.as.move"},attributes:{match:'#\\[(?:[\\w0-9=,_\\(\\)\\s"\\:=]+)\\]',name:"support.constant.attribute.move"},block:{begin:"{",comment:"Block expression or definition",end:"}",name:"meta.block.move",patterns:[{include:"#expr"}]},"block-comments":{comment:"Supported since https://github.com/diem/diem/pull/3714",patterns:[{begin:"/\\*[\\*!](?![\\*/])",comment:"Block documentation comment",end:"\\*/",name:"comment.block.documentation.move"},{begin:"/\\*",comment:"Block comment",end:"\\*/",name:"comment.block.move"}]},capitalized:{comment:"MyType - capitalized type name",match:"\\b([A-Z][a-zA-Z_0-9]*)\\b",name:"entity.name.type.use.move"},comments:{name:"meta.comments.move",patterns:[{include:"#line-comments"},{include:"#block-comments"}]},const:{begin:"\\b(const)\\b",beginCaptures:{1:{name:"storage.modifier.const.move"}},end:";",name:"meta.const.move",patterns:[{include:"#comments"},{include:"#primitives"},{include:"#literals"},{match:"\\b([\\w_]+)\\b",name:"constant.other.move"}]},control:{comment:"Control flow",match:"\\b(return|while|loop|if|else|break|continue|abort)\\b",name:"keyword.control.move"},entry:{comment:"entry",match:"\\b(entry)\\b",name:"storage.modifier.visibility.entry.move"},enum:{begin:"\\b(enum)\\b",beginCaptures:{1:{name:"keyword.control.enum.move"}},comment:"Enum syntax",end:"(?<=})",name:"meta.enum.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#type_param"},{comment:"Enum name (ident)",match:"\\b[A-Z][a-zA-Z_0-9]*\\b",name:"entity.name.type.enum.move"},{include:"#has"},{include:"#abilities"},{begin:"{",end:"}",name:"meta.enum.definition.move",patterns:[{include:"#comments"},{begin:"\\(",end:"\\)",name:"meta.enum.tuple.move",patterns:[{include:"#comments"},{include:"#types"}]},{begin:"{",end:"}",name:"meta.enum.struct.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#types"}]}]}]},error_const:{match:"\\b(E[A-Z][A-Za-z_]*)\\b",name:"variable.language.error.move"},escaped_identifier:{begin:"`",comment:"Escaped variable",end:"`",name:"variable.language.escaped.move"},expr:{comment:"Aggregate Expression",name:"meta.expression.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#expr_generic"},{include:"#error_const"},{include:"#packed_field"},{include:"#import"},{include:"#as"},{include:"#mut"},{include:"#let"},{include:"#types"},{include:"#literals"},{include:"#control"},{include:"#move_copy"},{include:"#resource_methods"},{include:"#self_access"},{include:"#module_access"},{include:"#label"},{include:"#macro_call"},{include:"#local_call"},{include:"#method_call"},{include:"#path_access"},{match:"\\$(?=[a-z])",name:"keyword.operator.macro.dollar.move"},{match:"(?<=[$])[a-z][A-Z_0-9a-z]*",name:"variable.other.meta.move"},{comment:"ALL_CONST_CAPS",match:"\\b([A-Z][A-Z_]+)\\b",name:"constant.other.move"},{comment:"CustomType",match:"\\b([A-Z][a-zA-Z_0-9]*)\\b",name:"entity.name.type.move"},{include:"#paren"},{include:"#block"}]},expr_generic:{begin:"<(?=([\\sa-z_,0-9A-Z<>]+>))",comment:"< angle brackets >",end:">",name:"meta.expression.generic.type.move",patterns:[{include:"#comments"},{include:"#types"},{include:"#capitalized"},{include:"#expr_generic"}]},friend:{begin:"\\b(friend)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:";",name:"meta.friend.move",patterns:[{include:"#comments"},{include:"#address_literal"},{comment:"Name of the imported module",match:"\\b([a-zA-Z][A-Za-z_0-9]*)\\b",name:"entity.name.type.module.move"}]},fun:{patterns:[{include:"#fun_signature"},{include:"#block"}]},fun_body:{begin:"{",comment:"Function body",end:"(?<=})",name:"meta.fun_body.move",patterns:[{include:"#expr"}]},fun_call:{begin:"\\b(\\w+)\\s*(?:<[\\w\\s,]+>)?\\s*[(]",beginCaptures:{1:{name:"entity.name.function.call.move"}},comment:"Function call",end:"[)]",name:"meta.fun_call.move",patterns:[{include:"#comments"},{include:"#resource_methods"},{include:"#self_access"},{include:"#module_access"},{include:"#move_copy"},{include:"#literals"},{include:"#fun_call"},{include:"#block"},{include:"#mut"},{include:"#as"}]},fun_signature:{begin:"\\b(fun)\\b",beginCaptures:{1:{name:"storage.modifier.fun.move"}},comment:"Function signature",end:"(?=[;{])",name:"meta.fun_signature.move",patterns:[{include:"#comments"},{include:"#module_access"},{include:"#capitalized"},{include:"#types"},{include:"#mut"},{begin:"(?<=\\bfun)",comment:"Function name",end:"(?=[<(])",name:"meta.function_name.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{match:"\\b(\\w+)\\b",name:"entity.name.function.move"}]},{include:"#type_param"},{begin:"[(]",comment:"Parentheses",end:"[)]",name:"meta.parentheses.move",patterns:[{include:"#comments"},{include:"#self_access"},{include:"#expr_generic"},{include:"#escaped_identifier"},{include:"#module_access"},{include:"#capitalized"},{include:"#types"},{include:"#mut"}]},{comment:"Keyword acquires",match:"\\b(acquires)\\b",name:"storage.modifier"}]},has:{comment:"Has Abilities",match:"\\b(has)\\b",name:"keyword.control.ability.has.move"},has_ability:{begin:"(?<=[})])\\s+(has)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:";",name:"meta.has.ability.move",patterns:[{include:"#comments"},{include:"#abilities"}]},ident:{match:"\\b([a-zA-Z][A-Z_a-z0-9]*)\\b",name:"meta.identifier.move"},import:{begin:"\\b(use)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:";",name:"meta.import.move",patterns:[{include:"#comments"},{include:"#use_fun"},{include:"#address_literal"},{include:"#as-import"},{comment:"Uppercase entities",match:"\\b([A-Z]\\w*)\\b",name:"entity.name.type.move"},{begin:"{",comment:"Module members",end:"}",patterns:[{include:"#comments"},{include:"#as-import"},{comment:"Uppercase entities",match:"\\b([A-Z]\\w*)\\b",name:"entity.name.type.move"}]},{comment:"Name of the imported module",match:"\\b(\\w+)\\b",name:"meta.entity.name.type.module.move"}]},label:{comment:"Label",match:"'[a-z][a-z_0-9]*",name:"string.quoted.single.label.move"},let:{comment:"Keyword let",match:"\\b(let)\\b",name:"keyword.control.move"},"line-comments":{begin:"//",comment:"Single-line comment",end:"$",name:"comment.line.double-slash.move"},literals:{comment:"Literals supported in Move",name:"meta.literal.move",patterns:[{comment:"base16 address literal",match:"@0x[A-F0-9a-f]+",name:"support.constant.address.base16.move"},{comment:"named address literal @[ident]",match:"@[a-zA-Z][a-zA-Z_0-9]*",name:"support.constant.address.name.move"},{comment:"Hex literal",match:"0x[_a-fA-F0-9]+(?:u(?:8|16|32|64|128|256))?",name:"constant.numeric.hex.move"},{comment:"Numeric literal",match:"(?<!(?:\\w|(?:(?<!\\.)\\.)))[0-9][_0-9]*(?:\\.(?!\\.)(?:[0-9][_0-9]*)?)?(?:[eE][+\\-]?[_0-9]+)?(?:[u](?:8|16|32|64|128|256))?",name:"constant.numeric.move"},{begin:'\\bb"',comment:"vector ascii bytestring literal",end:'"',name:"meta.vector.literal.ascii.move",patterns:[{comment:"Special symbol escape",match:'\\\\[nrt\\0"]',name:"constant.character.escape.move"},{comment:"HEX Escape",match:"\\\\x[a-fA-F0-9][A-Fa-f0-9]",name:"constant.character.escape.hex.move"},{comment:"ASCII Character",match:"[\\x00-\\x7F]",name:"string.quoted.double.raw.move"}]},{begin:'x"',comment:"vector hex literal",end:'"',name:"meta.vector.literal.hex.move",patterns:[{comment:"vector hex literal",match:"[A-Fa-f0-9]+",name:"constant.character.move"}]},{comment:"bool literal",match:"\\b(?:true|false)\\b",name:"constant.language.boolean.move"},{begin:"vector\\[",comment:"vector literal (macro?)",end:"\\]",name:"meta.vector.literal.macro.move",patterns:[{include:"#expr"}]}]},local_call:{comment:"call to a local / imported fun",match:"\\b([a-z][_a-z0-9]*)(?=[<\\(])",name:"entity.name.function.call.local.move"},macro:{begin:"\\b(macro)\\b",beginCaptures:{1:{name:"keyword.control.macro.move"}},comment:"macro fun [ident] {}",end:"(?<=})",name:"meta.macro.move",patterns:[{include:"#comments"},{include:"#fun"}]},macro_call:{captures:{2:{name:"support.function.macro.move"}},comment:"Macro fun call",match:"(\\b|\\.)([a-z][A-Za-z0-9_]*)!",name:"meta.macro.call"},method_call:{captures:{1:{name:"entity.name.function.call.path.move"}},comment:"<expr>.[ident]<>?() call",match:"\\.([a-z][_a-z0-9]*)(?=[<\\(])",name:"meta.path.call.move"},module:{begin:"\\b(module|spec)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},comment:"Module definition",end:"(?<=})",name:"meta.module.move",patterns:[{include:"#comments"},{begin:"(?<=(module|spec))",comment:"Module name",end:"(?={)",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{begin:"(?<=\\b(module|spec))",comment:"Module namespace / address",end:"(?=[(::){])",name:"constant.other.move"},{begin:"(?<=::)",comment:"Module name",end:"(?=[\\s{])",name:"entity.name.type.move"}]},{begin:"{",comment:"Module scope",end:"}",name:"meta.module_scope.move",patterns:[{include:"#comments"},{include:"#attributes"},{include:"#entry"},{include:"#public-scope"},{include:"#public"},{include:"#native"},{include:"#import"},{include:"#friend"},{include:"#const"},{include:"#struct"},{include:"#has_ability"},{include:"#enum"},{include:"#macro"},{include:"#fun"},{include:"#spec"}]}]},module_access:{captures:{1:{name:"meta.entity.name.type.accessed.module.move"},2:{name:"entity.name.function.call.move"}},comment:"Use of module type or method",match:"\\b(\\w+)::(\\w+)\\b",name:"meta.module_access.move"},move_copy:{comment:"Keywords move and copy",match:"\\b(move|copy)\\b",name:"variable.language.move"},mut:{comment:"Mutable reference and let mut",match:"\\b(mut)\\b",name:"storage.modifier.mut.move"},native:{comment:"native",match:"\\b(native)\\b",name:"storage.modifier.visibility.native.move"},packed_field:{comment:"[ident]: ",match:"[a-z][a-z0-9_]+\\s*:\\s*(?=\\s)",name:"meta.struct.field.move"},paren:{begin:"\\(",end:"\\)",name:"meta.paren.move",patterns:[{include:"#expr"}]},path_access:{comment:"<expr>.[ident] access",match:"\\.[a-z][_a-z0-9]*\\b",name:"meta.path.access.move"},phantom:{comment:"Keyword phantom inside type parameters",match:"\\b(phantom)\\b",name:"keyword.control.phantom.move"},primitives:{comment:"Primitive types",match:"\\b(u8|u16|u32|u64|u128|u256|address|bool|signer)\\b",name:"support.type.primitives.move"},public:{comment:"public",match:"\\b(public)\\b",name:"storage.modifier.visibility.public.move"},"public-scope":{begin:"(?<=\\b(public))\\s*\\(",comment:"public (friend/script/package)",end:"\\)",name:"meta.public.scoped.move",patterns:[{include:"#comments"},{match:"\\b(friend|script|package)\\b",name:"keyword.control.public.scope.move"}]},resource_methods:{comment:"Methods to work with resource",match:"\\b(borrow_global|borrow_global_mut|exists|move_from|move_to_sender|move_to)\\b",name:"support.function.typed.move"},script:{begin:"\\b(script)\\b",beginCaptures:{1:{name:"storage.modifier.script.move"}},end:"(?<=})",name:"meta.script.move",patterns:[{include:"#comments"},{begin:"{",comment:"Script scope",end:"}",name:"meta.script_scope.move",patterns:[{include:"#const"},{include:"#comments"},{include:"#import"},{include:"#fun"}]}]},self_access:{captures:{1:{name:"variable.language.self.move"},2:{name:"entity.name.function.call.move"}},comment:"Use of Self",match:"\\b(Self)::(\\w+)\\b",name:"meta.self_access.move"},spec:{begin:"\\b(spec)\\b",beginCaptures:{1:{name:"storage.modifier.spec.move"}},end:"(?<=[;}])",name:"meta.spec.move",patterns:[{comment:"Spec target",match:"\\b(module|schema|struct|fun)",name:"storage.modifier.spec.target.move"},{comment:"Spec define inline",match:"\\b(define)",name:"storage.modifier.spec.define.move"},{comment:"Target name",match:"\\b(\\w+)\\b",name:"entity.name.function.move"},{begin:"{",comment:"Spec block",end:"}",patterns:[{include:"#comments"},{include:"#spec_block"},{include:"#spec_types"},{include:"#spec_define"},{include:"#spec_keywords"},{include:"#control"},{include:"#fun_call"},{include:"#literals"},{include:"#types"},{include:"#let"}]}]},spec_block:{begin:"{",comment:"Spec block",end:"}",name:"meta.spec_block.move",patterns:[{include:"#comments"},{include:"#spec_block"},{include:"#spec_types"},{include:"#fun_call"},{include:"#literals"},{include:"#control"},{include:"#types"},{include:"#let"}]},spec_define:{begin:"\\b(define)\\b",beginCaptures:{1:{name:"keyword.control.move.spec"}},comment:"Spec define keyword",end:"(?=[;{])",name:"meta.spec_define.move",patterns:[{include:"#comments"},{include:"#spec_types"},{include:"#types"},{begin:"(?<=\\bdefine)",comment:"Function name",end:"(?=[(])",patterns:[{include:"#comments"},{match:"\\b(\\w+)\\b",name:"entity.name.function.move"}]}]},spec_keywords:{match:"\\b(global|pack|unpack|pragma|native|include|ensures|requires|invariant|apply|aborts_if|modifies)\\b",name:"keyword.control.move.spec"},spec_types:{comment:"Spec-only types",match:"\\b(range|num|vector|bool|u8|u16|u32|u64|u128|u256|address)\\b",name:"support.type.vector.move"},struct:{begin:"\\b(struct)\\b",beginCaptures:{1:{name:"storage.modifier.type.move"}},end:"(?<=[};\\)])",name:"meta.struct.move",patterns:[{include:"#comments"},{include:"#escaped_identifier"},{include:"#has"},{include:"#abilities"},{comment:"Struct name (ident)",match:"\\b[A-Z][a-zA-Z_0-9]*\\b",name:"entity.name.type.struct.move"},{begin:"\\(",comment:"Positional fields",end:"\\)",name:"meta.struct.paren.move",patterns:[{include:"#comments"},{include:"#capitalized"},{include:"#types"}]},{include:"#type_param"},{begin:"\\(",comment:"Simple struct",end:"(?<=[)])",name:"meta.struct.paren.move",patterns:[{include:"#comments"},{include:"#types"}]},{begin:"{",comment:"Struct body",end:"}",name:"meta.struct.body.move",patterns:[{include:"#comments"},{include:"#self_access"},{include:"#escaped_identifier"},{include:"#module_access"},{include:"#expr_generic"},{include:"#capitalized"},{include:"#types"}]},{include:"#has_ability"}]},struct_pack:{begin:"(?<=[A-Za-z0-9_>])\\s*{",comment:"Struct { field: value... }; identified as generic / ident followed by curly's",end:"}",name:"meta.struct.pack.move",patterns:[{include:"#comments"}]},type_param:{begin:"<",comment:"Generic type param",end:">",name:"meta.generic_param.move",patterns:[{include:"#comments"},{include:"#phantom"},{include:"#capitalized"},{include:"#module_access"},{include:"#abilities"}]},types:{comment:"Built-in types + vector",name:"meta.types.move",patterns:[{include:"#primitives"},{include:"#vector"}]},use_fun:{begin:"\\b(fun)\\b",beginCaptures:{1:{name:"storage.modifier.fun.move"}},comment:"use { fun } internals",end:"(?=;)",name:"meta.import.fun.move",patterns:[{include:"#comments"},{comment:"as keyword",match:"\\b(as)\\b",name:"keyword.control.as.move"},{comment:"Self keyword",match:"\\b(Self)\\b",name:"variable.language.self.use.fun.move"},{comment:"Function name",match:"\\b(_______[a-z][a-z_0-9]+)\\b",name:"entity.name.function.use.move"},{include:"#types"},{include:"#escaped_identifier"},{include:"#capitalized"}]},vector:{comment:"vector type",match:"\\b(vector)\\b",name:"support.type.vector.move"}},scopeName:"source.move"});var n=[e];export{n as default};