@skaldapp/monaco-sfc 1.1.34 → 1.1.36

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 (2) hide show
  1. package/dist/vue.worker.js +87 -38
  2. package/package.json +9 -9
@@ -7,7 +7,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
10
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
10
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
11
11
  var __exportAll = (all, no_symbols) => {
12
12
  let target = {};
13
13
  for (var name in all) __defProp(target, name, {
@@ -8376,12 +8376,26 @@ var require_utilities = /* @__PURE__ */ __commonJSMin(((exports) => {
8376
8376
  "jspm_packages"
8377
8377
  ].join("|")})(/|$))`;
8378
8378
  var filesMatcher = {
8379
+ /**
8380
+ * Matches any single directory segment unless it is the last segment and a .min.js file
8381
+ * Breakdown:
8382
+ * [^./] # matches everything up to the first . character (excluding directory separators)
8383
+ * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension
8384
+ */
8379
8385
  singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",
8386
+ /**
8387
+ * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
8388
+ * files or directories, does not match subdirectories that start with a . character
8389
+ */
8380
8390
  doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
8381
8391
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment)
8382
8392
  };
8383
8393
  var directoriesMatcher = {
8384
8394
  singleAsteriskRegexFragment: "[^/]*",
8395
+ /**
8396
+ * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
8397
+ * files or directories, does not match subdirectories that start with a . character
8398
+ */
8385
8399
  doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
8386
8400
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment)
8387
8401
  };
@@ -9757,7 +9771,7 @@ var shared_esm_bundler_exports = /* @__PURE__ */ __exportAll({
9757
9771
  toTypeString: () => toTypeString
9758
9772
  });
9759
9773
  /**
9760
- * @vue/shared v3.5.32
9774
+ * @vue/shared v3.5.33
9761
9775
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
9762
9776
  * @license MIT
9763
9777
  **/
@@ -16064,6 +16078,9 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16064
16078
  CHAR_UNDERSCORE: 95,
16065
16079
  CHAR_VERTICAL_LINE: 124,
16066
16080
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
16081
+ /**
16082
+ * Create EXTGLOB_CHARS
16083
+ */
16067
16084
  extglobChars(chars) {
16068
16085
  return {
16069
16086
  "!": {
@@ -16093,6 +16110,9 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16093
16110
  }
16094
16111
  };
16095
16112
  },
16113
+ /**
16114
+ * Create GLOB_CHARS
16115
+ */
16096
16116
  globChars(win32) {
16097
16117
  return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
16098
16118
  }
@@ -19525,15 +19545,11 @@ var require_compilerOptions = /* @__PURE__ */ __commonJSMin(((exports) => {
19525
19545
  };
19526
19546
  }
19527
19547
  var CompilerOptionsResolver = class {
19528
- ts;
19529
- readFile;
19530
- options = {};
19531
- target;
19532
- typesRoot;
19533
- plugins = [];
19534
19548
  constructor(ts, readFile) {
19535
19549
  this.ts = ts;
19536
19550
  this.readFile = readFile;
19551
+ this.options = {};
19552
+ this.plugins = [];
19537
19553
  }
19538
19554
  addConfig(options, rootDir) {
19539
19555
  for (const key in options) switch (key) {
@@ -23156,16 +23172,12 @@ var require_embeddedCodes = /* @__PURE__ */ __commonJSMin(((exports) => {
23156
23172
  var muggle_string_1 = require_out$1();
23157
23173
  var buildMappings_1 = require_buildMappings();
23158
23174
  var VueEmbeddedCode = class {
23159
- id;
23160
- lang;
23161
- content;
23162
- parentCodeId;
23163
- linkedCodeMappings = [];
23164
- embeddedCodes = [];
23165
23175
  constructor(id, lang, content) {
23166
23176
  this.id = id;
23167
23177
  this.lang = lang;
23168
23178
  this.content = content;
23179
+ this.linkedCodeMappings = [];
23180
+ this.embeddedCodes = [];
23169
23181
  }
23170
23182
  };
23171
23183
  exports.VueEmbeddedCode = VueEmbeddedCode;
@@ -23869,16 +23881,6 @@ var require_virtualCode = /* @__PURE__ */ __commonJSMin(((exports) => {
23869
23881
  var embeddedCodes_1 = require_embeddedCodes();
23870
23882
  var ir_1 = require_ir();
23871
23883
  var VueVirtualCode = class {
23872
- fileName;
23873
- languageId;
23874
- initSnapshot;
23875
- vueCompilerOptions;
23876
- id = "main";
23877
- _snapshot;
23878
- _parsedSfcResult;
23879
- _ir;
23880
- _embeddedCodes;
23881
- _mappings;
23882
23884
  get snapshot() {
23883
23885
  return this._snapshot();
23884
23886
  }
@@ -23899,6 +23901,7 @@ var require_virtualCode = /* @__PURE__ */ __commonJSMin(((exports) => {
23899
23901
  this.languageId = languageId;
23900
23902
  this.initSnapshot = initSnapshot;
23901
23903
  this.vueCompilerOptions = vueCompilerOptions;
23904
+ this.id = "main";
23902
23905
  this._snapshot = (0, alien_signals_1.signal)(initSnapshot);
23903
23906
  this._parsedSfcResult = (0, alien_signals_1.computed)((lastResult) => this.parseSfc(plugins, lastResult));
23904
23907
  this._ir = (0, ir_1.useIR)(ts, plugins, fileName, this._snapshot, () => this._parsedSfcResult()?.result);
@@ -24753,6 +24756,8 @@ var init_format$1 = __esmMin((() => {
24753
24756
  init_scanner();
24754
24757
  init_string_intern();
24755
24758
  }));
24759
+ //#endregion
24760
+ //#region node_modules/jsonc-parser/lib/esm/impl/parser.js
24756
24761
  /**
24757
24762
  * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
24758
24763
  * Therefore always check the errors list to find out if the input was valid.
@@ -24765,7 +24770,7 @@ function parse$2(text, errors = [], options = ParseOptions.DEFAULT) {
24765
24770
  if (Array.isArray(currentParent)) currentParent.push(value);
24766
24771
  else if (currentProperty !== null) currentParent[currentProperty] = value;
24767
24772
  }
24768
- visit$1(text, {
24773
+ visit(text, {
24769
24774
  onObjectBegin: () => {
24770
24775
  const object = {};
24771
24776
  onValue(object);
@@ -24854,7 +24859,7 @@ function findNodeAtOffset$1(node, offset, includeRightBound = false) {
24854
24859
  /**
24855
24860
  * Parses the given text and invokes the visitor functions for each object, array and literal reached.
24856
24861
  */
24857
- function visit$1(text, visitor, options = ParseOptions.DEFAULT) {
24862
+ function visit(text, visitor, options = ParseOptions.DEFAULT) {
24858
24863
  const _scanner = createScanner$2(text, false);
24859
24864
  const _jsonPath = [];
24860
24865
  let suppressedCallbacks = 0;
@@ -84877,6 +84882,10 @@ var require_css = /* @__PURE__ */ __commonJSMin(((exports) => {
84877
84882
  if (document.languageId === "postcss") diagnostics = diagnostics.filter((diag) => diag.code !== "css-semicolonexpected" && diag.code !== "css-ruleorselectorexpected" && diag.code !== "unknownAtRules");
84878
84883
  return diagnostics;
84879
84884
  },
84885
+ /**
84886
+ * If the position is within the virtual code and navigation is enabled,
84887
+ * skip the CSS navigation feature.
84888
+ */
84880
84889
  provideReferences(document, position) {
84881
84890
  if (isWithinNavigationVirtualCode(document, position)) return;
84882
84891
  return worker(document, (stylesheet, cssLs) => {
@@ -91926,7 +91935,8 @@ var init_beautify_html = __esmMin((() => {
91926
91935
  return this._current_frame ? this._current_frame.parser_token : null;
91927
91936
  };
91928
91937
  TagStack.prototype.record_tag = function(parser_token) {
91929
- this._current_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);
91938
+ var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);
91939
+ this._current_frame = new_frame;
91930
91940
  };
91931
91941
  TagStack.prototype._try_pop_frame = function(frame) {
91932
91942
  var parser_token = null;
@@ -91963,7 +91973,8 @@ var init_beautify_html = __esmMin((() => {
91963
91973
  this._js_beautify = js_beautify;
91964
91974
  this._css_beautify = css_beautify;
91965
91975
  this._tag_stack = null;
91966
- this._options = new Options(options, "html");
91976
+ var optionHtml = new Options(options, "html");
91977
+ this._options = optionHtml;
91967
91978
  this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 5) === "force";
91968
91979
  this._is_wrap_attributes_force_expand_multiline = this._options.wrap_attributes === "force-expand-multiline";
91969
91980
  this._is_wrap_attributes_force_aligned = this._options.wrap_attributes === "force-aligned";
@@ -111743,7 +111754,8 @@ var require_beautify_html = /* @__PURE__ */ __commonJSMin(((exports) => {
111743
111754
  return this._current_frame ? this._current_frame.parser_token : null;
111744
111755
  };
111745
111756
  TagStack.prototype.record_tag = function(parser_token) {
111746
- this._current_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);
111757
+ var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);
111758
+ this._current_frame = new_frame;
111747
111759
  };
111748
111760
  TagStack.prototype._try_pop_frame = function(frame) {
111749
111761
  var parser_token = null;
@@ -111780,7 +111792,8 @@ var require_beautify_html = /* @__PURE__ */ __commonJSMin(((exports) => {
111780
111792
  this._js_beautify = js_beautify;
111781
111793
  this._css_beautify = css_beautify;
111782
111794
  this._tag_stack = null;
111783
- this._options = new Options(options, "html");
111795
+ var optionHtml = new Options(options, "html");
111796
+ this._options = optionHtml;
111784
111797
  this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 5) === "force";
111785
111798
  this._is_wrap_attributes_force_expand_multiline = this._options.wrap_attributes === "force-expand-multiline";
111786
111799
  this._is_wrap_attributes_force_aligned = this._options.wrap_attributes === "force-aligned";
@@ -117084,7 +117097,7 @@ var require_typescript = /* @__PURE__ */ __commonJSMin(((exports, module) => {
117084
117097
  });
117085
117098
  module$1.exports = __toCommonJS(typescript_exports);
117086
117099
  var versionMajorMinor = "6.0";
117087
- var version = "6.0.2";
117100
+ var version = "6.0.3";
117088
117101
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
117089
117102
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
117090
117103
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -138715,12 +138728,26 @@ ${lanes.join("\n")}
138715
138728
  "jspm_packages"
138716
138729
  ].join("|")})(?:/|$))`;
138717
138730
  var filesMatcher = {
138731
+ /**
138732
+ * Matches any single directory segment unless it is the last segment and a .min.js file
138733
+ * Breakdown:
138734
+ * [^./] # matches everything up to the first . character (excluding directory separators)
138735
+ * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension
138736
+ */
138718
138737
  singleAsteriskRegexFragment: "(?:[^./]|(?:\\.(?!min\\.js$))?)*",
138738
+ /**
138739
+ * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
138740
+ * files or directories, does not match subdirectories that start with a . character
138741
+ */
138719
138742
  doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
138720
138743
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment)
138721
138744
  };
138722
138745
  var directoriesMatcher = {
138723
138746
  singleAsteriskRegexFragment: "[^/]*",
138747
+ /**
138748
+ * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
138749
+ * files or directories, does not match subdirectories that start with a . character
138750
+ */
138724
138751
  doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
138725
138752
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment)
138726
138753
  };
