Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
node_modules
dist
shared/meta.ts
packages/shared/src/meta.ts

# local env files
.env.local
Expand Down
3 changes: 2 additions & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"scripts": {
"dev": "tsdown --watch",
"build": "tsdown",
"update": "vscode-ext-gen --scope npmx --output ../../shared/meta.ts",
"update": "vscode-ext-gen --scope npmx --output ../../packages/shared/src/meta.ts",
"vscode:prepublish": "npm run build",
"package": "npx @vscode/vsce package --no-dependencies",
"prepare": "npm run update"
Expand All @@ -208,6 +208,7 @@
"@volar/vscode": "catalog:lsp",
"npmx-language-core": "workspace:*",
"npmx-language-server": "workspace:*",
"npmx-shared": "workspace:*",
"ocache": "catalog:inline",
"reactive-vscode": "catalog:inline",
"semver": "catalog:inline",
Expand Down
6 changes: 3 additions & 3 deletions extensions/vscode/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { GetPackageManagerRequest } from '#shared/protocol'
import type { DocumentFilter } from '@volar/vscode'
import { displayName, extensionId } from '#shared/meta'
import { GET_PACKAGE_MANAGER_METHOD } from '#shared/protocol'
import type { GetPackageManagerRequest } from 'npmx-shared/protocol'
import { SUPPORTED_DOCUMENT_PATTERN } from '#utils/constants'
import { middleware } from '@volar/vscode'
import { LanguageClient, TransportKind } from '@volar/vscode/node'
import { displayName, extensionId } from 'npmx-shared/meta'
import { GET_PACKAGE_MANAGER_METHOD } from 'npmx-shared/protocol'
import { commands, Hover, MarkdownString, Uri } from 'vscode'

const SUPPORTED_LANGUAGES = [
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/commands/add-to-ignore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ConfigurationTarget } from '#shared/constants'
import { scopedConfigs } from '#shared/meta'
import type { ConfigurationTarget } from 'npmx-shared/constants'
import { checkIgnored } from 'npmx-language-core/utils'
import { scopedConfigs } from 'npmx-shared/meta'
import { workspace } from 'vscode'

export async function addToIgnore(scope: string, name: string, target: ConfigurationTarget) {
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useWorkspaceContext } from '#composables/workspace-context'
import { ADD_TO_IGNORE_COMMAND } from '#shared/commands'
import { commands, displayName, version } from '#shared/meta'
import { createLabsInfo } from '@volar/vscode'
import { ADD_TO_IGNORE_COMMAND } from 'npmx-shared/commands'
import { commands, displayName, version } from 'npmx-shared/meta'
import { defineExtension, useCommand, useCommands } from 'reactive-vscode'
import { Uri } from 'vscode'
import { launch } from './client'
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NestedScopedConfigs } from '#shared/meta'
import { displayName, scopedConfigs } from '#shared/meta'
import type { NestedScopedConfigs } from 'npmx-shared/meta'
import { displayName, scopedConfigs } from 'npmx-shared/meta'
import { defineConfig, defineLogger } from 'reactive-vscode'

