Skip to content
Closed
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
20 changes: 10 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,17 @@
"request": "launch",
"name": "Debug task",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/${input:taskScript}"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/${input:taskScript}",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Update OmniSharp package dependencies",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/updatePackageDependencies.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/debugger/updatePackageDependencies.ts",
"env": {
"NEW_DEPS_ID": "OmniSharp",
"NEW_DEPS_URLS": "https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x86.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-arm64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-x64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-arm64.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-musl-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-musl-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-linux-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-osx-arm64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-x64-net6.0.zip,https://roslynomnisharp.blob.core.windows.net/releases/1.39.14/omnisharp-win-arm64-net6.0.zip",
Expand All @@ -205,8 +205,8 @@
"request": "launch",
"name": "Update razor telemetry package dependencies",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/updatePackageDependencies.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/debugger/updatePackageDependencies.ts",
"env": {
"NEW_DEPS_URLS": "https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/704e369c5905f9ece819ebce77fb78d8/devkittelemetry-linux-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/4049a66147717a53860bbc969bf32faa/devkittelemetry-linux-musl-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/c75e84ff813be5c9833d96dc2066a364/devkittelemetry-linux-musl-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/f58cf629939f0df77d142be881f9e233/devkittelemetry-linux-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/1c912419ea45c8d95cfa28a8a04640dc/devkittelemetry-osx-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/36545ba0998f1fc380e877e38b2f35f1/devkittelemetry-osx-x64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/0a32698e8ba1ab93489d79f34f8ae8d0/devkittelemetry-platformagnostic-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/4f16ff826fedd33ad80d265c5409588b/devkittelemetry-win-arm64-7.0.0-preview.24178.4.zip,https://download.visualstudio.microsoft.com/download/pr/534f8426-a4f4-4b2d-b3ba-c4e16a38c48c/5a98d8f4e481dbb7ae3cdb3695b75c46/devkittelemetry-win-x64-7.0.0-preview.24178.4.zip",
"NEW_DEPS_VERSION": "7.0.0-preview.24178.4",
Expand All @@ -219,17 +219,17 @@
"request": "launch",
"name": "Generate debugger options schema",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/debugger/generateOptionsSchema.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/debugger/generateOptionsSchema.ts",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Razor Cohost integration tests",
"preLaunchTask": "build",
"program": "${workspaceFolder}/node_modules/ts-node/dist/bin.js",
"args": ["tasks/tests/testIntegrationRazorCohost.ts"],
"runtimeArgs": ["--import", "tsx"],
"program": "${workspaceFolder}/tasks/tests/testIntegrationRazorCohost.ts",
"cwd": "${workspaceFolder}"
}
],
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ package-lock.json
tsconfig.json
version.json
wallaby.js
esbuild.js
esbuild.mjs
!src/razor/language-configuration.json
!src/razor/syntaxes/*

Expand Down
31 changes: 31 additions & 0 deletions baseJestConfig.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { readFileSync } from 'node:fs';
import { createDefaultEsmPreset, createDefaultPreset } from 'ts-jest';

const packageJson = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
// The override lets tooling validate the ESM transform before the repository package type changes.
const useESM = packageJson.type === 'module' || process.env.JEST_USE_ESM === 'true';
const tsJestPreset = useESM
? createDefaultEsmPreset({ tsconfig: './tsconfig.json' })
: createDefaultPreset({ tsconfig: './tsconfig.json' });

/**
* Defines a base project config that we can re-use across the project specific jest configs.
* We do this because jest generally does not inherit project configuration settings.
*/
/** @type {import('jest').Config} */
export const baseProjectConfig = {
...tsJestPreset,
testEnvironment: 'node',
transformIgnorePatterns: ['/dist/.+\\.js'],
...(useESM
? {
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
}
: {}),
};
15 changes: 0 additions & 15 deletions baseJestConfig.ts

This file was deleted.

12 changes: 5 additions & 7 deletions esbuild.js → esbuild.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const esbuild = require("esbuild");
const fs = require('fs/promises');
import esbuild from 'esbuild';
import fs from 'node:fs/promises';

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');
Expand Down Expand Up @@ -44,9 +44,7 @@ const umdEsmLoaderPlugin = {

async function main() {
const ctx = await esbuild.context({
entryPoints: [
'src/main.ts'
],
entryPoints: ['src/main.ts'],
bundle: true,
format: 'esm',
banner: {
Expand Down Expand Up @@ -81,7 +79,7 @@ async function main() {
}
}

main().catch(e => {
main().catch((e) => {
console.error(e);
process.exit(1);
});
});
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const compatibleHeaderPlugin = fixupPluginRules({

export default defineConfig([
{
ignores: ['out/**', 'dist/**', 'wallaby.js', 'eslint.config.mjs', 'esbuild.js', '**/*.d.ts'],
ignores: ['out/**', 'dist/**', 'wallaby.js', 'eslint.config.mjs', 'esbuild.mjs', '**/*.d.ts'],
},
{
files: ['**/*.ts'],
Expand Down
23 changes: 11 additions & 12 deletions jest.config.ts → jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { Config } from 'jest';

const config: Config = {
/** @type {import('jest').Config} */
const config = {
projects: [
'<rootDir>/test/lsptoolshost/artifactTests/jest.config.ts',
'<rootDir>/test/lsptoolshost/integrationTests/jest.config.ts',
'<rootDir>/test/lsptoolshost/unitTests/jest.config.ts',
'<rootDir>/test/omnisharp/omnisharpIntegrationTests/jest.config.ts',
'<rootDir>/test/omnisharp/omnisharpUnitTests/jest.config.ts',
'<rootDir>/test/razor/razorIntegrationTests/jest.config.ts',
'<rootDir>/test/razor/razorTests/jest.config.ts',
'<rootDir>/test/untrustedWorkspace/integrationTests/jest.config.ts',
'<rootDir>/test/tasks/jest.config.ts',
'<rootDir>/test/lsptoolshost/artifactTests/jest.config.mjs',
'<rootDir>/test/lsptoolshost/integrationTests/jest.config.mjs',
'<rootDir>/test/lsptoolshost/unitTests/jest.config.mjs',
'<rootDir>/test/omnisharp/omnisharpIntegrationTests/jest.config.mjs',
'<rootDir>/test/omnisharp/omnisharpUnitTests/jest.config.mjs',
'<rootDir>/test/razor/razorIntegrationTests/jest.config.mjs',
'<rootDir>/test/razor/razorTests/jest.config.mjs',
'<rootDir>/test/untrustedWorkspace/integrationTests/jest.config.mjs',
'<rootDir>/test/tasks/jest.config.mjs',
],
// Reporters are a global jest configuration property and cannot be set in the project jest config.
// This configuration will create a 'junit.xml' file in the output directory, no matter which test project is running.
Expand Down
Loading