@@ -159626,6 +159653,7 @@ ${lanes.join("\n")}
159626
159653
  case 219: return 61;
159627
159654
  case 220: return 317;
159628
159655
  case 269: return 4;
159656
+ case 173: return node.initializer ? 4 : 0;
159629
159657
  case 300:
159630
159658
  case 249:
159631
159659
  case 250:
@@ -217252,6 +217280,7 @@ ${lanes.join("\n")}
217252
217280
  NameValidationResult2[NameValidationResult2["NameTooLong"] = 2] = "NameTooLong";
217253
217281
  NameValidationResult2[NameValidationResult2["NameStartsWithDot"] = 3] = "NameStartsWithDot";
217254
217282
  NameValidationResult2[NameValidationResult2["NameStartsWithUnderscore"] = 4] = "NameStartsWithUnderscore";
217283
+ NameValidationResult2[NameValidationResult2["NameContainsInvalidCharacters"] = 5] = "NameContainsInvalidCharacters";
217255
217284
  NameValidationResult2[NameValidationResult2["NameContainsNonURISafeCharacters"] = 5] = "NameContainsNonURISafeCharacters";
217256
217285
  return NameValidationResult2;
217257
217286
  })(NameValidationResult || {});
@@ -217282,7 +217311,7 @@ ${lanes.join("\n")}
217282
217311
  return 0;
