diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index d5ed05b20..dd2b2fd82 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -26,7 +26,7 @@ export default async function build(...args) { const { type = 'module', dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString())); const format = type === 'module' ? 'esm' : 'cjs'; - const external = [...Object.keys(dependencies), 'source-map-support', 'source-map-support/register.js', 'vscode']; + const external = [...Object.keys(dependencies), '@astrojs/language-server/bin/server.js', 'source-map-support', 'source-map-support/register.js', 'vscode']; const outdir = 'dist'; await clean(outdir); diff --git a/tools/astro-languageserver/CHANGELOG.md b/tools/astro-languageserver/CHANGELOG.md deleted file mode 100644 index afa4ec736..000000000 --- a/tools/astro-languageserver/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# astro-languageserver - -## 0.4.0 - -### Minor Changes - -- 06e2597: Adds support for import suggestions diff --git a/tools/language-server/CHANGELOG.md b/tools/language-server/CHANGELOG.md new file mode 100644 index 000000000..b6c315744 --- /dev/null +++ b/tools/language-server/CHANGELOG.md @@ -0,0 +1,20 @@ +# @astrojs/language-server + +## 0.5.0 + +- Fix `bin` file + +## 0.5.0-next.1 + +- Expose `bin/server.js` as `astro-ls` + +## 0.5.0-next.0 + +- Moved to scoped `@astrojs/language-server` package +- Removed some `devDependencies` from the bundle and added them to `dependencies` + +## 0.4.0 + +### Minor Changes + +- 06e2597: Adds support for import suggestions diff --git a/tools/astro-languageserver/LICENSE b/tools/language-server/LICENSE similarity index 100% rename from tools/astro-languageserver/LICENSE rename to tools/language-server/LICENSE diff --git a/tools/astro-languageserver/bin/server.js b/tools/language-server/bin/server.js similarity index 53% rename from tools/astro-languageserver/bin/server.js rename to tools/language-server/bin/server.js index 7d3814ebc..8697984ce 100644 --- a/tools/astro-languageserver/bin/server.js +++ b/tools/language-server/bin/server.js @@ -1,6 +1,7 @@ #! /usr/bin/env node +// @ts-ignore // eslint-disable-next-line @typescript-eslint/no-var-requires -const { startServer } = require('../dist/index'); +const { startServer } = require('@astrojs/language-server/dist/index.js'); startServer(); diff --git a/tools/astro-languageserver/package.json b/tools/language-server/package.json similarity index 77% rename from tools/astro-languageserver/package.json rename to tools/language-server/package.json index 3ec538190..7fec561d1 100644 --- a/tools/astro-languageserver/package.json +++ b/tools/language-server/package.json @@ -1,22 +1,24 @@ { - "name": "astro-languageserver", - "version": "0.4.0", + "name": "@astrojs/language-server", + "version": "0.5.0", "author": "Skypack", "license": "MIT", "type": "commonjs", "main": "dist/index.js", "types": "types/index.d.ts", + "bin": { + "astro-ls": "./bin/server.js" + }, "files": [ "dist", + "bin", "types" ], "scripts": { "build": "astro-scripts build 'src/index.ts'", "dev": "astro-scripts dev 'src/index.ts'" }, - "devDependencies": { - "astro": "^0.13.0", - "astro-scripts": "0.0.1", + "dependencies": { "source-map": "^0.7.3", "typescript": "^4.3.1-rc", "vscode-css-languageservice": "^5.1.1", @@ -24,5 +26,9 @@ "vscode-html-languageservice": "^3.0.3", "vscode-languageserver": "6.1.1", "vscode-languageserver-textdocument": "^1.0.1" + }, + "devDependencies": { + "astro": "^0.13.0", + "astro-scripts": "0.0.1" } } diff --git a/tools/astro-languageserver/src/core/config/ConfigManager.ts b/tools/language-server/src/core/config/ConfigManager.ts similarity index 100% rename from tools/astro-languageserver/src/core/config/ConfigManager.ts rename to tools/language-server/src/core/config/ConfigManager.ts diff --git a/tools/astro-languageserver/src/core/config/index.ts b/tools/language-server/src/core/config/index.ts similarity index 100% rename from tools/astro-languageserver/src/core/config/index.ts rename to tools/language-server/src/core/config/index.ts diff --git a/tools/astro-languageserver/src/core/documents/Document.ts b/tools/language-server/src/core/documents/Document.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/Document.ts rename to tools/language-server/src/core/documents/Document.ts diff --git a/tools/astro-languageserver/src/core/documents/DocumentBase.ts b/tools/language-server/src/core/documents/DocumentBase.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/DocumentBase.ts rename to tools/language-server/src/core/documents/DocumentBase.ts diff --git a/tools/astro-languageserver/src/core/documents/DocumentManager.ts b/tools/language-server/src/core/documents/DocumentManager.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/DocumentManager.ts rename to tools/language-server/src/core/documents/DocumentManager.ts diff --git a/tools/astro-languageserver/src/core/documents/DocumentMapper.ts b/tools/language-server/src/core/documents/DocumentMapper.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/DocumentMapper.ts rename to tools/language-server/src/core/documents/DocumentMapper.ts diff --git a/tools/astro-languageserver/src/core/documents/index.ts b/tools/language-server/src/core/documents/index.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/index.ts rename to tools/language-server/src/core/documents/index.ts diff --git a/tools/astro-languageserver/src/core/documents/parseAstro.ts b/tools/language-server/src/core/documents/parseAstro.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/parseAstro.ts rename to tools/language-server/src/core/documents/parseAstro.ts diff --git a/tools/astro-languageserver/src/core/documents/parseHtml.ts b/tools/language-server/src/core/documents/parseHtml.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/parseHtml.ts rename to tools/language-server/src/core/documents/parseHtml.ts diff --git a/tools/astro-languageserver/src/core/documents/utils.ts b/tools/language-server/src/core/documents/utils.ts similarity index 100% rename from tools/astro-languageserver/src/core/documents/utils.ts rename to tools/language-server/src/core/documents/utils.ts diff --git a/tools/astro-languageserver/src/index.ts b/tools/language-server/src/index.ts similarity index 100% rename from tools/astro-languageserver/src/index.ts rename to tools/language-server/src/index.ts diff --git a/tools/astro-languageserver/src/plugins/PluginHost.ts b/tools/language-server/src/plugins/PluginHost.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/PluginHost.ts rename to tools/language-server/src/plugins/PluginHost.ts diff --git a/tools/astro-languageserver/src/plugins/astro/AstroPlugin.ts b/tools/language-server/src/plugins/astro/AstroPlugin.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/astro/AstroPlugin.ts rename to tools/language-server/src/plugins/astro/AstroPlugin.ts diff --git a/tools/astro-languageserver/src/plugins/css/CSSDocument.ts b/tools/language-server/src/plugins/css/CSSDocument.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/css/CSSDocument.ts rename to tools/language-server/src/plugins/css/CSSDocument.ts diff --git a/tools/astro-languageserver/src/plugins/css/CSSPlugin.ts b/tools/language-server/src/plugins/css/CSSPlugin.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/css/CSSPlugin.ts rename to tools/language-server/src/plugins/css/CSSPlugin.ts diff --git a/tools/astro-languageserver/src/plugins/css/StyleAttributeDocument.ts b/tools/language-server/src/plugins/css/StyleAttributeDocument.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/css/StyleAttributeDocument.ts rename to tools/language-server/src/plugins/css/StyleAttributeDocument.ts diff --git a/tools/astro-languageserver/src/plugins/css/features/getIdClassCompletion.ts b/tools/language-server/src/plugins/css/features/getIdClassCompletion.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/css/features/getIdClassCompletion.ts rename to tools/language-server/src/plugins/css/features/getIdClassCompletion.ts diff --git a/tools/astro-languageserver/src/plugins/css/service.ts b/tools/language-server/src/plugins/css/service.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/css/service.ts rename to tools/language-server/src/plugins/css/service.ts diff --git a/tools/astro-languageserver/src/plugins/html/HTMLPlugin.ts b/tools/language-server/src/plugins/html/HTMLPlugin.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/html/HTMLPlugin.ts rename to tools/language-server/src/plugins/html/HTMLPlugin.ts diff --git a/tools/astro-languageserver/src/plugins/index.ts b/tools/language-server/src/plugins/index.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/index.ts rename to tools/language-server/src/plugins/index.ts diff --git a/tools/astro-languageserver/src/plugins/interfaces.ts b/tools/language-server/src/plugins/interfaces.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/interfaces.ts rename to tools/language-server/src/plugins/interfaces.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/DocumentSnapshot.ts b/tools/language-server/src/plugins/typescript/DocumentSnapshot.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/DocumentSnapshot.ts rename to tools/language-server/src/plugins/typescript/DocumentSnapshot.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/LanguageServiceManager.ts b/tools/language-server/src/plugins/typescript/LanguageServiceManager.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/LanguageServiceManager.ts rename to tools/language-server/src/plugins/typescript/LanguageServiceManager.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/SnapshotManager.ts b/tools/language-server/src/plugins/typescript/SnapshotManager.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/SnapshotManager.ts rename to tools/language-server/src/plugins/typescript/SnapshotManager.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/TypeScriptPlugin.ts b/tools/language-server/src/plugins/typescript/TypeScriptPlugin.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/TypeScriptPlugin.ts rename to tools/language-server/src/plugins/typescript/TypeScriptPlugin.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/astro-sys.ts b/tools/language-server/src/plugins/typescript/astro-sys.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/astro-sys.ts rename to tools/language-server/src/plugins/typescript/astro-sys.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/features/CompletionsProvider.ts b/tools/language-server/src/plugins/typescript/features/CompletionsProvider.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/features/CompletionsProvider.ts rename to tools/language-server/src/plugins/typescript/features/CompletionsProvider.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/features/utils.ts b/tools/language-server/src/plugins/typescript/features/utils.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/features/utils.ts rename to tools/language-server/src/plugins/typescript/features/utils.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/languageService.ts b/tools/language-server/src/plugins/typescript/languageService.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/languageService.ts rename to tools/language-server/src/plugins/typescript/languageService.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/module-loader.ts b/tools/language-server/src/plugins/typescript/module-loader.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/module-loader.ts rename to tools/language-server/src/plugins/typescript/module-loader.ts diff --git a/tools/astro-languageserver/src/plugins/typescript/utils.ts b/tools/language-server/src/plugins/typescript/utils.ts similarity index 100% rename from tools/astro-languageserver/src/plugins/typescript/utils.ts rename to tools/language-server/src/plugins/typescript/utils.ts diff --git a/tools/astro-languageserver/src/types/index.d.ts b/tools/language-server/src/types/index.d.ts similarity index 100% rename from tools/astro-languageserver/src/types/index.d.ts rename to tools/language-server/src/types/index.d.ts diff --git a/tools/astro-languageserver/src/utils.ts b/tools/language-server/src/utils.ts similarity index 100% rename from tools/astro-languageserver/src/utils.ts rename to tools/language-server/src/utils.ts diff --git a/tools/astro-languageserver/tsconfig.json b/tools/language-server/tsconfig.json similarity index 100% rename from tools/astro-languageserver/tsconfig.json rename to tools/language-server/tsconfig.json diff --git a/tools/astro-vscode/.vscodeignore b/tools/vscode/.vscodeignore similarity index 100% rename from tools/astro-vscode/.vscodeignore rename to tools/vscode/.vscodeignore diff --git a/tools/astro-vscode/CHANGELOG.md b/tools/vscode/CHANGELOG.md similarity index 91% rename from tools/astro-vscode/CHANGELOG.md rename to tools/vscode/CHANGELOG.md index 0ac8dfc1d..76cbdb409 100644 --- a/tools/astro-vscode/CHANGELOG.md +++ b/tools/vscode/CHANGELOG.md @@ -1,5 +1,8 @@ # astro-vscode +## 0.5.0 + +- Bug fixes, dependency updates ## 0.4.3 ### Patch Changes diff --git a/tools/astro-vscode/assets/icon.png b/tools/vscode/assets/icon.png similarity index 100% rename from tools/astro-vscode/assets/icon.png rename to tools/vscode/assets/icon.png diff --git a/tools/astro-vscode/contributing.md b/tools/vscode/contributing.md similarity index 100% rename from tools/astro-vscode/contributing.md rename to tools/vscode/contributing.md diff --git a/tools/astro-vscode/languages/astro-language-configuration.json b/tools/vscode/languages/astro-language-configuration.json similarity index 100% rename from tools/astro-vscode/languages/astro-language-configuration.json rename to tools/vscode/languages/astro-language-configuration.json diff --git a/tools/astro-vscode/languages/astro-markdown-language-configuration.json b/tools/vscode/languages/astro-markdown-language-configuration.json similarity index 100% rename from tools/astro-vscode/languages/astro-markdown-language-configuration.json rename to tools/vscode/languages/astro-markdown-language-configuration.json diff --git a/tools/astro-vscode/package.json b/tools/vscode/package.json similarity index 97% rename from tools/astro-vscode/package.json rename to tools/vscode/package.json index d947c90ee..4b6b1266f 100644 --- a/tools/astro-vscode/package.json +++ b/tools/vscode/package.json @@ -8,11 +8,12 @@ "color": "#FFBE2D", "theme": "dark" }, - "version": "0.4.3", + "version": "0.5.0", "author": "Astro", "license": "MIT", "publisher": "astro-build", "scripts": { + "vscode:prepublish": "yarn build", "vscode:publish": "node ./scripts/publish.mjs", "build": "astro-scripts build 'src/index.ts'", "dev": "astro-scripts dev 'src/index.ts'" @@ -24,15 +25,15 @@ "onLanguage:astro" ], "dependencies": { - "astro-languageserver": "^0.4.0" + "@astrojs/language-server": "0.5.0", + "vscode-emmet-helper": "2.1.2", + "vscode-html-languageservice": "^3.0.3", + "vscode-languageclient": "~7.0.0" }, "devDependencies": { "@types/vscode": "^1.52.0", "astro-scripts": "file:../../scripts", - "execa": "^5.0.0", - "vscode-emmet-helper": "2.1.2", - "vscode-html-languageservice": "^3.0.3", - "vscode-languageclient": "~7.0.0" + "execa": "^5.0.0" }, "main": "./dist/index.js", "files": [ diff --git a/tools/astro-vscode/scripts/publish.mjs b/tools/vscode/scripts/publish.mjs similarity index 100% rename from tools/astro-vscode/scripts/publish.mjs rename to tools/vscode/scripts/publish.mjs diff --git a/tools/astro-vscode/src/html/autoClose.ts b/tools/vscode/src/html/autoClose.ts similarity index 100% rename from tools/astro-vscode/src/html/autoClose.ts rename to tools/vscode/src/html/autoClose.ts diff --git a/tools/astro-vscode/src/index.ts b/tools/vscode/src/index.ts similarity index 94% rename from tools/astro-vscode/src/index.ts rename to tools/vscode/src/index.ts index 19a7388a8..287e3f119 100644 --- a/tools/astro-vscode/src/index.ts +++ b/tools/vscode/src/index.ts @@ -16,10 +16,10 @@ export async function activate(context: vscode.ExtensionContext) { /** */ function createLanguageService(context: vscode.ExtensionContext, mode: 'doc', id: string, name: string, port: number) { const { workspace } = vscode; - const serverModule = require.resolve('astro-languageserver/bin/server.js'); + const serverModule = require.resolve('@astrojs/language-server/bin/server.js'); const debugOptions = { execArgv: ['--nolazy', '--inspect=' + port] }; const serverOptions: lsp.ServerOptions = { - run: { module: 'astro-languageserver', transport: lsp.TransportKind.ipc }, + run: { module: serverModule, transport: lsp.TransportKind.ipc }, debug: { module: serverModule, transport: lsp.TransportKind.ipc, diff --git a/tools/astro-vscode/syntaxes/astro-markdown.tmLanguage.json b/tools/vscode/syntaxes/astro-markdown.tmLanguage.json similarity index 100% rename from tools/astro-vscode/syntaxes/astro-markdown.tmLanguage.json rename to tools/vscode/syntaxes/astro-markdown.tmLanguage.json diff --git a/tools/astro-vscode/syntaxes/astro.tmLanguage.json b/tools/vscode/syntaxes/astro.tmLanguage.json similarity index 100% rename from tools/astro-vscode/syntaxes/astro.tmLanguage.json rename to tools/vscode/syntaxes/astro.tmLanguage.json diff --git a/tools/astro-vscode/tsconfig.base.json b/tools/vscode/tsconfig.base.json similarity index 100% rename from tools/astro-vscode/tsconfig.base.json rename to tools/vscode/tsconfig.base.json diff --git a/tools/astro-vscode/tsconfig.json b/tools/vscode/tsconfig.json similarity index 100% rename from tools/astro-vscode/tsconfig.json rename to tools/vscode/tsconfig.json