@astrojs/ts-plugin 1.10.7 → 1.10.9

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.
@@ -1,7 +1,7 @@
1
1
  import type { VirtualCode } from '@volar/language-core';
2
2
  export declare function astro2tsx(input: string, fileName: string): {
3
3
  virtualFile: VirtualCode;
4
- diagnostics: import("@astrojs/compiler").DiagnosticMessage[] | {
4
+ diagnostics: import("@astrojs/compiler/types").DiagnosticMessage[] | {
5
5
  code: 1000;
6
6
  location: {
7
7
  file: string;
@@ -13,12 +13,12 @@ export type CollectionConfig = {
13
13
  };
14
14
  export declare function getFrontmatterLanguagePlugin(collectionConfig: CollectionConfig[]): LanguagePlugin<string, FrontmatterHolder>;
15
15
  export declare class FrontmatterHolder implements VirtualCode {
16
+ id: string;
17
+ mappings: CodeMapping[];
18
+ embeddedCodes: VirtualCode[];
16
19
  fileName: string;
17
20
  languageId: string;
18
21
  snapshot: ts.IScriptSnapshot;
19
22
  collection: string | undefined;
20
- id: string;
21
- mappings: CodeMapping[];
22
- embeddedCodes: VirtualCode[];
23
23
  constructor(fileName: string, languageId: string, snapshot: ts.IScriptSnapshot, collection: string | undefined);
24
24
  }
@@ -56,11 +56,11 @@ function getFrontmatterLanguagePlugin(collectionConfig) {
56
56
  }
57
57
  class FrontmatterHolder {
58
58
  constructor(fileName, languageId, snapshot, collection) {
59
+ this.id = 'frontmatter-holder';
59
60
  this.fileName = fileName;
60
61
  this.languageId = languageId;
61
62
  this.snapshot = snapshot;
62
63
  this.collection = collection;
63
- this.id = 'frontmatter-holder';
64
64
  this.mappings = [
65
65
  {
66
66
  sourceOffsets: [0],
@@ -2,12 +2,12 @@ import { type CodeMapping, type LanguagePlugin, type VirtualCode } from '@volar/
2
2
  import type ts from 'typescript';
3
3
  export declare function getLanguagePlugin(): LanguagePlugin<string, AstroVirtualCode>;
4
4
  export declare class AstroVirtualCode implements VirtualCode {
5
- fileName: string;
6
- snapshot: ts.IScriptSnapshot;
7
5
  id: string;
8
6
  languageId: string;
9
7
  mappings: CodeMapping[];
10
8
  embeddedCodes: VirtualCode[];
11
9
  codegenStacks: never[];
10
+ fileName: string;
11
+ snapshot: ts.IScriptSnapshot;
12
12
  constructor(fileName: string, snapshot: ts.IScriptSnapshot);
13
13
  }
package/dist/language.js CHANGED
@@ -35,11 +35,11 @@ function getLanguagePlugin() {
35
35
  }
36
36
  class AstroVirtualCode {
37
37
  constructor(fileName, snapshot) {
38
- this.fileName = fileName;
39
- this.snapshot = snapshot;
40
38
  this.id = 'root';
41
39
  this.languageId = 'astro';
42
40
  this.codegenStacks = [];
41
+ this.fileName = fileName;
42
+ this.snapshot = snapshot;
43
43
  this.mappings = [
44
44
  {
45
45
  sourceOffsets: [0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/ts-plugin",
3
- "version": "1.10.7",
3
+ "version": "1.10.9",
4
4
  "description": "A TypeScript Plugin providing Astro intellisense",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
@@ -23,7 +23,7 @@
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
25
  "@astrojs/compiler": "^2.13.1",
26
- "@astrojs/yaml2ts": "^0.2.3",
26
+ "@astrojs/yaml2ts": "^0.2.4",
27
27
  "@jridgewell/sourcemap-codec": "^1.5.5",
28
28
  "@volar/language-core": "~2.4.28",
29
29
  "@volar/typescript": "~2.4.28",
@@ -34,15 +34,17 @@
34
34
  "@types/mocha": "^10.0.10",
35
35
  "@types/node": "^20.9.0",
36
36
  "@types/semver": "^7.7.1",
37
- "@vscode/test-electron": "^2.5.2",
37
+ "@types/vscode": "^1.101.0",
38
38
  "@vscode/test-cli": "^0.0.12",
39
+ "@vscode/test-electron": "^2.5.2",
39
40
  "mocha": "^11.7.5",
40
- "typescript": "^5.9.3",
41
+ "tsx": "^4.21.0",
42
+ "typescript": "^6.0.3",
41
43
  "vscode-uri": "^3.1.0"
42
44
  },
43
45
  "scripts": {
44
- "build": "tsc",
45
- "dev": "tsc --watch",
46
+ "build": "tsc -b",
47
+ "dev": "tsc -b --watch",
46
48
  "test": "vscode-test"
47
49
  }
48
50
  }