217283
217312
  }
217284
217313
  }
217285
- if (encodeURIComponent(packageName) !== packageName) return 5;
217314
+ if (!/^[\w.-]+$/.test(packageName)) return 5;
217286
217315
  return 0;
217287
217316
  }
217288
217317
  function renderPackageNameValidationFailure(result, typing) {
@@ -217295,7 +217324,7 @@ ${lanes.join("\n")}
217295
217324
  case 2: return `'${typing}':: ${kind} name '${name}' should be less than ${maxPackageNameLength} characters`;
217296
217325
  case 3: return `'${typing}':: ${kind} name '${name}' cannot start with '.'`;
217297
217326
  case 4: return `'${typing}':: ${kind} name '${name}' cannot start with '_'`;
217298
- case 5: return `'${typing}':: ${kind} name '${name}' contains non URI safe characters`;
217327
+ case 5: return `'${typing}':: ${kind} name '${name}' contains invalid characters`;
217299
217328
  case 0: return Debug.fail();
217300
217329
  default: Debug.assertNever(result);
217301
217330
  }
@@ -247942,7 +247971,11 @@ ${options.prefix}` : "\n" : options.prefix
247942
247971
  return this.nextNodeAllOnSameLine;
247943
247972
  }
247944
247973
  TokensAreOnSameLine() {
247945
- if (this.tokensAreOnSameLine === void 0) this.tokensAreOnSameLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line === this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;
247974
+ if (this.tokensAreOnSameLine === void 0) {
247975
+ const startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line;
247976
+ const endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;
247977
+ this.tokensAreOnSameLine = startLine === endLine;
247978
+ }
247946
247979
  return this.tokensAreOnSameLine;
247947
247980
  }
247948
247981
  ContextNodeBlockIsOnOneLine() {
@@ -252752,6 +252785,20 @@ ${options.prefix}` : "\n" : options.prefix
252752
252785
  /** @internal */