export const config = defineConfig<NestedScopedConfigs>(scopedConfigs.scope)
Expand Down
4 changes: 1 addition & 3 deletions extensions/vscode/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tsbuildinfo/app",
"paths": {
"#shared/*": ["../../shared/*"],
"#state": ["./src/state.ts"],
"#api/*": ["./src/api/*"],
"#types/*": ["./src/types/*"],
Expand All @@ -14,7 +13,6 @@
},
"include": [
"src/**/*",
"tests/**/*",
"../../shared"
"tests/**/*"
]
}
3 changes: 1 addition & 2 deletions packages/language-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"./links": "./dist/links.js",
"./types": "./dist/types.js",
"./utils": "./dist/utils/index.js",
"./workspace": "./dist/workspace.js",
"./package.json": "./package.json"
"./workspace": "./dist/workspace.js"
},
"files": [
"dist/**/*"
Expand Down
4 changes: 3 additions & 1 deletion packages/language-core/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default defineConfig({
'src/workspace.ts',
],
platform: 'neutral',
exports: true,
exports: {
packageJson: false,
},
dts: true,
minify: 'dce-only',
deps: {
Expand Down
4 changes: 2 additions & 2 deletions packages/language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
},
"sideEffects": true,
"exports": {
".": "./dist/index.cjs",
"./package.json": "./package.json"
".": "./dist/index.cjs"
},
"main": "./dist/index.cjs",
"bin": {
Expand All @@ -30,6 +29,7 @@
"@volar/language-server": "catalog:lsp",
"npmx-language-core": "workspace:*",
"npmx-language-service": "workspace:*",
"npmx-shared": "workspace:*",
"ocache": "catalog:inline",
"vscode-uri": "catalog:lsp"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/language-server/src/workspace.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { GetPackageManagerRequest } from '#shared/protocol'
import type { Connection, LanguageServer } from '@volar/language-server'
import type { DependencyInfo, WorkspaceAdapter } from 'npmx-language-core/workspace'
import type { IWorkspaceState } from 'npmx-language-service/types'
import type { GetPackageManagerRequest } from 'npmx-shared/protocol'
import { access, readFile } from 'node:fs/promises'
import { GET_PACKAGE_MANAGER_METHOD } from '#shared/protocol'
import { RequestType } from '@volar/language-server'
import { PACKAGE_JSON_BASENAME } from 'npmx-language-core/constants'
import { isDependencyFile, isPackageManifest, isWorkspaceFile } from 'npmx-language-core/utils'
import { WorkspaceContext } from 'npmx-language-core/workspace'
import { GET_PACKAGE_MANAGER_METHOD } from 'npmx-shared/protocol'
import { defineCachedFunction } from 'ocache'
import { URI } from 'vscode-uri'

Expand Down
8 changes: 2 additions & 6 deletions packages/language-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tsbuildinfo",
"paths": {
"#shared/*": ["../../shared/*"]
}
"tsBuildInfoFile": "./node_modules/.tsbuildinfo"
},
"include": [
"src",
"../../shared"
"src"
]
}
4 changes: 3 additions & 1 deletion packages/language-server/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { umdToEsm } from '../../plugins/umd-to-esm.ts'
export default defineConfig({
entry: 'src/index.ts',
platform: 'node',
exports: true,
exports: {
packageJson: false,
},
format: 'cjs',
checks: {
// @volar/language-server@2.4.28
Expand Down
4 changes: 2 additions & 2 deletions packages/language-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"sideEffects": false,
"exports": {
".": "./dist/index.mjs",
"./types": "./dist/types.mjs",
"./package.json": "./package.json"
"./types": "./dist/types.mjs"
},
"files": [
"dist/**/*"
Expand All @@ -25,6 +24,7 @@
"dependencies": {
"@volar/language-service": "catalog:lsp",
"npmx-language-core": "workspace:*",
"npmx-shared": "workspace:*",
"semver": "catalog:inline",
"vscode-uri": "catalog:lsp"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ConfigKey, ConfigKeyTypeMap } from '#shared/meta'
import type { LanguageServiceContext } from '@volar/language-service'
import type { ConfigKey, ConfigKeyTypeMap } from 'npmx-shared/meta'

export async function getConfig<T extends ConfigKey>(context: LanguageServiceContext, section: T): Promise<ConfigKeyTypeMap[T]> {
return (await context.env.getConfiguration!(section))!
Expand Down
4 changes: 2 additions & 2 deletions packages/language-service/src/plugins/diagnostics/actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CodeAction, CodeActionKind, Diagnostic } from '@volar/language-service'
import { ADD_TO_IGNORE_COMMAND } from '#shared/commands'
import { ConfigurationTarget } from '#shared/constants'
import { ADD_TO_IGNORE_COMMAND } from 'npmx-shared/commands'
import { ConfigurationTarget } from 'npmx-shared/constants'

type MatchGroups = NonNullable<RegExpExecArray['groups']>

Expand Down
2 changes: 1 addition & 1 deletion packages/language-service/src/plugins/diagnostics/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { CodeActionKind, Diagnostic, LanguageServicePlugin, LanguageServicePluginInstance } from '@volar/language-service'
import type { IWorkspaceState } from '../../types'
import type { DiagnosticContext, DiagnosticRule } from './types'
import { displayName } from '#shared/meta'
import { isDependencyFile } from 'npmx-language-core/utils'
import { displayName } from 'npmx-shared/meta'
import { URI } from 'vscode-uri'
import { getConfig } from '../../config'
import { strategies } from './actions'
Expand Down
8 changes: 2 additions & 6 deletions packages/language-service/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tsbuildinfo",
"paths": {
"#shared/*": ["../../shared/*"]
}
"tsBuildInfoFile": "./node_modules/.tsbuildinfo"
},
"include": [
"src",
"../../shared"
"src"
]
}
4 changes: 3 additions & 1 deletion packages/language-service/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export default defineConfig({
'src/types.ts',
],
platform: 'node',
exports: true,
exports: {
packageJson: false,
},
dts: true,
minify: 'dce-only',
})
30 changes: 30 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "npmx-shared",
"type": "module",
"version": "0.7.0",
"private": true,
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/npmx-dev/vscode-npmx.git",
"directory": "packages/shared"
},
"sideEffects": false,
"exports": {
"./commands": "./dist/commands.js",
"./constants": "./dist/constants.js",
"./meta": "./dist/meta.js",
"./protocol": "./dist/protocol.js",
"./types": "./dist/types.js"
},
"files": [
"dist/**/*"
],
"scripts": {
"dev": "tsdown --watch",
"build": "tsdown"
},
"dependencies": {
"npmx-language-core": "workspace:*"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions packages/shared/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tsbuildinfo"
},
"include": [
"src"
]
}
10 changes: 10 additions & 0 deletions packages/shared/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'tsdown'

export default defineConfig({
entry: 'src/**/*.ts',
platform: 'neutral',
exports: {
packageJson: false,
},
dts: true,
})
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"references": [
{ "path": "./extensions/vscode/tsconfig.json" },
{ "path": "./packages/shared/tsconfig.json" },
{ "path": "./packages/language-core/tsconfig.json" },
{ "path": "./packages/language-server/tsconfig.json" },
{ "path": "./packages/language-service/tsconfig.json" }
Expand Down
Loading