@marko/language-tools 2.5.38 → 2.5.39

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
@@ -2108,20 +2108,32 @@ var ScriptExtractor = class {
2108
2108
  }
2109
2109
  if (this.#api !== RuntimeAPI.tags) {
2110
2110
  if (isExternalComponentFile) {
2111
+ const componentImport = `"${stripExt((0, import_relative_import_path.relativeImportPath)(this.#filename, componentFileName))}"`;
2111
2112
  if (this.#scriptLang === "ts" /* ts */) {
2112
- this.#extractor.write(
2113
- `export interface Component extends ${varShared("ResolveComponent")}<typeof import("${stripExt(
2114
- (0, import_relative_import_path.relativeImportPath)(this.#filename, componentFileName)
2115
- )}")> {}
2113
+ if (typeArgsStr) {
2114
+ this.#extractor.write(
2115
+ `import type Component from ${componentImport};
2116
+ export type { Component };
2116
2117
  `
2117
- );
2118
+ );
2119
+ } else {
2120
+ this.#extractor.write(
2121
+ `export interface Component extends ${varShared("ResolveComponent")}<typeof import(${componentImport})> {}
2122
+ `
2123
+ );
2124
+ }
2118
2125
  } else {
2119
- this.#extractor.write(
2120
- `/** @typedef {${varShared("ResolveComponent")}<typeof import("${stripExt(
2121
- (0, import_relative_import_path.relativeImportPath)(this.#filename, componentFileName)
2122
- )}")>} Component */
2126
+ if (typeArgsStr) {
2127
+ this.#extractor.write(
2128
+ `/** @import Component from ${componentImport} */
2123
2129
  `
2124
- );
2130
+ );
2131
+ } else {
2132
+ this.#extractor.write(
2133
+ `/** @typedef {${varShared("ResolveComponent")}<typeof import(${componentImport})>} Component */
2134
+ `
2135
+ );
2136
+ }
2125
2137
  }
2126
2138
  } else {
2127
2139
  const body2 = componentClassBody || " {}";
package/dist/index.mjs CHANGED
@@ -2071,20 +2071,32 @@ var ScriptExtractor = class {
2071
2071
  }
2072
2072
  if (this.#api !== RuntimeAPI.tags) {
2073
2073
  if (isExternalComponentFile) {
2074
+ const componentImport = `"${stripExt(relativeImportPath(this.#filename, componentFileName))}"`;
2074
2075
  if (this.#scriptLang === "ts" /* ts */) {
2075
- this.#extractor.write(
2076
- `export interface Component extends ${varShared("ResolveComponent")}<typeof import("${stripExt(
2077
- relativeImportPath(this.#filename, componentFileName)
2078
- )}")> {}
2076
+ if (typeArgsStr) {
2077
+ this.#extractor.write(
2078
+ `import type Component from ${componentImport};
2079
+ export type { Component };
2079
2080
  `
2080
- );
2081
+ );
2082
+ } else {
2083
+ this.#extractor.write(
2084
+ `export interface Component extends ${varShared("ResolveComponent")}<typeof import(${componentImport})> {}
2085
+ `
2086
+ );
2087
+ }
2081
2088
  } else {
2082
- this.#extractor.write(
2083
- `/** @typedef {${varShared("ResolveComponent")}<typeof import("${stripExt(
2084
- relativeImportPath(this.#filename, componentFileName)
2085
- )}")>} Component */
2089
+ if (typeArgsStr) {
2090
+ this.#extractor.write(
2091
+ `/** @import Component from ${componentImport} */
2086
2092
  `
2087
- );
2093
+ );
2094
+ } else {
2095
+ this.#extractor.write(
2096
+ `/** @typedef {${varShared("ResolveComponent")}<typeof import(${componentImport})>} Component */
2097
+ `
2098
+ );
2099
+ }
2088
2100
  }
2089
2101
  } else {
2090
2102
  const body2 = componentClassBody || " {}";
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.5.38",
4
+ "version": "2.5.39",
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"