252753
252786
  installPackage(req) {
252754
252787
  const { fileName, packageName, projectName, projectRootPath, id } = req;
252788
+ const validationResult = ts_JsTyping_exports.validatePackageName(packageName);
252789
+ if (validationResult !== ts_JsTyping_exports.NameValidationResult.Ok) {
252790
+ const message = ts_JsTyping_exports.renderPackageNameValidationFailure(validationResult, packageName);
252791
+ if (this.log.isEnabled()) this.log.writeLine(message);
252792
+ const response = {
252793
+ kind: ActionPackageInstalled,
252794
+ projectName,
252795
+ id,
252796
+ success: false,
252797
+ message
252798
+ };
252799
+ this.sendResponse(response);
252800
+ return;
252801
+ }
252755
252802
  const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
252756
252803
  if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) return directory;
252757
252804
  }) || projectRootPath;
@@ -259561,7 +259608,7 @@ ${json}${newLine}`;
259561
259608
  this.noGetErrOnBackgroundUpdate = opts.noGetErrOnBackgroundUpdate;
259562
259609
  const { throttleWaitMilliseconds } = opts;
259563
259610
  this.eventHandler = this.canUseEvents ? opts.eventHandler || ((event) => this.defaultEventHandler(event)) : void 0;
259564
- this.errorCheck = new MultistepOperation({
259611
+ const multistepOperationHost = {
259565
259612
  executeWithRequestId: (requestId, action, performanceData) => this.executeWithRequestId(requestId, action, performanceData),
259566
259613
  getCurrentRequestId: () => this.currentRequestId,
259567
259614
  getPerformanceData: () => this.performanceData,
@@ -259569,8 +259616,9 @@ ${json}${newLine}`;
259569
259616
  logError: (err, cmd) => this.logError(err, cmd),
