Skip to content
Open
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
116 changes: 93 additions & 23 deletions .tsconfigrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,46 +157,73 @@ const types_publish = {
const jsonrpc = {
name: 'jsonrpc',
path: './jsonrpc',
out: {
dir: './lib',
buildInfoFile: '${buildInfoFile}.tsbuildInfo'
},
sourceFolders: [
{
path: './src/common',
extends: [ common ],
exclude: [ 'test' ],
out: {
dir: '../../lib${libSuffix}/common',
buildInfoFile: '../../lib${libSuffix}/common/${buildInfoFile}.tsbuildInfo'
}
},
{
path: './src/common/test',
extends: [ common, testMixin ],
references: [ '..' ]
references: [ '..' ],
out: {
dir: '../../../lib${libSuffix}/common/test',
buildInfoFile: '../../../lib${libSuffix}/common/test/${buildInfoFile}.tsbuildInfo'
}
},
{
path: './src/browser',
extends: [ browser ],
exclude: [ 'test' ],
references: [ '../common' ]
references: [ '../common' ],
out: {
dir: '../../lib${libSuffix}/browser',
buildInfoFile: '../../lib${libSuffix}/browser/${buildInfoFile}.tsbuildInfo'
}
},
{
path: './src/browser/test',
extends: [ browser, testMixin ],
references: [ '..' ]
references: [ '..' ],
out: {
dir: '../../../lib${libSuffix}/browser/test',
buildInfoFile: '../../../lib${libSuffix}/browser/test/${buildInfoFile}.tsbuildInfo'
}
},
{
path: './src/node',
extends: [ node ],
exclude: [ 'test' ],
references: [ '../common' ]
references: [ '../common' ],
out: {
dir: '../../lib${libSuffix}/node',
buildInfoFile: '../../lib${libSuffix}/node/${buildInfoFile}.tsbuildInfo'
}
},
{
path: './src/node/test',
extends: [ node, testMixin ],
references: [ '..' ]
references: [ '..' ],
out: {
dir: '../../../lib${libSuffix}/node/test',
buildInfoFile: '../../../lib${libSuffix}/node/test/${buildInfoFile}.tsbuildInfo'
}
}
]
};

/** @type ProjectDescription */
const jsonrpc_publish = {
name: 'jsonrpc_publish',
path: './jsonrpc',
references: [ './tsconfig.compat.publish.json', './tsconfig.esm.publish.json' ]
};

/** @type ProjectDescription */
const protocol = {
name: 'protocol',
Expand Down Expand Up @@ -275,29 +302,43 @@ const server = {
const client = {
name: 'client',
path: './client',
out: {
dir: './lib',
buildInfoFile: '${buildInfoFile}.tsbuildInfo'
},
sourceFolders: [
{
path: './src/common',
extends: [ common, vscodeMixin ]
extends: [ common, vscodeMixin ],
out: {
dir: '../../lib${libSuffix}/common',
buildInfoFile: '../../lib${libSuffix}/common/${buildInfoFile}.tsbuildInfo'
}
},
{
path: './src/browser',
extends: [ browser, vscodeMixin ],
references: [ '../common' ]
references: [ '../common' ],
out: {
dir: '../../lib${libSuffix}/browser',
buildInfoFile: '../../lib${libSuffix}/browser/${buildInfoFile}.tsbuildInfo'
}
},
{
path: './src/node',
extends: [ node, vscodeMixin ],
references: [ '../common' ]
references: [ '../common' ],
out: {
dir: '../../lib${libSuffix}/node',
buildInfoFile: '../../lib${libSuffix}/node/${buildInfoFile}.tsbuildInfo'
}
}
],
references: [ protocol ]
};

/** @type ProjectDescription */
const client_publish = {
name: 'client_publish',
path: './client',
references: [ './tsconfig.compat.publish.json', './tsconfig.esm.publish.json' ]
};

/** @type ProjectDescription */
const client_node_tests = {
Expand Down Expand Up @@ -375,7 +416,7 @@ const compileCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, {
const compileProjectOptions = {
tags: ['compile'],
tsconfig: 'tsconfig.json',
variables: new Map([['buildInfoFile', 'compile']]),
variables: new Map([['buildInfoFile', 'compile'], ['libSuffix', '']]),
compilerOptions: compileCompilerOptions
};

Expand All @@ -394,7 +435,7 @@ const watchCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, {
const watchProjectOptions = {
tags: ['watch'],
tsconfig: 'tsconfig.watch.json',
variables: new Map([['buildInfoFile', 'watch']]),
variables: new Map([['buildInfoFile', 'watch'], ['libSuffix', '']]),
compilerOptions: watchCompilerOptions
};

Expand All @@ -413,7 +454,15 @@ const publishCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, {
const publishProjectOptions = {
tags: ['publish'],
tsconfig: 'tsconfig.publish.json',
variables: new Map([['buildInfoFile', 'publish']]),
variables: new Map([['buildInfoFile', 'publish'], ['libSuffix', '']]),
compilerOptions: publishCompilerOptions
};

/** @type ProjectOptions */
const cjsPublishProjectOptions = {
tags: ['publish'],
tsconfig: 'tsconfig.compat.publish.json',
variables: new Map([['buildInfoFile', 'publish'], ['libSuffix', '']]),
compilerOptions: publishCompilerOptions
};

Expand Down Expand Up @@ -484,20 +533,41 @@ const esmPublishProjectOptions = {
compilerOptions: esmPublishCompilerOptions
};

/** @type CompilerOptions */
const esmNodePublishCompilerOptions = CompilerOptions.assign(defaultCompilerOptions, {
composite: true,
sourceMap: false,
declarationMap: false,
noUnusedLocals: true,
noUnusedParameters: true,
target: 'es2022',
module: 'esnext',
moduleResolution: 'bundler',
lib: [ 'es2023' ]
});

/** @type ProjectOptions */
const esmNodePublishProjectOptions = {
tags: ['esm', 'publish'],
tsconfig: 'tsconfig.esm.publish.json',
variables: new Map([['buildInfoFile', 'publish'], ['libSuffix', '/esm']]),
compilerOptions: esmNodePublishCompilerOptions
};

/** @type Projects */
const projects = [
[ textDocument, [ umdProjectOptions, umdWatchProjectOptions, esmPublishProjectOptions, umdPublishProjectOptions ] ],
[ textDocument_publish, [ publishProjectOptions ] ],
[ types, [ umdProjectOptions, umdWatchProjectOptions, esmPublishProjectOptions, umdPublishProjectOptions ] ],
[ types_publish, [ publishProjectOptions ]],
[ jsonrpc, [ compileProjectOptions, watchProjectOptions ] ],
[ createPublishProjectDescription(jsonrpc), [ publishProjectOptions ] ],
[ jsonrpc, [ compileProjectOptions, watchProjectOptions, cjsPublishProjectOptions, esmNodePublishProjectOptions ] ],
[ jsonrpc_publish, [ publishProjectOptions ] ],
[ protocol, [ compileProjectOptions, watchProjectOptions ] ],
[ createPublishProjectDescription(protocol), [ publishProjectOptions ] ],
[ server, [ compileProjectOptions, watchProjectOptions ] ],
[ createPublishProjectDescription(server), [ publishProjectOptions ] ],
[ client, [ compileProjectOptions, watchProjectOptions ] ],
[ createPublishProjectDescription(client), [ publishProjectOptions ] ],
[ client, [ compileProjectOptions, watchProjectOptions, cjsPublishProjectOptions, esmNodePublishProjectOptions ] ],
[ client_publish, [ publishProjectOptions ] ],
[ client_node_tests, [ compileProjectOptions, watchProjectOptions ] ],
[ createPublishProjectDescription(client_node_tests), [ publishProjectOptions ] ],
[ tools, [ compileProjectOptions, watchProjectOptions ] ],
Expand Down
8 changes: 6 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
"exports": {
".": {
"types": "./lib/common/api.d.ts",
"import": "./lib/esm/common/api.js",
"default": "./lib/common/api.js"
},
"./node": {
"types": "./lib/node/main.d.ts",
"import": "./lib/esm/node/main.js",
"node": "./lib/node/main.js"
},
"./browser": {
"types": "./lib/browser/main.d.ts",
"import": "./lib/esm/browser/main.js",
"browser": "./lib/browser/main.js"
},
"./$test/common/*": {
Expand Down Expand Up @@ -55,8 +58,9 @@
"test": "cd ../client-node-tests && npm test && cd ../client",
"clean": "rimraf lib",
"all": "npm run clean && npm run compile && npm run lint && npm test",
"compile:publish": "tsc -b ./tsconfig.publish.json && shx cp src/node/terminateProcess.sh lib/node/terminateProcess.sh",
"all:publish": "git clean -xfd . && npm install && npm run updateVSCodeVersion && npm run compile:publish && npm run lint && cd ../client-node-tests && npm run all:publish && cd ..",
"compile:publish": "tsc -b ./tsconfig.compat.publish.json && shx cp src/node/terminateProcess.sh lib/node/terminateProcess.sh",
"compile:esm": "tsc -b ./tsconfig.esm.publish.json && node ../build/bin/fix-esm",
"all:publish": "git clean -xfd . && npm install && npm run updateVSCodeVersion && npm run compile:publish && npm run compile:esm && npm run lint && cd ../client-node-tests && npm run all:publish && cd ..",
"preversion": "npm test",
"updateVSCodeVersion": "node ./bin/updateVSCode.js",
"update:vscode-version": "node ./bin/updateVSCode.js"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
"target": "es2022",
"outDir": "../../lib/browser",
"tsBuildInfoFile": "../../lib/browser/publish.tsbuildInfo",
"incremental": true
"incremental": true,
"composite": true
},
"include": [
"."
],
"references": [
{
"path": "../common/tsconfig.publish.json"
"path": "../common/tsconfig.compat.publish.json"
}
]
}
}
37 changes: 37 additions & 0 deletions client/src/browser/tsconfig.esm.publish.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"compilerOptions": {
"types": [
"vscode"
],
"module": "esnext",
"moduleResolution": "bundler",
"rootDir": ".",
"lib": [
"es2023",
"webworker"
],
"strict": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"declaration": true,
"stripInternal": true,
"sourceMap": false,
"declarationMap": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"target": "es2022",
"outDir": "../../lib/esm/browser",
"tsBuildInfoFile": "../../lib/esm/browser/publish.tsbuildInfo",
"incremental": true,
"composite": true
},
"include": [
"."
],
"references": [
{
"path": "../common/tsconfig.esm.publish.json"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"include": [
"."
]
}
}
31 changes: 31 additions & 0 deletions client/src/common/tsconfig.esm.publish.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"compilerOptions": {
"types": [
"vscode"
],
"module": "esnext",
"moduleResolution": "bundler",
"rootDir": ".",
"strict": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"declaration": true,
"stripInternal": true,
"sourceMap": false,
"declarationMap": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"target": "es2022",
"lib": [
"es2023"
],
"outDir": "../../lib/esm/common",
"tsBuildInfoFile": "../../lib/esm/common/publish.tsbuildInfo",
"incremental": true,
"composite": true
},
"include": [
"."
]
}
4 changes: 2 additions & 2 deletions client/src/node/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { terminate } from './processes';
import { StreamMessageReader, StreamMessageWriter, IPCMessageReader, IPCMessageWriter, createClientPipeTransport, generateRandomPipeName, createClientSocketTransport, InitializeParams} from 'vscode-languageserver-protocol/node';

// Import SemVer functions individually to avoid circular dependencies in SemVer
import semverParse = require('semver/functions/parse');
import semverSatisfies = require('semver/functions/satisfies');
import semverParse from 'semver/functions/parse';
import semverSatisfies from 'semver/functions/satisfies';

export * from 'vscode-languageserver-protocol/node';
export * from '../common/api';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
],
"outDir": "../../lib/node",
"tsBuildInfoFile": "../../lib/node/publish.tsbuildInfo",
"incremental": true
"incremental": true,
"composite": true
},
"include": [
"."
],
"references": [
{
"path": "../common/tsconfig.publish.json"
"path": "../common/tsconfig.compat.publish.json"
}
]
}
}
Loading