@astrojs/ts-plugin
Advanced tools
Comparing version 1.9.3 to 1.10.0
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.astro2tsx = void 0; | ||
exports.astro2tsx = astro2tsx; | ||
const node_path_1 = __importDefault(require("node:path")); | ||
@@ -57,3 +57,2 @@ const sync_1 = require("@astrojs/compiler/sync"); | ||
} | ||
exports.astro2tsx = astro2tsx; | ||
function getVirtualFileTSX(input, tsx, fileName) { | ||
@@ -60,0 +59,0 @@ tsx.code = patchTSX(tsx.code, fileName); |
@@ -1,2 +0,2 @@ | ||
declare const _default: ts.server.PluginModuleFactory; | ||
declare const _default: import("typescript").server.PluginModuleFactory; | ||
export = _default; |
"use strict"; | ||
const createLanguageServicePlugin_js_1 = require("@volar/typescript/lib/quickstart/createLanguageServicePlugin.js"); | ||
const frontmatter_js_1 = require("./frontmatter.js"); | ||
const language_js_1 = require("./language.js"); | ||
module.exports = (0, createLanguageServicePlugin_js_1.createLanguageServicePlugin)(() => ({ | ||
languagePlugins: [(0, language_js_1.getLanguagePlugin)()], | ||
})); | ||
module.exports = (0, createLanguageServicePlugin_js_1.createLanguageServicePlugin)((ts, info) => { | ||
let collectionConfig = undefined; | ||
try { | ||
const currentDir = info.project.getCurrentDirectory(); | ||
const fileContent = ts.sys.readFile(currentDir + '/.astro/collections/collections.json'); | ||
if (fileContent) { | ||
collectionConfig = { | ||
folder: currentDir, | ||
config: JSON.parse(fileContent), | ||
}; | ||
} | ||
} | ||
catch (err) { | ||
// If the file doesn't exist, we don't really care, but if it's something else, we want to know | ||
if (err && err.code !== 'ENOENT') | ||
console.error(err); | ||
} | ||
let languagePlugins = [(0, language_js_1.getLanguagePlugin)()]; | ||
if (collectionConfig) { | ||
languagePlugins.push((0, frontmatter_js_1.getFrontmatterLanguagePlugin)([collectionConfig])); | ||
} | ||
return { | ||
languagePlugins, | ||
}; | ||
}); |
"use strict"; | ||
/// <reference types="@volar/typescript" /> | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AstroVirtualCode = exports.getLanguagePlugin = void 0; | ||
exports.AstroVirtualCode = void 0; | ||
exports.getLanguagePlugin = getLanguagePlugin; | ||
const language_core_1 = require("@volar/language-core"); | ||
@@ -35,3 +36,2 @@ const astro2tsx_js_1 = require("./astro2tsx.js"); | ||
} | ||
exports.getLanguagePlugin = getLanguagePlugin; | ||
class AstroVirtualCode { | ||
@@ -38,0 +38,0 @@ constructor(fileName, snapshot) { |
{ | ||
"name": "@astrojs/ts-plugin", | ||
"version": "1.9.3", | ||
"version": "1.10.0", | ||
"description": "A TypeScript Plugin providing Astro intellisense", | ||
@@ -25,6 +25,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@astrojs/compiler": "^2.10.3", | ||
"@astrojs/yaml2ts": "^0.2.0", | ||
"@jridgewell/sourcemap-codec": "^1.4.15", | ||
"@volar/language-core": "~2.4.0-alpha.15", | ||
"@volar/typescript": "~2.4.0-alpha.15", | ||
"@astrojs/compiler": "^2.10.3", | ||
"@jridgewell/sourcemap-codec": "^1.4.15", | ||
"semver": "^7.3.8", | ||
@@ -40,3 +41,5 @@ "vscode-languageserver-textdocument": "^1.0.11" | ||
"glob": "^8.0.3", | ||
"mocha": "^10.2.0" | ||
"mocha": "^10.2.0", | ||
"vscode-uri": "^3.0.8", | ||
"typescript": "^5.5.4" | ||
}, | ||
@@ -43,0 +46,0 @@ "scripts": { |
19319
11
376
7
9
+ Added@astrojs/yaml2ts@^0.2.0
+ Added@astrojs/yaml2ts@0.2.2(transitive)
+ Addedyaml@2.7.0(transitive)