@marko/language-tools 2.1.10 → 2.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2551,9 +2551,7 @@ const attrTags = ${varShared(
2551
2551
  this.#extractor.write(SEP_COMMA_NEW_LINE);
2552
2552
  }
2553
2553
  if (tag.type === 16 /* AttrTag */) {
2554
- this.#extractor.write(
2555
- `[Symbol.iterator]: ${varShared("any")}${SEP_COMMA_NEW_LINE}`
2556
- );
2554
+ this.#extractor.write("[/*").copy(tag.name).write(`*/Symbol.iterator]: ${varShared("any")}${SEP_COMMA_NEW_LINE}`);
2557
2555
  }
2558
2556
  if (!hasInput) {
2559
2557
  this.#writeTagNameComment(tag);
@@ -3177,6 +3175,23 @@ var marko_default = {
3177
3175
  runtimeTypes.internalTypesFile,
3178
3176
  runtimeTypes.markoTypesFile
3179
3177
  ];
3178
+ const compileConfig = {
3179
+ output: "source",
3180
+ stripTypes: true,
3181
+ sourceMaps: true,
3182
+ babelConfig: {
3183
+ babelrc: false,
3184
+ configFile: false,
3185
+ browserslistConfigFile: false,
3186
+ caller: {
3187
+ name: "@marko/type-check",
3188
+ supportsStaticESM: true,
3189
+ supportsDynamicImport: true,
3190
+ supportsTopLevelAwait: true,
3191
+ supportsExportNamespaceFrom: true
3192
+ }
3193
+ }
3194
+ };
3180
3195
  if (runtimeTypes.markoRunTypesFile) {
3181
3196
  rootNames.push(runtimeTypes.markoRunTypesFile);
3182
3197
  }
@@ -3212,11 +3227,7 @@ var marko_default = {
3212
3227
  print({ extracted: { parsed } }) {
3213
3228
  const { code, map } = getCompiler(
3214
3229
  import_path3.default.dirname(parsed.filename)
3215
- ).compileSync(parsed.code, parsed.filename, {
3216
- output: "source",
3217
- stripTypes: true,
3218
- sourceMaps: true
3219
- });
3230
+ ).compileSync(parsed.code, parsed.filename, compileConfig);
3220
3231
  return { code, map };
3221
3232
  },
3222
3233
  printTypes({ printer, typeChecker, sourceFile, formatSettings }) {
@@ -3301,7 +3312,7 @@ var marko_default = {
3301
3312
  return ts.isTypeAliasDeclaration(statement) && statement.name.escapedText === "Input" && ts.isIndexedAccessTypeNode(statement.type) && ts.isTypeReferenceNode(statement.type.objectType) && ts.isIdentifier(statement.type.objectType.typeName) && statement.type.objectType.typeName.escapedText === "Component" && ts.isLiteralTypeNode(statement.type.indexType) && ts.isStringLiteral(statement.type.indexType.literal) && statement.type.indexType.literal.text === "input";
3302
3313
  }
3303
3314
  function isExportEmptyInputType(statement) {
3304
- return ts.isTypeAliasDeclaration(statement) && statement.name.escapedText === "Input" && ts.isTypeLiteralNode(statement.type) && !statement.typeParameters && statement.type.members.length === 0 || ts.isInterfaceDeclaration(statement) && statement.name.escapedText === "Input" && !statement.typeParameters && statement.members.length === 0;
3315
+ return ts.isTypeAliasDeclaration(statement) && statement.name.escapedText === "Input" && ts.isTypeLiteralNode(statement.type) && !statement.typeParameters && statement.type.members.length === 0 || ts.isInterfaceDeclaration(statement) && statement.name.escapedText === "Input" && !statement.heritageClauses && !statement.typeParameters && statement.members.length === 0;
3305
3316
  }
3306
3317
  function isExportComponentType(statement) {
3307
3318
  return ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause) && statement.exportClause.elements.length === 1 && statement.exportClause.elements[0].name.escapedText === "Component";
package/dist/index.mjs CHANGED
@@ -2519,9 +2519,7 @@ const attrTags = ${varShared(
2519
2519
  this.#extractor.write(SEP_COMMA_NEW_LINE);
2520
2520
  }
2521
2521
  if (tag.type === 16 /* AttrTag */) {
2522
- this.#extractor.write(
2523
- `[Symbol.iterator]: ${varShared("any")}${SEP_COMMA_NEW_LINE}`
2524
- );
2522
+ this.#extractor.write("[/*").copy(tag.name).write(`*/Symbol.iterator]: ${varShared("any")}${SEP_COMMA_NEW_LINE}`);
2525
2523
  }
2526
2524
  if (!hasInput) {
2527
2525
  this.#writeTagNameComment(tag);
@@ -3145,6 +3143,23 @@ var marko_default = {
3145
3143
  runtimeTypes.internalTypesFile,
3146
3144
  runtimeTypes.markoTypesFile
3147
3145
  ];
3146
+ const compileConfig = {
3147
+ output: "source",
3148
+ stripTypes: true,
3149
+ sourceMaps: true,
3150
+ babelConfig: {
3151
+ babelrc: false,
3152
+ configFile: false,
3153
+ browserslistConfigFile: false,
3154
+ caller: {
3155
+ name: "@marko/type-check",
3156
+ supportsStaticESM: true,
3157
+ supportsDynamicImport: true,
3158
+ supportsTopLevelAwait: true,
3159
+ supportsExportNamespaceFrom: true
3160
+ }
3161
+ }
3162
+ };
3148
3163
  if (runtimeTypes.markoRunTypesFile) {
3149
3164
  rootNames.push(runtimeTypes.markoRunTypesFile);
3150
3165
  }
@@ -3180,11 +3195,7 @@ var marko_default = {
3180
3195
  print({ extracted: { parsed } }) {
3181
3196
  const { code, map } = getCompiler(
3182
3197
  path3.dirname(parsed.filename)
3183
- ).compileSync(parsed.code, parsed.filename, {
3184
- output: "source",
3185
- stripTypes: true,
3186
- sourceMaps: true
3187
- });
3198
+ ).compileSync(parsed.code, parsed.filename, compileConfig);
3188
3199
  return { code, map };
3189
3200
  },
3190
3201
  printTypes({ printer, typeChecker, sourceFile, formatSettings }) {
@@ -3269,7 +3280,7 @@ var marko_default = {
3269
3280
  return ts.isTypeAliasDeclaration(statement) && statement.name.escapedText === "Input" && ts.isIndexedAccessTypeNode(statement.type) && ts.isTypeReferenceNode(statement.type.objectType) && ts.isIdentifier(statement.type.objectType.typeName) && statement.type.objectType.typeName.escapedText === "Component" && ts.isLiteralTypeNode(statement.type.indexType) && ts.isStringLiteral(statement.type.indexType.literal) && statement.type.indexType.literal.text === "input";
3270
3281
  }
3271
3282
  function isExportEmptyInputType(statement) {
3272
- return ts.isTypeAliasDeclaration(statement) && statement.name.escapedText === "Input" && ts.isTypeLiteralNode(statement.type) && !statement.typeParameters && statement.type.members.length === 0 || ts.isInterfaceDeclaration(statement) && statement.name.escapedText === "Input" && !statement.typeParameters && statement.members.length === 0;
3283
+ return ts.isTypeAliasDeclaration(statement) && statement.name.escapedText === "Input" && ts.isTypeLiteralNode(statement.type) && !statement.typeParameters && statement.type.members.length === 0 || ts.isInterfaceDeclaration(statement) && statement.name.escapedText === "Input" && !statement.heritageClauses && !statement.typeParameters && statement.members.length === 0;
3273
3284
  }
3274
3285
  function isExportComponentType(statement) {
3275
3286
  return ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause) && statement.exportClause.elements.length === 1 && statement.exportClause.elements[0].name.escapedText === "Component";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/language-tools",
3
3
  "description": "Marko Language Tools",
4
- "version": "2.1.10",
4
+ "version": "2.1.11",
5
5
  "bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
6
6
  "peerDependencies": {
7
7
  "@marko/compiler": "^5.28.4"