259570
259617
  sendRequestCompletedEvent: (requestId, performanceData) => this.sendRequestCompletedEvent(requestId, performanceData),
259571
259618
  isCancellationRequested: () => this.cancellationToken.isCancellationRequested()
259572
- });
259573
- this.projectService = new ProjectService2({
259619
+ };
259620
+ this.errorCheck = new MultistepOperation(multistepOperationHost);
259621
+ const settings = {
259574
259622
  host: this.host,
259575
259623
  logger: this.logger,
259576
259624
  cancellationToken: this.cancellationToken,
@@ -259588,7 +259636,8 @@ ${json}${newLine}`;
259588
259636
  session: this,
259589
259637
  canUseWatchEvents: opts.canUseWatchEvents,
259590
259638
  incrementalVerifier: opts.incrementalVerifier
259591
- });
259639
+ };
259640
+ this.projectService = new ProjectService2(settings);
259592
259641
  this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this));
259593
259642
  this.gcTimer = new GcTimer(this.host, 7e3, this.logger);
259594
259643
  switch (this.projectService.serverMode) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package",
3
3
  "name": "@skaldapp/monaco-sfc",
4
- "version": "1.1.34",
4
+ "version": "1.1.36",
5
5
  "description": "A Monaco Editor language server for Vue Single File Components (SFC) providing syntax highlighting, IntelliSense, error detection, and more",
6
6
  "keywords": [
7
7
  "vue",
@@ -54,23 +54,23 @@
54
54
  "@remote-dom/polyfill": "^1.5.1",
55
55
  "@volar/jsdelivr": "^2.4.28",
56
56
  "@volar/monaco": "^2.4.28",
57
- "@vue/language-core": "^3.2.6",
58
- "@vue/language-service": "^3.2.6",
59
- "@vue/typescript-plugin": "^3.2.6",
57
+ "@vue/language-core": "^3.2.7",
58
+ "@vue/language-service": "^3.2.7",
59
+ "@vue/typescript-plugin": "^3.2.7",
60
60
  "monaco-editor": "0.52.2",
61
- "typescript": "^6.0.2",
61
+ "typescript": "^6.0.3",
62
62
  "volar-service-typescript": "^0.0.70",
63
63
  "vscode-languageserver-protocol": "^3.17.5",
64
64
  "vscode-uri": "^3.1.0"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@rollup/plugin-commonjs": "^29.0.2",
68
- "@skaldapp/configs": "^1.2.91",
68
+ "@skaldapp/configs": "^1.2.99",
69
69
  "@types/markdown-it": "^14.1.2",
70
- "@types/node": "^25.5.2",
71
- "eslint": "^10.2.0",
70
+ "@types/node": "^25.6.0",
71
+ "eslint": "^10.2.1",
72
72
  "jsonc-parser": "^3.3.1",
73
73
  "path-browserify": "^1.0.1",
74
- "vite": "^8.0.7"
74
+ "vite": "^8.0.10"
75
75
  }
76
76
  }