From 42554d4d3c38bd10ffc03258c494909e595cc5e1 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Wed, 29 May 2024 17:08:59 +0200 Subject: [PATCH 01/15] Transform generated project to npm workspace - Align template structure with target structure - Integrate a global tsconfig.build.json - Unify how build and compile is done - Make cli, web and extension compile again --- packages/generator-langium/src/index.ts | 181 +++++++++++------- .../templates/{core => }/.eslintrc.json | 0 .../{core => }/.vscode/extensions.json | 0 .../{vscode => }/.vscode/launch.json | 0 .../templates/{core => }/.vscode/tasks.json | 0 .../templates/cli/.package.json | 17 -- .../templates/core/.package.json | 32 ---- .../templates/core/langium-config.json | 12 -- .../templates/core/tsconfig.json | 24 --- .../generator-langium/templates/package.json | 34 ++++ .../templates/{ => packages}/cli/bin/cli.js | 0 .../templates/packages/cli/package.json | 31 +++ .../src/cli => packages/cli/src}/cli-util.ts | 0 .../src/cli => packages/cli/src}/generator.ts | 2 +- .../{cli/src/cli => packages/cli/src}/main.ts | 5 +- .../templates/packages/cli/tsconfig.json | 16 ++ .../extension}/.vscodeignore | 0 .../extension}/esbuild.mjs | 0 .../extension}/language-configuration.json | 0 .../extension/package.json} | 8 +- .../extension}/src/extension/main.ts | 0 .../extension}/src/language/main.ts | 2 +- .../packages/extension/tsconfig.json | 15 ++ .../language}/.vscode-extensions.json | 3 +- .../language}/langium-config.json | 4 +- .../language}/langium-quickstart.md | 0 .../templates/packages/language/package.json | 44 +++++ .../templates/packages/language/src/index.ts | 6 + .../language/src}/language-id-module.ts | 0 .../language/src}/language-id-validator.ts | 0 .../language/src}/language-id.langium | 0 .../language}/test/linking/linking.test.ts | 3 +- .../language}/test/parsing/parsing.test.ts | 3 +- .../test/validating/validating.test.ts | 3 +- .../templates/packages/language/tsconfig.json | 12 ++ .../packages/language/tsconfig.src.json | 12 ++ .../packages/language/tsconfig.test.json | 14 ++ .../language}/vitest.config.ts | 6 - .../templates/{ => packages}/web/index.html | 0 .../web/language-configuration.json | 0 .../templates/packages/web/package.json | 37 ++++ .../web/src}/main-browser.ts | 4 +- .../{ => packages}/web/src/setupClassic.ts | 17 +- .../{ => packages}/web/src/setupCommon.ts | 3 +- .../{ => packages}/web/src/setupExtended.ts | 11 +- .../web/static/monacoClassic.html | 0 .../web/static/monacoExtended.html | 0 .../{ => packages}/web/static/styles.css | 0 .../templates/packages/web/tsconfig.json | 17 ++ .../{ => packages}/web/vite.config.ts | 0 .../templates/test/.package.json | 8 - .../templates/test/.tsconfig.json | 11 -- .../templates/test/tsconfig.src.json | 11 -- .../templates/tsconfig.build.json | 10 + .../templates/{web => }/tsconfig.json | 19 +- .../templates/web/.package.json | 23 --- 56 files changed, 410 insertions(+), 250 deletions(-) rename packages/generator-langium/templates/{core => }/.eslintrc.json (100%) rename packages/generator-langium/templates/{core => }/.vscode/extensions.json (100%) rename packages/generator-langium/templates/{vscode => }/.vscode/launch.json (100%) rename packages/generator-langium/templates/{core => }/.vscode/tasks.json (100%) delete mode 100644 packages/generator-langium/templates/cli/.package.json delete mode 100644 packages/generator-langium/templates/core/.package.json delete mode 100644 packages/generator-langium/templates/core/langium-config.json delete mode 100644 packages/generator-langium/templates/core/tsconfig.json create mode 100644 packages/generator-langium/templates/package.json rename packages/generator-langium/templates/{ => packages}/cli/bin/cli.js (100%) create mode 100644 packages/generator-langium/templates/packages/cli/package.json rename packages/generator-langium/templates/{cli/src/cli => packages/cli/src}/cli-util.ts (100%) rename packages/generator-langium/templates/{cli/src/cli => packages/cli/src}/generator.ts (93%) rename packages/generator-langium/templates/{cli/src/cli => packages/cli/src}/main.ts (87%) create mode 100644 packages/generator-langium/templates/packages/cli/tsconfig.json rename packages/generator-langium/templates/{vscode => packages/extension}/.vscodeignore (100%) rename packages/generator-langium/templates/{vscode => packages/extension}/esbuild.mjs (100%) rename packages/generator-langium/templates/{vscode => packages/extension}/language-configuration.json (100%) rename packages/generator-langium/templates/{vscode/.package.json => packages/extension/package.json} (79%) rename packages/generator-langium/templates/{vscode => packages/extension}/src/extension/main.ts (100%) rename packages/generator-langium/templates/{vscode => packages/extension}/src/language/main.ts (85%) create mode 100644 packages/generator-langium/templates/packages/extension/tsconfig.json rename packages/generator-langium/templates/{test => packages/language}/.vscode-extensions.json (81%) rename packages/generator-langium/templates/{web => packages/language}/langium-config.json (78%) rename packages/generator-langium/templates/{core => packages/language}/langium-quickstart.md (100%) create mode 100644 packages/generator-langium/templates/packages/language/package.json create mode 100644 packages/generator-langium/templates/packages/language/src/index.ts rename packages/generator-langium/templates/{core/src/language => packages/language/src}/language-id-module.ts (100%) rename packages/generator-langium/templates/{core/src/language => packages/language/src}/language-id-validator.ts (100%) rename packages/generator-langium/templates/{core/src/language => packages/language/src}/language-id.langium (100%) rename packages/generator-langium/templates/{test => packages/language}/test/linking/linking.test.ts (92%) rename packages/generator-langium/templates/{test => packages/language}/test/parsing/parsing.test.ts (93%) rename packages/generator-langium/templates/{test => packages/language}/test/validating/validating.test.ts (94%) create mode 100644 packages/generator-langium/templates/packages/language/tsconfig.json create mode 100644 packages/generator-langium/templates/packages/language/tsconfig.src.json create mode 100644 packages/generator-langium/templates/packages/language/tsconfig.test.json rename packages/generator-langium/templates/{test => packages/language}/vitest.config.ts (63%) rename packages/generator-langium/templates/{ => packages}/web/index.html (100%) rename packages/generator-langium/templates/{ => packages}/web/language-configuration.json (100%) create mode 100644 packages/generator-langium/templates/packages/web/package.json rename packages/generator-langium/templates/{web/src/language => packages/web/src}/main-browser.ts (82%) rename packages/generator-langium/templates/{ => packages}/web/src/setupClassic.ts (62%) rename packages/generator-langium/templates/{ => packages}/web/src/setupCommon.ts (91%) rename packages/generator-langium/templates/{ => packages}/web/src/setupExtended.ts (86%) rename packages/generator-langium/templates/{ => packages}/web/static/monacoClassic.html (100%) rename packages/generator-langium/templates/{ => packages}/web/static/monacoExtended.html (100%) rename packages/generator-langium/templates/{ => packages}/web/static/styles.css (100%) create mode 100644 packages/generator-langium/templates/packages/web/tsconfig.json rename packages/generator-langium/templates/{ => packages}/web/vite.config.ts (100%) delete mode 100644 packages/generator-langium/templates/test/.package.json delete mode 100644 packages/generator-langium/templates/test/.tsconfig.json delete mode 100644 packages/generator-langium/templates/test/tsconfig.src.json create mode 100644 packages/generator-langium/templates/tsconfig.build.json rename packages/generator-langium/templates/{web => }/tsconfig.json (53%) delete mode 100644 packages/generator-langium/templates/web/.package.json diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index 932f46135..6b41c889d 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -15,18 +15,18 @@ import * as url from 'node:url'; const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); -const TEMPLATE_CORE_DIR = '../templates/core'; -const TEMPLATE_VSCODE_DIR = '../templates/vscode'; -const TEMPLATE_CLI_DIR = '../templates/cli'; -const TEMPLATE_WEB_DIR = '../templates/web'; -const TEMPLATE_TEST_DIR = '../templates/test'; +const BASE_DIR = '../templates'; +const PACKAGE_LANGUAGE = 'packages/language'; +const PACKAGE_CLI = 'packages/cli'; +const PACKAGE_WEB = 'packages/web'; +const PACKAGE_EXTENSION = 'packages/extension'; +// const TEMPLATE_TEST_DIR = '../templates/packages/language/test'; const USER_DIR = '.'; const EXTENSION_NAME = /<%= extension-name %>/g; const RAW_LANGUAGE_NAME = /<%= RawLanguageName %>/g; const FILE_EXTENSION = /"?<%= file-extension %>"?/g; const FILE_EXTENSION_GLOB = /<%= file-glob-extension %>/g; -const TSCONFIG_BASE_NAME = /<%= tsconfig %>/g; const LANGUAGE_NAME = /<%= LanguageName %>/g; const LANGUAGE_ID = /<%= language-id %>/g; @@ -171,96 +171,147 @@ export class LangiumGenerator extends Generator { ); const languageId = _.kebabCase(this.answers.rawLanguageName); - const referencedTsconfigBaseName = this.answers.includeTest ? 'tsconfig.src.json' : 'tsconfig.json'; const templateCopyOptions: CopyOptions = { - process: content => this._replaceTemplateWords(fileExtensionGlob, languageName, languageId, referencedTsconfigBaseName, content), + process: content => this._replaceTemplateWords(fileExtensionGlob, languageName, languageId, content), processDestinationPath: path => this._replaceTemplateNames(languageId, path) }; - this.sourceRoot(path.join(__dirname, TEMPLATE_CORE_DIR)); - const pkgJson = this.fs.readJSON(path.join(this.sourceRoot(), '.package.json')); - this.fs.extendJSON(this._extensionPath('package-template.json'), pkgJson, undefined, 4); - - for (const path of ['.', '.vscode', '.eslintrc.json']) { + const pathBase = path.join(__dirname, BASE_DIR); + this.sourceRoot(pathBase); + const mainPackageJson = this.fs.readJSON(path.join(this.sourceRoot(), 'package.json')); + + const baseFiles = [ + '.eslintrc.json', + 'tsconfig.json', + 'tsconfig.build.json', + '.vscode' + ]; + for (const path of baseFiles) { this.fs.copy( this.templatePath(path), this._extensionPath(path), templateCopyOptions ); } - // .gitignore files don't get published to npm, so we need to copy it under a different name - this.fs.copy(this.templatePath('../gitignore.txt'), this._extensionPath('.gitignore')); + this.fs.copy(this.templatePath('gitignore.txt'), this._extensionPath('.gitignore')); + + this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_LANGUAGE}`)); + // omit .vscode-extensions.json for now + const languageFiles = [ + 'package.json', + 'langium-config.json', + 'langium-quickstart.md', + 'tsconfig.json', + 'tsconfig.src.json', + 'tsconfig.test.json', + 'vitest.config.ts', + 'src', + 'test' + ]; + for (const path of languageFiles) { + this.fs.copy( + this.templatePath(path), + this._extensionPath(`${PACKAGE_LANGUAGE}/${path}`), + templateCopyOptions + ); + } - if (this.answers.includeVSCode) { - this.sourceRoot(path.join(__dirname, TEMPLATE_VSCODE_DIR)); - const pkgJson = this.fs.readJSON(path.join(this.sourceRoot(), '.package.json')); - this.fs.extendJSON(this._extensionPath('package-template.json'), pkgJson, undefined, 4); - this.sourceRoot(path.join(__dirname, TEMPLATE_VSCODE_DIR)); - for (const path of ['.', '.vscode', '.vscodeignore']) { + if (this.answers.includeCLI) { + this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_CLI}`)); + const cliFiles = [ + 'package.json', + 'tsconfig.json', + 'bin', + 'src' + ]; + for (const path of cliFiles) { this.fs.copy( this.templatePath(path), - this._extensionPath(path), + this._extensionPath(`${PACKAGE_CLI}/${path}`), templateCopyOptions ); } + mainPackageJson.workspaces.push('packages/cli'); } - if (this.answers.includeCLI) { - this.sourceRoot(path.join(__dirname, TEMPLATE_CLI_DIR)); - const pkgJson = this.fs.readJSON(path.join(this.sourceRoot(), '.package.json')); - this.fs.extendJSON(this._extensionPath('package-template.json'),pkgJson, undefined, 4); - for (const path of ['.']) { + if (this.answers.includeWeb) { + this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_WEB}`)); + const webFiles = [ + 'package.json', + 'language-configuration.json', + 'tsconfig.json', + 'index.html', + 'vite.config.ts', + 'src', + 'static' + ]; + for (const path of webFiles) { this.fs.copy( this.templatePath(path), - this._extensionPath(path), + this._extensionPath(`${PACKAGE_WEB}/${path}`), templateCopyOptions ); } + mainPackageJson.workspaces.push('packages/web'); } - if (this.answers.includeWeb) { - this.sourceRoot(path.join(__dirname, TEMPLATE_WEB_DIR)); - const pkgJson = this.fs.readJSON(path.join(this.sourceRoot(), '.package.json')); - this.fs.extendJSON(this._extensionPath('package-template.json'), pkgJson, undefined, 4); - this.sourceRoot(path.join(__dirname, TEMPLATE_WEB_DIR)); - for (const path of ['.']) { + if (this.answers.includeVSCode) { + this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_EXTENSION}`)); + const extensionFiles = [ + '.vscodeignore', + 'esbuild.mjs', + 'language-configuration.json', + 'package.json', + 'tsconfig.json', + 'src' + ]; + for (const path of extensionFiles) { this.fs.copy( this.templatePath(path), - this._extensionPath(path), + this._extensionPath(`${PACKAGE_EXTENSION}/${path}`), templateCopyOptions ); } + mainPackageJson.workspaces.push('packages/extension'); } - if (this.answers.includeTest) { - this.sourceRoot(path.join(__dirname, TEMPLATE_TEST_DIR)); - - this.fs.copy( - this.templatePath('.'), - this._extensionPath(), - templateCopyOptions - ); - - // update the scripts section in the package.json to use 'tsconfig.src.json' for building - const pkgJson = this.fs.readJSON(this.templatePath('.package.json')); - this.fs.extendJSON(this._extensionPath('package-template.json'), pkgJson, undefined, 4); - - // update the 'includes' property in the existing 'tsconfig.json' and adds '"noEmit": true' - const tsconfigJson = this.fs.readJSON(this.templatePath('.tsconfig.json')); - this.fs.extendJSON(this._extensionPath('tsconfig.json'), tsconfigJson, undefined, 4); - - // the initial '.vscode/extensions.json' can't be extended as above, as it contains comments, which is tolerated by vscode, - // but not by `this.fs.extendJSON(...)`, so - this.fs.copy(this.templatePath('.vscode-extensions.json'), this._extensionPath('.vscode/extensions.json'), templateCopyOptions); - } - + this.fs.writeJSON(this._extensionPath('.package.json'), mainPackageJson, undefined, 4); this.fs.copy( - this._extensionPath('package-template.json'), + this._extensionPath('.package.json'), this._extensionPath('package.json'), templateCopyOptions ); - this.fs.delete(this._extensionPath('package-template.json')); + this.fs.delete(this._extensionPath('.package.json')); + + // if (this.answers.includeTest) { + // this.sourceRoot(path.join(__dirname, TEMPLATE_TEST_DIR)); + + // this.fs.copy( + // this.templatePath('.'), + // this._extensionPath(), + // templateCopyOptions + // ); + + // // update the scripts section in the package.json to use 'tsconfig.src.json' for building + // const pkgJson = this.fs.readJSON(this.templatePath('.package.json')); + // this.fs.extendJSON(this._extensionPath('package-template.json'), pkgJson, undefined, 4); + + // // update the 'includes' property in the existing 'tsconfig.json' and adds '"noEmit": true' + // const tsconfigJson = this.fs.readJSON(this.templatePath('.tsconfig.json')); + // this.fs.extendJSON(this._extensionPath('tsconfig.json'), tsconfigJson, undefined, 4); + + // // the initial '.vscode/extensions.json' can't be extended as above, as it contains comments, which is tolerated by vscode, + // // but not by `this.fs.extendJSON(...)`, so + // this.fs.copy(this.templatePath('.vscode-extensions.json'), this._extensionPath('.vscode/extensions.json'), templateCopyOptions); + // } + + // this.fs.copy( + // this._extensionPath('package-template.json'), + // this._extensionPath('package.json'), + // templateCopyOptions + // ); + // this.fs.delete(this._extensionPath('package-template.json')); } async install(): Promise { @@ -271,14 +322,7 @@ export class LangiumGenerator extends Generator { this.spawnSync('npm', ['install'], opts); } this.spawnSync('npm', ['run', 'langium:generate'], opts); - - if (this.answers.includeVSCode || this.answers.includeCLI) { - this.spawnSync('npm', ['run', 'build'], opts); - } - - if (this.answers.includeWeb) { - this.spawnSync('npm', ['run', 'build:web'], opts); - } + this.spawnSync('npm', ['run', 'build'], opts); } async end(): Promise { @@ -310,7 +354,7 @@ export class LangiumGenerator extends Generator { return this.destinationPath(USER_DIR, this.answers.extensionName, ...path); } - _replaceTemplateWords(fileExtensionGlob: string, languageName: string, languageId: string, tsconfigBaseName: string, content: string | Buffer): string { + _replaceTemplateWords(fileExtensionGlob: string, languageName: string, languageId: string, content: string | Buffer): string { return content.toString() .replace(EXTENSION_NAME, this.answers.extensionName) .replace(RAW_LANGUAGE_NAME, this.answers.rawLanguageName) @@ -318,7 +362,6 @@ export class LangiumGenerator extends Generator { .replace(FILE_EXTENSION_GLOB, fileExtensionGlob) .replace(LANGUAGE_NAME, languageName) .replace(LANGUAGE_ID, languageId) - .replace(TSCONFIG_BASE_NAME, tsconfigBaseName) .replace(NEWLINES, EOL); } diff --git a/packages/generator-langium/templates/core/.eslintrc.json b/packages/generator-langium/templates/.eslintrc.json similarity index 100% rename from packages/generator-langium/templates/core/.eslintrc.json rename to packages/generator-langium/templates/.eslintrc.json diff --git a/packages/generator-langium/templates/core/.vscode/extensions.json b/packages/generator-langium/templates/.vscode/extensions.json similarity index 100% rename from packages/generator-langium/templates/core/.vscode/extensions.json rename to packages/generator-langium/templates/.vscode/extensions.json diff --git a/packages/generator-langium/templates/vscode/.vscode/launch.json b/packages/generator-langium/templates/.vscode/launch.json similarity index 100% rename from packages/generator-langium/templates/vscode/.vscode/launch.json rename to packages/generator-langium/templates/.vscode/launch.json diff --git a/packages/generator-langium/templates/core/.vscode/tasks.json b/packages/generator-langium/templates/.vscode/tasks.json similarity index 100% rename from packages/generator-langium/templates/core/.vscode/tasks.json rename to packages/generator-langium/templates/.vscode/tasks.json diff --git a/packages/generator-langium/templates/cli/.package.json b/packages/generator-langium/templates/cli/.package.json deleted file mode 100644 index 1317bf0ca..000000000 --- a/packages/generator-langium/templates/cli/.package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "engines": { - "node": ">=18.0.0" - }, - "files": [ - "bin", - "out", - "src" - ], - "bin": { - "<%= language-id %>-cli": "./bin/cli.js" - }, - "dependencies": { - "chalk": "~5.3.0", - "commander": "~11.0.0" - } -} diff --git a/packages/generator-langium/templates/core/.package.json b/packages/generator-langium/templates/core/.package.json deleted file mode 100644 index e0ca0525d..000000000 --- a/packages/generator-langium/templates/core/.package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "<%= extension-name %>", - "description": "Please enter a brief description here", - "version": "0.0.1", - "files": [ - "out", - "src" - ], - "type": "module", - "scripts": { - "build": "tsc -b <%= tsconfig %>", - "watch": "tsc -b <%= tsconfig %> --watch", - "lint": "eslint src --ext ts", - "langium:generate": "langium generate", - "langium:watch": "langium generate --watch" - }, - "dependencies": { - "langium": "~3.1.2" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "@typescript-eslint/parser": "~7.3.1", - "@typescript-eslint/eslint-plugin": "~7.3.1", - "eslint": "~8.57.0", - "langium-cli": "~3.1.0", - "typescript": "~5.1.6" - }, - "volta": { - "node": "18.19.1", - "npm": "10.2.4" - } -} diff --git a/packages/generator-langium/templates/core/langium-config.json b/packages/generator-langium/templates/core/langium-config.json deleted file mode 100644 index f65bd3fd9..000000000 --- a/packages/generator-langium/templates/core/langium-config.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "projectName": "<%= LanguageName %>", - "languages": [{ - "id": "<%= language-id %>", - "grammar": "src/language/<%= language-id %>.langium", - "fileExtensions": <%= file-extension %>, - "textMate": { - "out": "syntaxes/<%= language-id %>.tmLanguage.json" - } - }], - "out": "src/language/generated" -} diff --git a/packages/generator-langium/templates/core/tsconfig.json b/packages/generator-langium/templates/core/tsconfig.json deleted file mode 100644 index 91e8763e4..000000000 --- a/packages/generator-langium/templates/core/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2017", - "module": "Node16", - "lib": ["ESNext"], - "sourceMap": true, - "outDir": "out", - "strict": true, - "noUnusedLocals": true, - "noImplicitReturns": true, - "noImplicitOverride": true, - "moduleResolution": "Node16", - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "out", - "node_modules" - ] -} diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json new file mode 100644 index 000000000..66f6ed10a --- /dev/null +++ b/packages/generator-langium/templates/package.json @@ -0,0 +1,34 @@ +{ + "name": "<%= extension-name %>", + "description": "Base workspace package", + "version": "0.0.1", + "type": "module", + "private": true, + "files": [ + "out", + "src" + ], + "scripts": { + "compile": "tsc -b tsconfig.build.json", + "watch": "tsc -b tsconfig.build.json --watch", + "build": "npm run compile && npm run build --workspaces", + "lint": "eslint src --ext ts", + "langium:generate": "npm run --workspace packages/language langium:generate", + "langium:watch": "npm run --workspace packages/language langium:watch", + "test": "vitest run" + }, + "devDependencies": { + "@types/node": "^18.0.0", + "@typescript-eslint/parser": "~7.11.0", + "@typescript-eslint/eslint-plugin": "~7.11.0", + "eslint": "~8.57.0", + "typescript": "~5.4.5" + }, + "volta": { + "node": "18.20.3", + "npm": "10.7.0" + }, + "workspaces": [ + "packages/language" + ] +} diff --git a/packages/generator-langium/templates/cli/bin/cli.js b/packages/generator-langium/templates/packages/cli/bin/cli.js similarity index 100% rename from packages/generator-langium/templates/cli/bin/cli.js rename to packages/generator-langium/templates/packages/cli/bin/cli.js diff --git a/packages/generator-langium/templates/packages/cli/package.json b/packages/generator-langium/templates/packages/cli/package.json new file mode 100644 index 000000000..37787fc10 --- /dev/null +++ b/packages/generator-langium/templates/packages/cli/package.json @@ -0,0 +1,31 @@ +{ + "name": "<%= extension-name %>-cli", + "description": "The cli specific package", + "version": "0.0.1", + "type": "module", + "engines": { + "node": ">=18.0.0" + }, + "files": [ + "bin", + "out", + "src" + ], + "bin": { + "<%= language-id %>-cli": "./bin/cli.js" + }, + "scripts": { + "build": "echo 'No build step'" + }, + "dependencies": { + "<%= extension-name %>-language": "0.0.1", + "chalk": "~5.3.0", + "commander": "~11.0.0" + }, + "devDependencies": { + }, + "volta": { + "node": "18.20.3", + "npm": "10.7.0" + } +} diff --git a/packages/generator-langium/templates/cli/src/cli/cli-util.ts b/packages/generator-langium/templates/packages/cli/src/cli-util.ts similarity index 100% rename from packages/generator-langium/templates/cli/src/cli/cli-util.ts rename to packages/generator-langium/templates/packages/cli/src/cli-util.ts diff --git a/packages/generator-langium/templates/cli/src/cli/generator.ts b/packages/generator-langium/templates/packages/cli/src/generator.ts similarity index 93% rename from packages/generator-langium/templates/cli/src/cli/generator.ts rename to packages/generator-langium/templates/packages/cli/src/generator.ts index 93036c17f..fe6c8f973 100644 --- a/packages/generator-langium/templates/cli/src/cli/generator.ts +++ b/packages/generator-langium/templates/packages/cli/src/generator.ts @@ -1,4 +1,4 @@ -import type { Model } from '../language/generated/ast.js'; +import type { Model } from '<%= language-id %>-language'; import { expandToNode, joinToNode, toString } from 'langium/generate'; import * as fs from 'node:fs'; import * as path from 'node:path'; diff --git a/packages/generator-langium/templates/cli/src/cli/main.ts b/packages/generator-langium/templates/packages/cli/src/main.ts similarity index 87% rename from packages/generator-langium/templates/cli/src/cli/main.ts rename to packages/generator-langium/templates/packages/cli/src/main.ts index 996c9b481..4dbd61697 100644 --- a/packages/generator-langium/templates/cli/src/cli/main.ts +++ b/packages/generator-langium/templates/packages/cli/src/main.ts @@ -1,8 +1,7 @@ -import type { Model } from '../language/generated/ast.js'; +import type { Model } from '<%= language-id %>-language'; +import { create<%= LanguageName %>Services, <%= LanguageName %>LanguageMetaData } from '<%= language-id %>-language'; import chalk from 'chalk'; import { Command } from 'commander'; -import { <%= LanguageName %>LanguageMetaData } from '../language/generated/module.js'; -import { create<%= LanguageName %>Services } from '../language/<%= language-id %>-module.js'; import { extractAstNode } from './cli-util.js'; import { generateJavaScript } from './generator.js'; import { NodeFileSystem } from 'langium/node'; diff --git a/packages/generator-langium/templates/packages/cli/tsconfig.json b/packages/generator-langium/templates/packages/cli/tsconfig.json new file mode 100644 index 000000000..eee8bb916 --- /dev/null +++ b/packages/generator-langium/templates/packages/cli/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "out", + "declarationDir": "out" + }, + "references": [ + { + "path": "../language/tsconfig.src.json" + } + ], + "include": [ + "src/**/*.ts" + ] +} diff --git a/packages/generator-langium/templates/vscode/.vscodeignore b/packages/generator-langium/templates/packages/extension/.vscodeignore similarity index 100% rename from packages/generator-langium/templates/vscode/.vscodeignore rename to packages/generator-langium/templates/packages/extension/.vscodeignore diff --git a/packages/generator-langium/templates/vscode/esbuild.mjs b/packages/generator-langium/templates/packages/extension/esbuild.mjs similarity index 100% rename from packages/generator-langium/templates/vscode/esbuild.mjs rename to packages/generator-langium/templates/packages/extension/esbuild.mjs diff --git a/packages/generator-langium/templates/vscode/language-configuration.json b/packages/generator-langium/templates/packages/extension/language-configuration.json similarity index 100% rename from packages/generator-langium/templates/vscode/language-configuration.json rename to packages/generator-langium/templates/packages/extension/language-configuration.json diff --git a/packages/generator-langium/templates/vscode/.package.json b/packages/generator-langium/templates/packages/extension/package.json similarity index 79% rename from packages/generator-langium/templates/vscode/.package.json rename to packages/generator-langium/templates/packages/extension/package.json index b6a438fb5..a7b91a12d 100644 --- a/packages/generator-langium/templates/vscode/.package.json +++ b/packages/generator-langium/templates/packages/extension/package.json @@ -1,4 +1,7 @@ { + "name": "<%= extension-name %>-extension", + "description": "The extension specific package", + "version": "0.0.1", "displayName": "<%= extension-name %>", "engines": { "vscode": "^1.67.0" @@ -25,10 +28,11 @@ "main": "./out/extension/main.cjs", "scripts": { "vscode:prepublish": "npm run build && npm run lint", - "build": "tsc -b <%= tsconfig %> && node esbuild.mjs", - "watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b <%= tsconfig %> --watch\" \"node esbuild.mjs --watch\"" + "build": "tsc -b tsconfig.json && node esbuild.mjs", + "watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.json --watch\" \"node esbuild.mjs --watch\"" }, "dependencies": { + "<%= extension-name %>-language": "0.0.1", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" }, diff --git a/packages/generator-langium/templates/vscode/src/extension/main.ts b/packages/generator-langium/templates/packages/extension/src/extension/main.ts similarity index 100% rename from packages/generator-langium/templates/vscode/src/extension/main.ts rename to packages/generator-langium/templates/packages/extension/src/extension/main.ts diff --git a/packages/generator-langium/templates/vscode/src/language/main.ts b/packages/generator-langium/templates/packages/extension/src/language/main.ts similarity index 85% rename from packages/generator-langium/templates/vscode/src/language/main.ts rename to packages/generator-langium/templates/packages/extension/src/language/main.ts index 90f7d48eb..bc3c5b5dc 100644 --- a/packages/generator-langium/templates/vscode/src/language/main.ts +++ b/packages/generator-langium/templates/packages/extension/src/language/main.ts @@ -1,7 +1,7 @@ import { startLanguageServer } from 'langium/lsp'; import { NodeFileSystem } from 'langium/node'; import { createConnection, ProposedFeatures } from 'vscode-languageserver/node.js'; -import { create<%= LanguageName %>Services } from './<%= language-id %>-module.js'; +import { create<%= LanguageName %>Services } from '<%= language-id %>-language'; // Create a connection to the client const connection = createConnection(ProposedFeatures.all); diff --git a/packages/generator-langium/templates/packages/extension/tsconfig.json b/packages/generator-langium/templates/packages/extension/tsconfig.json new file mode 100644 index 000000000..b9db194e8 --- /dev/null +++ b/packages/generator-langium/templates/packages/extension/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "noEmit": true, + "rootDir": "." + }, + "references": [ + { + "path": "../language/tsconfig.src.json" + } + ], + "include": [ + "src/**/*.ts" + ] +} diff --git a/packages/generator-langium/templates/test/.vscode-extensions.json b/packages/generator-langium/templates/packages/language/.vscode-extensions.json similarity index 81% rename from packages/generator-langium/templates/test/.vscode-extensions.json rename to packages/generator-langium/templates/packages/language/.vscode-extensions.json index 1252a6cd7..7f73a0a33 100644 --- a/packages/generator-langium/templates/test/.vscode-extensions.json +++ b/packages/generator-langium/templates/packages/language/.vscode-extensions.json @@ -5,7 +5,6 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ "langium.langium-vscode", - "ZixuanChen.vitest-explorer", - "kingwl.vscode-vitest-runner" + "vitest.explorer" ] } diff --git a/packages/generator-langium/templates/web/langium-config.json b/packages/generator-langium/templates/packages/language/langium-config.json similarity index 78% rename from packages/generator-langium/templates/web/langium-config.json rename to packages/generator-langium/templates/packages/language/langium-config.json index aef528417..8326d9efe 100644 --- a/packages/generator-langium/templates/web/langium-config.json +++ b/packages/generator-langium/templates/packages/language/langium-config.json @@ -2,7 +2,7 @@ "projectName": "<%= LanguageName %>", "languages": [{ "id": "<%= language-id %>", - "grammar": "src/language/<%= language-id %>.langium", + "grammar": "src/<%= language-id %>.langium", "fileExtensions": <%= file-extension %>, "textMate": { "out": "syntaxes/<%= language-id %>.tmLanguage.json" @@ -11,5 +11,5 @@ "out": "src/syntaxes/<%= language-id %>.monarch.ts" } }], - "out": "src/language/generated" + "out": "src/generated" } diff --git a/packages/generator-langium/templates/core/langium-quickstart.md b/packages/generator-langium/templates/packages/language/langium-quickstart.md similarity index 100% rename from packages/generator-langium/templates/core/langium-quickstart.md rename to packages/generator-langium/templates/packages/language/langium-quickstart.md diff --git a/packages/generator-langium/templates/packages/language/package.json b/packages/generator-langium/templates/packages/language/package.json new file mode 100644 index 000000000..1016b0aa8 --- /dev/null +++ b/packages/generator-langium/templates/packages/language/package.json @@ -0,0 +1,44 @@ +{ + "name": "<%= extension-name %>-language", + "description": "The language specific package", + "version": "0.0.1", + "type": "module", + "engines": { + "node": ">=18.0.0" + }, + "files": [ + "out", + "src" + ], + "main": "./out/index.js", + "module": "./out/index.js", + "exports": { + ".": { + "types": "./out/index.d.ts", + "default": "./out/index.js" + } + }, + "typesVersions": { + "*": { + ".": [ + "out/index" + ] + } + }, + "scripts": { + "build": "echo 'No build step'", + "langium:generate": "langium generate", + "langium:watch": "langium generate --watch" + }, + "dependencies": { + "langium": "~3.0.0" + }, + "devDependencies": { + "langium-cli": "~3.0.3", + "vitest": "~1.6.0" + }, + "volta": { + "node": "18.20.3", + "npm": "10.7.0" + } +} diff --git a/packages/generator-langium/templates/packages/language/src/index.ts b/packages/generator-langium/templates/packages/language/src/index.ts new file mode 100644 index 000000000..32a299ef0 --- /dev/null +++ b/packages/generator-langium/templates/packages/language/src/index.ts @@ -0,0 +1,6 @@ +export * from './<%= language-id %>-module.js'; +export * from './<%= language-id %>-validator.js'; +export * from './generated/ast.js'; +export * from './generated/grammar.js'; +export * from './generated/module.js'; +export { default as monarchSyntax } from './syntaxes/<%= language-id %>.monarch.js'; diff --git a/packages/generator-langium/templates/core/src/language/language-id-module.ts b/packages/generator-langium/templates/packages/language/src/language-id-module.ts similarity index 100% rename from packages/generator-langium/templates/core/src/language/language-id-module.ts rename to packages/generator-langium/templates/packages/language/src/language-id-module.ts diff --git a/packages/generator-langium/templates/core/src/language/language-id-validator.ts b/packages/generator-langium/templates/packages/language/src/language-id-validator.ts similarity index 100% rename from packages/generator-langium/templates/core/src/language/language-id-validator.ts rename to packages/generator-langium/templates/packages/language/src/language-id-validator.ts diff --git a/packages/generator-langium/templates/core/src/language/language-id.langium b/packages/generator-langium/templates/packages/language/src/language-id.langium similarity index 100% rename from packages/generator-langium/templates/core/src/language/language-id.langium rename to packages/generator-langium/templates/packages/language/src/language-id.langium diff --git a/packages/generator-langium/templates/test/test/linking/linking.test.ts b/packages/generator-langium/templates/packages/language/test/linking/linking.test.ts similarity index 92% rename from packages/generator-langium/templates/test/test/linking/linking.test.ts rename to packages/generator-langium/templates/packages/language/test/linking/linking.test.ts index fa3aeac23..89f12495a 100644 --- a/packages/generator-langium/templates/test/test/linking/linking.test.ts +++ b/packages/generator-langium/templates/packages/language/test/linking/linking.test.ts @@ -2,8 +2,7 @@ import { afterEach, beforeAll, describe, expect, test } from "vitest"; import { EmptyFileSystem, type LangiumDocument } from "langium"; import { expandToString as s } from "langium/generate"; import { clearDocuments, parseHelper } from "langium/test"; -import { create<%= LanguageName %>Services } from "../../src/language/<%= language-id %>-module.js"; -import { Model, isModel } from "../../src/language/generated/ast.js"; +import { create<%= LanguageName %>Services, isModel, Model } from "<%= language-id %>-language"; let services: ReturnTypeServices>; let parse: ReturnType>; diff --git a/packages/generator-langium/templates/test/test/parsing/parsing.test.ts b/packages/generator-langium/templates/packages/language/test/parsing/parsing.test.ts similarity index 93% rename from packages/generator-langium/templates/test/test/parsing/parsing.test.ts rename to packages/generator-langium/templates/packages/language/test/parsing/parsing.test.ts index 27810096a..f27815ed5 100644 --- a/packages/generator-langium/templates/test/test/parsing/parsing.test.ts +++ b/packages/generator-langium/templates/packages/language/test/parsing/parsing.test.ts @@ -2,8 +2,7 @@ import { beforeAll, describe, expect, test } from "vitest"; import { EmptyFileSystem, type LangiumDocument } from "langium"; import { expandToString as s } from "langium/generate"; import { parseHelper } from "langium/test"; -import { create<%= LanguageName %>Services } from "../../src/language/<%= language-id %>-module.js"; -import { Model, isModel } from "../../src/language/generated/ast.js"; +import { create<%= LanguageName %>Services, isModel, Model } from "<%= language-id %>-language"; let services: ReturnTypeServices>; let parse: ReturnType>; diff --git a/packages/generator-langium/templates/test/test/validating/validating.test.ts b/packages/generator-langium/templates/packages/language/test/validating/validating.test.ts similarity index 94% rename from packages/generator-langium/templates/test/test/validating/validating.test.ts rename to packages/generator-langium/templates/packages/language/test/validating/validating.test.ts index 1a33aeb4d..fe8ac1c22 100644 --- a/packages/generator-langium/templates/test/test/validating/validating.test.ts +++ b/packages/generator-langium/templates/packages/language/test/validating/validating.test.ts @@ -3,8 +3,7 @@ import { EmptyFileSystem, type LangiumDocument } from "langium"; import { expandToString as s } from "langium/generate"; import { parseHelper } from "langium/test"; import type { Diagnostic } from "vscode-languageserver-types"; -import { create<%= LanguageName %>Services } from "../../src/language/<%= language-id %>-module.js"; -import { Model, isModel } from "../../src/language/generated/ast.js"; +import { create<%= LanguageName %>Services, isModel, Model } from "<%= language-id %>-language"; let services: ReturnTypeServices>; let parse: ReturnType>; diff --git a/packages/generator-langium/templates/packages/language/tsconfig.json b/packages/generator-langium/templates/packages/language/tsconfig.json new file mode 100644 index 000000000..25c9de527 --- /dev/null +++ b/packages/generator-langium/templates/packages/language/tsconfig.json @@ -0,0 +1,12 @@ +// this file is required for VSCode to work properly +{ + "extends": "./tsconfig.src.json", + "compilerOptions": { + "noEmit": true, + "rootDir": "." + }, + "include": [ + "src/**/*", + "test/**/*" + ] +} diff --git a/packages/generator-langium/templates/packages/language/tsconfig.src.json b/packages/generator-langium/templates/packages/language/tsconfig.src.json new file mode 100644 index 000000000..87e2fcdc6 --- /dev/null +++ b/packages/generator-langium/templates/packages/language/tsconfig.src.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "out", + "declarationDir": "out", + }, + "include": [ + "src/**/*.ts", + ] + } + \ No newline at end of file diff --git a/packages/generator-langium/templates/packages/language/tsconfig.test.json b/packages/generator-langium/templates/packages/language/tsconfig.test.json new file mode 100644 index 000000000..d13f58d67 --- /dev/null +++ b/packages/generator-langium/templates/packages/language/tsconfig.test.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.src.json", + "compilerOptions": { + "noEmit": true, + "rootDir": "test" + }, + "references": [{ + "path": "./tsconfig.src.json" + }], + "include": [ + "test/**/*.ts", + ] + } + \ No newline at end of file diff --git a/packages/generator-langium/templates/test/vitest.config.ts b/packages/generator-langium/templates/packages/language/vitest.config.ts similarity index 63% rename from packages/generator-langium/templates/test/vitest.config.ts rename to packages/generator-langium/templates/packages/language/vitest.config.ts index 47173bfcf..190a23850 100644 --- a/packages/generator-langium/templates/test/vitest.config.ts +++ b/packages/generator-langium/templates/packages/language/vitest.config.ts @@ -6,12 +6,6 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { - // coverage: { - // provider: 'v8', - // reporter: ['text', 'html'], - // include: ['src'], - // exclude: ['**/generated'], - // }, deps: { interopDefault: true }, diff --git a/packages/generator-langium/templates/web/index.html b/packages/generator-langium/templates/packages/web/index.html similarity index 100% rename from packages/generator-langium/templates/web/index.html rename to packages/generator-langium/templates/packages/web/index.html diff --git a/packages/generator-langium/templates/web/language-configuration.json b/packages/generator-langium/templates/packages/web/language-configuration.json similarity index 100% rename from packages/generator-langium/templates/web/language-configuration.json rename to packages/generator-langium/templates/packages/web/language-configuration.json diff --git a/packages/generator-langium/templates/packages/web/package.json b/packages/generator-langium/templates/packages/web/package.json new file mode 100644 index 000000000..cf0dc52c4 --- /dev/null +++ b/packages/generator-langium/templates/packages/web/package.json @@ -0,0 +1,37 @@ +{ + "name": "<%= extension-name %>-web", + "description": "The web specific package", + "version": "0.0.1", + "type": "module", + "engines": { + "node": ">=18.0.0" + }, + "files": [ + "out", + "src" + ], + "scripts": { + "build": "vite build", + "bundle:serve": "http-server ./dist --port 5175", + "dev": "vite", + "dev:debug": "vite --debug --force", + "serve": "npm run dev" + }, + "dependencies": { + "@codingame/monaco-vscode-editor-service-override": "~5.2.0", + "@codingame/monaco-vscode-keybindings-service-override": "~5.2.0", + "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~5.2.0", + "monaco-editor-wrapper": "~5.2.0", + "monaco-languageclient": "~8.5.0", + "vscode": "npm:@codingame/monaco-vscode-api@~5.2.0" + }, + "devDependencies": { + "@codingame/esbuild-import-meta-url-plugin": "~1.0.2", + "vite": "~5.2.12", + "http-server": "~14.1.1" + }, + "volta": { + "node": "18.20.3", + "npm": "10.7.0" + } +} diff --git a/packages/generator-langium/templates/web/src/language/main-browser.ts b/packages/generator-langium/templates/packages/web/src/main-browser.ts similarity index 82% rename from packages/generator-langium/templates/web/src/language/main-browser.ts rename to packages/generator-langium/templates/packages/web/src/main-browser.ts index 73a3350d4..d7f2b0059 100644 --- a/packages/generator-langium/templates/web/src/language/main-browser.ts +++ b/packages/generator-langium/templates/packages/web/src/main-browser.ts @@ -1,7 +1,9 @@ +/// + import { EmptyFileSystem } from 'langium'; import { startLanguageServer } from 'langium/lsp'; import { BrowserMessageReader, BrowserMessageWriter, createConnection } from 'vscode-languageserver/browser.js'; -import { create<%= LanguageName %>Services } from './<%= language-id %>-module.js'; +import { create<%= LanguageName %>Services } from '<%= language-id %>-language'; declare const self: DedicatedWorkerGlobalScope; diff --git a/packages/generator-langium/templates/web/src/setupClassic.ts b/packages/generator-langium/templates/packages/web/src/setupClassic.ts similarity index 62% rename from packages/generator-langium/templates/web/src/setupClassic.ts rename to packages/generator-langium/templates/packages/web/src/setupClassic.ts index abc5d0a50..722c33fe1 100644 --- a/packages/generator-langium/templates/web/src/setupClassic.ts +++ b/packages/generator-langium/templates/packages/web/src/setupClassic.ts @@ -1,6 +1,6 @@ import { MonacoEditorLanguageClientWrapper, UserConfig } from 'monaco-editor-wrapper'; import { configureWorker, defineUserServices } from './setupCommon.js'; -import monarchSyntax from "./syntaxes/<%= language-id %>.monarch.js"; +import { monarchSyntax } from '<%= language-id %>-language'; export const setupConfigClassic = (): UserConfig => { return { @@ -8,11 +8,16 @@ export const setupConfigClassic = (): UserConfig => { serviceConfig: defineUserServices(), editorAppConfig: { $type: 'classic', - languageId: '<%= language-id %>', - code: `// <%= RawLanguageName %> is running in the web!`, - useDiffEditor: false, - languageExtensionConfig: { id: 'langium' }, - languageDef: monarchSyntax, + codeResources: { + main: { + text: '// <%= RawLanguageName %> is running in the web!', + uri: '/workspace/hello-world.<%= file-extension %>', + } + }, + languageDef: { + languageExtensionConfig: { id: '<%= language-id %>' }, + monarchLanguage: monarchSyntax + }, editorOptions: { 'semanticHighlighting.enabled': true, theme: 'vs-dark' diff --git a/packages/generator-langium/templates/web/src/setupCommon.ts b/packages/generator-langium/templates/packages/web/src/setupCommon.ts similarity index 91% rename from packages/generator-langium/templates/web/src/setupCommon.ts rename to packages/generator-langium/templates/packages/web/src/setupCommon.ts index 01b35c510..9ea24b57d 100644 --- a/packages/generator-langium/templates/web/src/setupCommon.ts +++ b/packages/generator-langium/templates/packages/web/src/setupCommon.ts @@ -26,12 +26,13 @@ export const configureMonacoWorkers = () => { export const configureWorker = (): LanguageClientConfig => { // vite does not extract the worker properly if it is URL is a variable - const lsWorker = new Worker(new URL('./language/main-browser', import.meta.url), { + const lsWorker = new Worker(new URL('./main-browser', import.meta.url), { type: 'module', name: '<%= LanguageName %> Language Server' }); return { + languageId: '<%= language-id %>', options: { $type: 'WorkerDirect', worker: lsWorker diff --git a/packages/generator-langium/templates/web/src/setupExtended.ts b/packages/generator-langium/templates/packages/web/src/setupExtended.ts similarity index 86% rename from packages/generator-langium/templates/web/src/setupExtended.ts rename to packages/generator-langium/templates/packages/web/src/setupExtended.ts index 27976b8c3..080894440 100644 --- a/packages/generator-langium/templates/web/src/setupExtended.ts +++ b/packages/generator-langium/templates/packages/web/src/setupExtended.ts @@ -4,16 +4,19 @@ import { configureWorker, defineUserServices } from './setupCommon.js'; export const setupConfigExtended = (): UserConfig => { const extensionFilesOrContents = new Map(); extensionFilesOrContents.set('/language-configuration.json', new URL('../language-configuration.json', import.meta.url)); - extensionFilesOrContents.set('/<%= language-id %>-grammar.json', new URL('../syntaxes/<%= language-id %>.tmLanguage.json', import.meta.url)); + extensionFilesOrContents.set('/<%= language-id %>-grammar.json', new URL('../../language/syntaxes/<%= language-id %>.tmLanguage.json', import.meta.url)); return { wrapperConfig: { serviceConfig: defineUserServices(), editorAppConfig: { $type: 'extended', - languageId: '<%= language-id %>', - code: `// <%= RawLanguageName %> is running in the web!`, - useDiffEditor: false, + codeResources: { + main: { + text: '// <%= RawLanguageName %> is running in the web!', + uri: '/workspace/hello-world.<%= file-extension %>', + } + }, extensions: [{ config: { name: '<%= language-id %>-web', diff --git a/packages/generator-langium/templates/web/static/monacoClassic.html b/packages/generator-langium/templates/packages/web/static/monacoClassic.html similarity index 100% rename from packages/generator-langium/templates/web/static/monacoClassic.html rename to packages/generator-langium/templates/packages/web/static/monacoClassic.html diff --git a/packages/generator-langium/templates/web/static/monacoExtended.html b/packages/generator-langium/templates/packages/web/static/monacoExtended.html similarity index 100% rename from packages/generator-langium/templates/web/static/monacoExtended.html rename to packages/generator-langium/templates/packages/web/static/monacoExtended.html diff --git a/packages/generator-langium/templates/web/static/styles.css b/packages/generator-langium/templates/packages/web/static/styles.css similarity index 100% rename from packages/generator-langium/templates/web/static/styles.css rename to packages/generator-langium/templates/packages/web/static/styles.css diff --git a/packages/generator-langium/templates/packages/web/tsconfig.json b/packages/generator-langium/templates/packages/web/tsconfig.json new file mode 100644 index 000000000..7f2fb0c6e --- /dev/null +++ b/packages/generator-langium/templates/packages/web/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "out", + "declarationDir": "out", + "lib": ["ES2022", "dom"] + }, + "references": [ + { + "path": "../language/tsconfig.src.json" + } + ], + "include": [ + "src/**/*.ts" + ] +} diff --git a/packages/generator-langium/templates/web/vite.config.ts b/packages/generator-langium/templates/packages/web/vite.config.ts similarity index 100% rename from packages/generator-langium/templates/web/vite.config.ts rename to packages/generator-langium/templates/packages/web/vite.config.ts diff --git a/packages/generator-langium/templates/test/.package.json b/packages/generator-langium/templates/test/.package.json deleted file mode 100644 index 87d788f21..000000000 --- a/packages/generator-langium/templates/test/.package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "devDependencies": { - "vitest": "~1.4.0" - }, - "scripts": { - "test": "vitest run" - } -} diff --git a/packages/generator-langium/templates/test/.tsconfig.json b/packages/generator-langium/templates/test/.tsconfig.json deleted file mode 100644 index 626da1c99..000000000 --- a/packages/generator-langium/templates/test/.tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "rootDir": ".", - "noEmit": true - }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ] - } - \ No newline at end of file diff --git a/packages/generator-langium/templates/test/tsconfig.src.json b/packages/generator-langium/templates/test/tsconfig.src.json deleted file mode 100644 index 928fe6d89..000000000 --- a/packages/generator-langium/templates/test/tsconfig.src.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": false, - "rootDir": "src", - }, - "include": [ - "src/**/*.ts" - ] - } - \ No newline at end of file diff --git a/packages/generator-langium/templates/tsconfig.build.json b/packages/generator-langium/templates/tsconfig.build.json new file mode 100644 index 000000000..c7a88d536 --- /dev/null +++ b/packages/generator-langium/templates/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "files": [], + "references": [ + { "path": "./packages/language/tsconfig.src.json" }, + { "path": "./packages/language/tsconfig.test.json" }, + { "path": "./packages/cli/tsconfig.json" }, + { "path": "./packages/web/tsconfig.json" }, + { "path": "./packages/extension/tsconfig.json" } + ] + } diff --git a/packages/generator-langium/templates/web/tsconfig.json b/packages/generator-langium/templates/tsconfig.json similarity index 53% rename from packages/generator-langium/templates/web/tsconfig.json rename to packages/generator-langium/templates/tsconfig.json index 5f1d245d9..a423856e4 100644 --- a/packages/generator-langium/templates/web/tsconfig.json +++ b/packages/generator-langium/templates/tsconfig.json @@ -1,24 +1,27 @@ { "compilerOptions": { - "target": "ES2017", - "module": "Node16", - "lib": ["ESNext", "DOM", "WebWorker"], + "target": "ES2020", + "module": "ES2022", + "moduleResolution": "Bundler", + "lib": ["ES2022"], "sourceMap": true, - "outDir": "out", "strict": true, "noUnusedLocals": true, "noImplicitReturns": true, "noImplicitOverride": true, - "moduleResolution": "Node16", "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "rootDir": "src" + "declaration": true, + "composite": true }, "include": [ - "src/**/*.ts" + "**/src/**/*", + "**/test/**/*" ], "exclude": [ - "node_modules" + "**/lib/**/*", + "**/out/**/*", + "**/node_modules/**/*" ] } diff --git a/packages/generator-langium/templates/web/.package.json b/packages/generator-langium/templates/web/.package.json deleted file mode 100644 index f39476261..000000000 --- a/packages/generator-langium/templates/web/.package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "scripts": { - "build:web": "npm run build", - "bundle": "vite build", - "bundle:serve": "http-server ./dist --port 5175", - "dev": "vite", - "dev:debug": "vite --debug --force", - "serve": "npm run dev" - }, - "dependencies": { - "@codingame/monaco-vscode-editor-service-override": "~3.2.3", - "@codingame/monaco-vscode-keybindings-service-override": "~3.2.3", - "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~3.2.3", - "monaco-editor-wrapper": "~4.0.2", - "monaco-languageclient": "~8.1.1", - "vscode": "npm:@codingame/monaco-vscode-api@~3.2.3" - }, - "devDependencies": { - "@codingame/esbuild-import-meta-url-plugin": "~1.0.2", - "vite": "~5.2.7", - "http-server": "~14.1.1" - } -} From eb78d1fd5c3b1cb1b3f570758160b43e25697ee7 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 14 Jun 2024 11:37:51 +0200 Subject: [PATCH 02/15] Integrating langauge tests again in generator and enhancing tests - Updated relevant dependencies and aligned version in the repo --- .editorconfig | 1 + .gitignore | 1 + .vscode/settings.json | 1 - examples/arithmetics/package.json | 2 +- examples/domainmodel/package.json | 2 +- examples/requirements/package.json | 2 +- examples/statemachine/package.json | 2 +- package-lock.json | 804 +++++++++--------- package.json | 8 +- packages/generator-langium/package.json | 4 +- packages/generator-langium/src/index.ts | 72 +- .../templates/.vscode/extensions.json | 4 - .../generator-langium/templates/package.json | 11 +- .../templates/packages/cli/package.json | 4 +- .../templates/packages/extension/package.json | 2 +- .../templates/packages/language/package.json | 3 +- .../templates/packages/web/package.json | 4 +- .../templates/packages/web/vite.config.ts | 1 - .../templates/tsconfig.build.json | 6 +- .../test/yeoman-generator.test.ts | 292 ++++++- packages/langium-cli/package.json | 6 +- vitest.workspace.js | 5 + 22 files changed, 722 insertions(+), 515 deletions(-) create mode 100644 vitest.workspace.js diff --git a/.editorconfig b/.editorconfig index a9edfeb39..03fbd0058 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,3 +6,4 @@ indent_size = 4 end_of_line = lf charset = utf-8 insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index f1596575a..cf9565e33 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ node_modules/ *.vsix *.tsbuildinfo hello-world +examples/generator-tests diff --git a/.vscode/settings.json b/.vscode/settings.json index 9af395294..fa1a7a777 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,7 +11,6 @@ "javascript", "typescript" ], - "vitest.enable": true, "[json]": { "editor.defaultFormatter": "vscode.json-language-features" }, diff --git a/examples/arithmetics/package.json b/examples/arithmetics/package.json index b475336a5..a6884accf 100644 --- a/examples/arithmetics/package.json +++ b/examples/arithmetics/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" diff --git a/examples/domainmodel/package.json b/examples/domainmodel/package.json index f70fe9077..f71a81fb8 100644 --- a/examples/domainmodel/package.json +++ b/examples/domainmodel/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "lodash": "~4.17.21", "vscode-languageclient": "~9.0.1", diff --git a/examples/requirements/package.json b/examples/requirements/package.json index f3c27728b..dc4e475cf 100644 --- a/examples/requirements/package.json +++ b/examples/requirements/package.json @@ -70,7 +70,7 @@ }, "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" diff --git a/examples/statemachine/package.json b/examples/statemachine/package.json index 078dbd97a..f70bdfebb 100644 --- a/examples/statemachine/package.json +++ b/examples/statemachine/package.json @@ -58,7 +58,7 @@ }, "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" diff --git a/package-lock.json b/package-lock.json index a2066f592..44da10e30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,8 +22,8 @@ "@types/vscode": "~1.67.0", "@typescript-eslint/eslint-plugin": "~6.4.1", "@typescript-eslint/parser": "~6.4.1", - "@vitest/coverage-v8": "~1.0.0", - "@vitest/ui": "~1.5.0", + "@vitest/coverage-v8": "~1.6.0", + "@vitest/ui": "~1.6.0", "concurrently": "~8.2.1", "editorconfig": "~2.0.0", "esbuild": "~0.19.2", @@ -31,7 +31,7 @@ "eslint-plugin-header": "~3.1.1", "shx": "~0.3.4", "typescript": "~5.4.5", - "vitest": "~1.5.0" + "vitest": "~1.6.0" }, "engines": { "node": ">= 18.0.0", @@ -44,7 +44,7 @@ "license": "MIT", "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" @@ -70,13 +70,21 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "examples/arithmetics/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, "examples/domainmodel": { "name": "langium-domainmodel-dsl", "version": "3.1.0", "license": "MIT", "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "lodash": "~4.17.21", "vscode-languageclient": "~9.0.1", @@ -103,12 +111,20 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "examples/domainmodel/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, "examples/requirements": { "name": "langium-requirements-dsl", "version": "3.1.0", "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" @@ -134,13 +150,21 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "examples/requirements/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, "examples/statemachine": { "name": "langium-statemachine-dsl", "version": "3.1.0", "license": "MIT", "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", + "commander": "~11.1.0", "langium": "~3.1.0", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" @@ -166,6 +190,14 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "examples/statemachine/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -201,18 +233,18 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "engines": { "node": ">=6.9.0" } @@ -296,10 +328,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", - "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", + "version": "7.25.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz", + "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==", "dev": true, + "dependencies": { + "@babel/types": "^7.25.2" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -320,13 +355,13 @@ } }, "node_modules/@babel/types": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", - "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", + "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -374,9 +409,9 @@ "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==" }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], @@ -986,27 +1021,21 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, "node_modules/@kwsites/file-exists": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", @@ -1333,9 +1362,9 @@ "dev": true }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.3.tgz", - "integrity": "sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz", + "integrity": "sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA==", "cpu": [ "arm" ], @@ -1346,9 +1375,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.3.tgz", - "integrity": "sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz", + "integrity": "sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==", "cpu": [ "arm64" ], @@ -1359,9 +1388,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.3.tgz", - "integrity": "sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz", + "integrity": "sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==", "cpu": [ "arm64" ], @@ -1372,9 +1401,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.3.tgz", - "integrity": "sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz", + "integrity": "sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==", "cpu": [ "x64" ], @@ -1385,9 +1414,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.3.tgz", - "integrity": "sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz", + "integrity": "sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==", "cpu": [ "arm" ], @@ -1398,9 +1427,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.14.3.tgz", - "integrity": "sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz", + "integrity": "sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==", "cpu": [ "arm" ], @@ -1411,9 +1440,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.3.tgz", - "integrity": "sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz", + "integrity": "sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==", "cpu": [ "arm64" ], @@ -1424,9 +1453,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.3.tgz", - "integrity": "sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz", + "integrity": "sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==", "cpu": [ "arm64" ], @@ -1437,9 +1466,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.3.tgz", - "integrity": "sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz", + "integrity": "sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==", "cpu": [ "ppc64" ], @@ -1450,9 +1479,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.3.tgz", - "integrity": "sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz", + "integrity": "sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==", "cpu": [ "riscv64" ], @@ -1463,9 +1492,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.3.tgz", - "integrity": "sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz", + "integrity": "sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==", "cpu": [ "s390x" ], @@ -1476,9 +1505,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.3.tgz", - "integrity": "sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz", + "integrity": "sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew==", "cpu": [ "x64" ], @@ -1489,9 +1518,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.3.tgz", - "integrity": "sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.20.0.tgz", + "integrity": "sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg==", "cpu": [ "x64" ], @@ -1502,9 +1531,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.3.tgz", - "integrity": "sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz", + "integrity": "sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==", "cpu": [ "arm64" ], @@ -1515,9 +1544,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.3.tgz", - "integrity": "sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz", + "integrity": "sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==", "cpu": [ "ia32" ], @@ -1528,9 +1557,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.3.tgz", - "integrity": "sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz", + "integrity": "sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==", "cpu": [ "x64" ], @@ -1632,16 +1661,6 @@ "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==" }, - "node_modules/@types/fs-extra": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz", - "integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==", - "dev": true, - "dependencies": { - "@types/jsonfile": "*", - "@types/node": "*" - } - }, "node_modules/@types/http-cache-semantics": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", @@ -1656,12 +1675,6 @@ "rxjs": "^7.2.0" } }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true - }, "node_modules/@types/json-schema": { "version": "7.0.12", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", @@ -1948,9 +1961,9 @@ "dev": true }, "node_modules/@vitest/coverage-v8": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.0.4.tgz", - "integrity": "sha512-xD6Yuql6RW0Ir/JJIs6rVrmnG2/KOWJF+IRX1oJQk5wGKGxbtdrYPbl+WTUn/4ICCQ2G20zbE1e8/nPNyAG5Vg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", + "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", @@ -1958,30 +1971,30 @@ "debug": "^4.3.4", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", - "istanbul-lib-source-maps": "^4.0.1", + "istanbul-lib-source-maps": "^5.0.4", "istanbul-reports": "^3.1.6", "magic-string": "^0.30.5", - "magicast": "^0.3.2", + "magicast": "^0.3.3", "picocolors": "^1.0.0", "std-env": "^3.5.0", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.2.0" + "strip-literal": "^2.0.0", + "test-exclude": "^6.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "^1.0.0" + "vitest": "1.6.0" } }, "node_modules/@vitest/expect": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.5.0.tgz", - "integrity": "sha512-0pzuCI6KYi2SIC3LQezmxujU9RK/vwC1U9R0rLuGlNGcOuDWxqWKu6nUdFsX9tH1WU0SXtAxToOsEjeUn1s3hA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dev": true, "dependencies": { - "@vitest/spy": "1.5.0", - "@vitest/utils": "1.5.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "chai": "^4.3.10" }, "funding": { @@ -1989,12 +2002,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.5.0.tgz", - "integrity": "sha512-7HWwdxXP5yDoe7DTpbif9l6ZmDwCzcSIK38kTSIt6CFEpMjX4EpCgT6wUmS0xTXqMI6E/ONmfgRKmaujpabjZQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", "dev": true, "dependencies": { - "@vitest/utils": "1.5.0", + "@vitest/utils": "1.6.0", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -2018,9 +2031,9 @@ } }, "node_modules/@vitest/runner/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", + "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", "dev": true, "engines": { "node": ">=12.20" @@ -2030,9 +2043,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.5.0.tgz", - "integrity": "sha512-qpv3fSEuNrhAO3FpH6YYRdaECnnRjg9VxbhdtPwPRnzSfHVXnNzzrpX4cJxqiwgRMo7uRMWDFBlsBq4Cr+rO3A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -2044,9 +2057,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.5.0.tgz", - "integrity": "sha512-vu6vi6ew5N5MMHJjD5PoakMRKYdmIrNJmyfkhRpQt5d9Ewhw9nZ5Aqynbi3N61bvk9UvZ5UysMT6ayIrZ8GA9w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -2056,12 +2069,12 @@ } }, "node_modules/@vitest/ui": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.5.0.tgz", - "integrity": "sha512-ETcToK2TzICf/Oartvt19IH7yR4oCs8GrQk5hRhZ5oZFaSdDHTh6o3EdzyxOaY24NZ20cXYYNGjj1se/5vHfFg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-1.6.0.tgz", + "integrity": "sha512-k3Lyo+ONLOgylctiGovRKy7V4+dIN2yxstX3eY5cWFXH6WP+ooVX79YSyi0GagdTQzLmT43BF27T0s6dOIPBXA==", "dev": true, "dependencies": { - "@vitest/utils": "1.5.0", + "@vitest/utils": "1.6.0", "fast-glob": "^3.3.2", "fflate": "^0.8.1", "flatted": "^3.2.9", @@ -2073,13 +2086,13 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "1.5.0" + "vitest": "1.6.0" } }, "node_modules/@vitest/utils": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.5.0.tgz", - "integrity": "sha512-BDU0GNL8MWkRkSRdNFvCUCAVOeHaUlVJ9Tx0TYBZyXaaOTmGtUFObzchCivIBrIwKzvZA7A9sCejVhXM2aY98A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -2606,9 +2619,9 @@ } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2627,10 +2640,13 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } @@ -3229,9 +3245,9 @@ } }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", @@ -3240,12 +3256,21 @@ "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" } }, + "node_modules/chai/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3493,6 +3518,7 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "dev": true, "engines": { "node": ">=16" } @@ -3611,6 +3637,12 @@ "node": ">=12" } }, + "node_modules/confbox": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", + "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", + "dev": true + }, "node_modules/config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", @@ -3667,12 +3699,6 @@ "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", "devOptional": true }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, "node_modules/core-js": { "version": "3.36.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.36.1.tgz", @@ -3861,9 +3887,9 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dev": true, "dependencies": { "type-detect": "^4.0.0" @@ -4629,9 +4655,9 @@ } }, "node_modules/fflate": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.1.tgz", - "integrity": "sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", "dev": true }, "node_modules/figures": { @@ -5790,19 +5816,6 @@ "node": ">= 14.17" } }, - "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -6886,14 +6899,14 @@ } }, "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "istanbul-lib-coverage": "^3.0.0" }, "engines": { "node": ">=10" @@ -7013,12 +7026,6 @@ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, - "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true - }, "node_modules/jsonfile": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", @@ -7305,26 +7312,23 @@ } }, "node_modules/magic-string": { - "version": "0.30.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", - "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", + "version": "0.30.11", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", + "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", "dev": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" + "@jridgewell/sourcemap-codec": "^1.5.0" } }, "node_modules/magicast": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.2.tgz", - "integrity": "sha512-Fjwkl6a0syt9TFN0JSYpOybxiMCkYNEeOTnOTNRbjphirLakznZXAqrXgj/7GG3D1dvETONNwrBfinvAbpunDg==", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", + "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", "dev": true, "dependencies": { - "@babel/parser": "^7.23.3", - "@babel/types": "^7.23.3", - "source-map-js": "^1.0.2" + "@babel/parser": "^7.24.4", + "@babel/types": "^7.24.0", + "source-map-js": "^1.2.0" } }, "node_modules/make-dir": { @@ -7806,15 +7810,15 @@ } }, "node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz", + "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==", "dev": true, "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", - "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.1.1", + "ufo": "^1.5.3" } }, "node_modules/mrmime": { @@ -8891,9 +8895,9 @@ } }, "node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, "node_modules/pathval": { @@ -8906,9 +8910,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -8952,20 +8956,20 @@ } }, "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.3.tgz", + "integrity": "sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==", "dev": true, "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" + "confbox": "^0.1.7", + "mlly": "^1.7.1", + "pathe": "^1.1.2" } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "dev": true, "funding": [ { @@ -8983,7 +8987,7 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "source-map-js": "^1.2.0" }, "engines": { @@ -9210,9 +9214,9 @@ } }, "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "node_modules/read-pkg-up": { @@ -9582,9 +9586,9 @@ } }, "node_modules/rollup": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.3.tgz", - "integrity": "sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.20.0.tgz", + "integrity": "sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -9597,22 +9601,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.14.3", - "@rollup/rollup-android-arm64": "4.14.3", - "@rollup/rollup-darwin-arm64": "4.14.3", - "@rollup/rollup-darwin-x64": "4.14.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.14.3", - "@rollup/rollup-linux-arm-musleabihf": "4.14.3", - "@rollup/rollup-linux-arm64-gnu": "4.14.3", - "@rollup/rollup-linux-arm64-musl": "4.14.3", - "@rollup/rollup-linux-powerpc64le-gnu": "4.14.3", - "@rollup/rollup-linux-riscv64-gnu": "4.14.3", - "@rollup/rollup-linux-s390x-gnu": "4.14.3", - "@rollup/rollup-linux-x64-gnu": "4.14.3", - "@rollup/rollup-linux-x64-musl": "4.14.3", - "@rollup/rollup-win32-arm64-msvc": "4.14.3", - "@rollup/rollup-win32-ia32-msvc": "4.14.3", - "@rollup/rollup-win32-x64-msvc": "4.14.3", + "@rollup/rollup-android-arm-eabi": "4.20.0", + "@rollup/rollup-android-arm64": "4.20.0", + "@rollup/rollup-darwin-arm64": "4.20.0", + "@rollup/rollup-darwin-x64": "4.20.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.20.0", + "@rollup/rollup-linux-arm-musleabihf": "4.20.0", + "@rollup/rollup-linux-arm64-gnu": "4.20.0", + "@rollup/rollup-linux-arm64-musl": "4.20.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.20.0", + "@rollup/rollup-linux-riscv64-gnu": "4.20.0", + "@rollup/rollup-linux-s390x-gnu": "4.20.0", + "@rollup/rollup-linux-x64-gnu": "4.20.0", + "@rollup/rollup-linux-x64-musl": "4.20.0", + "@rollup/rollup-win32-arm64-msvc": "4.20.0", + "@rollup/rollup-win32-ia32-msvc": "4.20.0", + "@rollup/rollup-win32-x64-msvc": "4.20.0", "fsevents": "~2.3.2" } }, @@ -9977,15 +9981,6 @@ "node": ">=8" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", @@ -10058,9 +10053,9 @@ "dev": true }, "node_modules/std-env": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.6.0.tgz", - "integrity": "sha512-aFZ19IgVmhdB2uX599ve2kE6BIE3YMnQ6Gp6BURhW/oIzpXGKr878TQfAQZn1+i0Flcc/UKUy1gOlcfaUBCryg==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, "node_modules/stdin-discarder": { @@ -10765,9 +10760,9 @@ } }, "node_modules/tinybench": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", - "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", "dev": true }, "node_modules/tinypool": { @@ -10989,9 +10984,9 @@ } }, "node_modules/ufo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", - "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz", + "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", "dev": true }, "node_modules/undici-types": { @@ -11356,20 +11351,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "devOptional": true }, - "node_modules/v8-to-istanbul": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", - "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^2.0.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -11412,13 +11393,13 @@ } }, "node_modules/vite": { - "version": "5.2.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.9.tgz", - "integrity": "sha512-uOQWfuZBlc6Y3W/DTuQ1Sr+oIXWvqljLvS881SVmAj00d5RdgShLcuXWxseWPd4HXwiYBFW/vXHfKFeqj9uQnw==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.0.tgz", + "integrity": "sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg==", "dev": true, "dependencies": { - "esbuild": "^0.20.1", - "postcss": "^8.4.38", + "esbuild": "^0.21.3", + "postcss": "^8.4.40", "rollup": "^4.13.0" }, "bin": { @@ -11438,6 +11419,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -11455,6 +11437,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -11467,9 +11452,9 @@ } }, "node_modules/vite-node": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.5.0.tgz", - "integrity": "sha512-tV8h6gMj6vPzVCa7l+VGq9lwoJjW8Y79vst8QZZGiuRAfijU+EEWuc0kFpmndQrWhMMhet1jdSF+40KSZUqIIw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -11489,9 +11474,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], @@ -11505,9 +11490,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], @@ -11521,9 +11506,9 @@ } }, "node_modules/vite/node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], @@ -11537,9 +11522,9 @@ } }, "node_modules/vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], @@ -11553,9 +11538,9 @@ } }, "node_modules/vite/node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], @@ -11569,9 +11554,9 @@ } }, "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], @@ -11585,9 +11570,9 @@ } }, "node_modules/vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], @@ -11601,9 +11586,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], @@ -11617,9 +11602,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], @@ -11633,9 +11618,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], @@ -11649,9 +11634,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], @@ -11665,9 +11650,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], @@ -11681,9 +11666,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], @@ -11697,9 +11682,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], @@ -11713,9 +11698,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], @@ -11729,9 +11714,9 @@ } }, "node_modules/vite/node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], @@ -11745,9 +11730,9 @@ } }, "node_modules/vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], @@ -11761,9 +11746,9 @@ } }, "node_modules/vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], @@ -11777,9 +11762,9 @@ } }, "node_modules/vite/node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], @@ -11793,9 +11778,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], @@ -11809,9 +11794,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], @@ -11825,9 +11810,9 @@ } }, "node_modules/vite/node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], @@ -11841,9 +11826,9 @@ } }, "node_modules/vite/node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, "bin": { @@ -11853,42 +11838,42 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/vitest": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.5.0.tgz", - "integrity": "sha512-d8UKgR0m2kjdxDWX6911uwxout6GHS0XaGH1cksSIVVG8kRlE7G7aBw7myKQCvDI5dT4j7ZMa+l706BIORMDLw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", "dev": true, "dependencies": { - "@vitest/expect": "1.5.0", - "@vitest/runner": "1.5.0", - "@vitest/snapshot": "1.5.0", - "@vitest/spy": "1.5.0", - "@vitest/utils": "1.5.0", + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -11902,7 +11887,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.5.0", + "vite-node": "1.6.0", "why-is-node-running": "^2.2.2" }, "bin": { @@ -11917,8 +11902,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.5.0", - "@vitest/ui": "1.5.0", + "@vitest/browser": "1.6.0", + "@vitest/ui": "1.6.0", "happy-dom": "*", "jsdom": "*" }, @@ -12220,9 +12205,9 @@ } }, "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, "dependencies": { "siginfo": "^2.0.0", @@ -13281,10 +13266,10 @@ "chalk": "~5.3.0", "lodash": "~4.17.21", "which": "~4.0.0", - "yeoman-generator": "~7.1.1" + "yeoman-generator": "~7.1.0" }, "devDependencies": { - "@types/lodash": "~4.17.0", + "@types/lodash": "~4.17.5", "@types/which": "~3.0.3", "@yeoman/types": "~1.2.0", "yeoman-test": "~8.2.0", @@ -13333,9 +13318,9 @@ } }, "packages/generator-langium/node_modules/@types/lodash": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz", - "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==", + "version": "4.17.7", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.7.tgz", + "integrity": "sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==", "dev": true }, "packages/generator-langium/node_modules/@types/which": { @@ -13992,8 +13977,8 @@ "license": "MIT", "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", - "fs-extra": "~11.1.1", + "commander": "~11.1.0", + "fs-extra": "~11.2.0", "jsonschema": "~1.4.1", "langium": "~3.1.0", "langium-railroad": "~3.1.0", @@ -14003,12 +13988,22 @@ "langium": "bin/langium.js" }, "devDependencies": { - "@types/fs-extra": "~11.0.1" + "@types/fs-extra": "~11.0.4" }, "engines": { "node": ">=16.0.0" } }, + "packages/langium-cli/node_modules/@types/fs-extra": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", + "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", + "dev": true, + "dependencies": { + "@types/jsonfile": "*", + "@types/node": "*" + } + }, "packages/langium-cli/node_modules/chalk": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", @@ -14020,6 +14015,27 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "packages/langium-cli/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, + "packages/langium-cli/node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "packages/langium-railroad": { "version": "3.1.0", "license": "MIT", diff --git a/package.json b/package.json index 4c8ce7aa8..b300f710e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint": "npm run lint --workspaces", "test": "vitest", "test:run": "vitest --run", - "test-ui": "vitest --ui", + "test:ui": "vitest --ui", "coverage": "vitest run --coverage", "validate-exports": "npm run validate-exports --workspace=langium", "version:dependencies": "node ./scripts/update-version.js && npm install", @@ -28,8 +28,8 @@ "@types/vscode": "~1.67.0", "@typescript-eslint/eslint-plugin": "~6.4.1", "@typescript-eslint/parser": "~6.4.1", - "@vitest/coverage-v8": "~1.0.0", - "@vitest/ui": "~1.5.0", + "@vitest/coverage-v8": "~1.6.0", + "@vitest/ui": "~1.6.0", "concurrently": "~8.2.1", "editorconfig": "~2.0.0", "esbuild": "~0.19.2", @@ -37,7 +37,7 @@ "eslint-plugin-header": "~3.1.1", "shx": "~0.3.4", "typescript": "~5.4.5", - "vitest": "~1.5.0" + "vitest": "~1.6.0" }, "overrides": { "@types/node": "~16.18.41" diff --git a/packages/generator-langium/package.json b/packages/generator-langium/package.json index 22383b327..5733a9a4e 100644 --- a/packages/generator-langium/package.json +++ b/packages/generator-langium/package.json @@ -36,10 +36,10 @@ "chalk": "~5.3.0", "lodash": "~4.17.21", "which": "~4.0.0", - "yeoman-generator": "~7.1.1" + "yeoman-generator": "~7.1.0" }, "devDependencies": { - "@types/lodash": "~4.17.0", + "@types/lodash": "~4.17.5", "@types/which": "~3.0.3", "@yeoman/types": "~1.2.0", "yeoman-test": "~8.2.0", diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index 6b41c889d..eb55f5c49 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -179,6 +179,7 @@ export class LangiumGenerator extends Generator { const pathBase = path.join(__dirname, BASE_DIR); this.sourceRoot(pathBase); const mainPackageJson = this.fs.readJSON(path.join(this.sourceRoot(), 'package.json')); + const tsConfigBuildJson = this.fs.readJSON(path.join(this.sourceRoot(), 'tsconfig.build.json')); const baseFiles = [ '.eslintrc.json', @@ -197,18 +198,19 @@ export class LangiumGenerator extends Generator { this.fs.copy(this.templatePath('gitignore.txt'), this._extensionPath('.gitignore')); this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_LANGUAGE}`)); - // omit .vscode-extensions.json for now const languageFiles = [ 'package.json', 'langium-config.json', 'langium-quickstart.md', 'tsconfig.json', 'tsconfig.src.json', - 'tsconfig.test.json', 'vitest.config.ts', 'src', - 'test' ]; + if (this.answers.includeTest) { + languageFiles.push('tsconfig.test.json'); + languageFiles.push('test'); + } for (const path of languageFiles) { this.fs.copy( this.templatePath(path), @@ -217,6 +219,24 @@ export class LangiumGenerator extends Generator { ); } + if (this.answers.includeTest) { + mainPackageJson.scripts.test = 'npm run --workspace packages/language test'; + + // ensure reference is directly behind ./packages/language/tsconfig.src.json + tsConfigBuildJson.references.push({ path: './packages/language/tsconfig.test.json' }); + + const languagePackageJson = this.fs.readJSON(this._extensionPath('packages/language/package.json')); + languagePackageJson.devDependencies.vitest = '~1.6.0'; + languagePackageJson.scripts.test = 'vitest run'; + this.fs.delete(this._extensionPath('packages/language/package.json')); + this.fs.writeJSON(this._extensionPath('packages/language/package.json'), languagePackageJson, undefined, 4); + + const extensionsJson = this.fs.readJSON(this._extensionPath('.vscode/extensions.json')); + extensionsJson.recommendations.push('vitest.explorer'); + this.fs.delete(this._extensionPath('.vscode/extensions.json')); + this.fs.writeJSON(this._extensionPath('.vscode/extensions.json'), extensionsJson, undefined, 4); + } + if (this.answers.includeCLI) { this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_CLI}`)); const cliFiles = [ @@ -233,6 +253,7 @@ export class LangiumGenerator extends Generator { ); } mainPackageJson.workspaces.push('packages/cli'); + tsConfigBuildJson.references.push({ path: './packages/cli/tsconfig.json' }); } if (this.answers.includeWeb) { @@ -254,6 +275,7 @@ export class LangiumGenerator extends Generator { ); } mainPackageJson.workspaces.push('packages/web'); + tsConfigBuildJson.references.push({ path: './packages/web/tsconfig.json' }); } if (this.answers.includeVSCode) { @@ -274,44 +296,14 @@ export class LangiumGenerator extends Generator { ); } mainPackageJson.workspaces.push('packages/extension'); + tsConfigBuildJson.references.push({ path: './packages/extension/tsconfig.json' }); } this.fs.writeJSON(this._extensionPath('.package.json'), mainPackageJson, undefined, 4); - this.fs.copy( - this._extensionPath('.package.json'), - this._extensionPath('package.json'), - templateCopyOptions - ); - this.fs.delete(this._extensionPath('.package.json')); - - // if (this.answers.includeTest) { - // this.sourceRoot(path.join(__dirname, TEMPLATE_TEST_DIR)); - - // this.fs.copy( - // this.templatePath('.'), - // this._extensionPath(), - // templateCopyOptions - // ); - - // // update the scripts section in the package.json to use 'tsconfig.src.json' for building - // const pkgJson = this.fs.readJSON(this.templatePath('.package.json')); - // this.fs.extendJSON(this._extensionPath('package-template.json'), pkgJson, undefined, 4); - - // // update the 'includes' property in the existing 'tsconfig.json' and adds '"noEmit": true' - // const tsconfigJson = this.fs.readJSON(this.templatePath('.tsconfig.json')); - // this.fs.extendJSON(this._extensionPath('tsconfig.json'), tsconfigJson, undefined, 4); - - // // the initial '.vscode/extensions.json' can't be extended as above, as it contains comments, which is tolerated by vscode, - // // but not by `this.fs.extendJSON(...)`, so - // this.fs.copy(this.templatePath('.vscode-extensions.json'), this._extensionPath('.vscode/extensions.json'), templateCopyOptions); - // } - - // this.fs.copy( - // this._extensionPath('package-template.json'), - // this._extensionPath('package.json'), - // templateCopyOptions - // ); - // this.fs.delete(this._extensionPath('package-template.json')); + this.fs.move(this._extensionPath('.package.json'), this._extensionPath('package.json'), templateCopyOptions); + + this.fs.writeJSON(this._extensionPath('.tsconfig.build.json'), tsConfigBuildJson, undefined, 4); + this.fs.move(this._extensionPath('.tsconfig.build.json'), this._extensionPath('tsconfig.build.json'), templateCopyOptions); } async install(): Promise { @@ -322,7 +314,9 @@ export class LangiumGenerator extends Generator { this.spawnSync('npm', ['install'], opts); } this.spawnSync('npm', ['run', 'langium:generate'], opts); - this.spawnSync('npm', ['run', 'build'], opts); + if(!this.args.includes('skip-build')) { + this.spawnSync('npm', ['run', 'build'], opts); + } } async end(): Promise { diff --git a/packages/generator-langium/templates/.vscode/extensions.json b/packages/generator-langium/templates/.vscode/extensions.json index 25933b03b..1b350b375 100644 --- a/packages/generator-langium/templates/.vscode/extensions.json +++ b/packages/generator-langium/templates/.vscode/extensions.json @@ -1,8 +1,4 @@ { - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - - // List of extensions which should be recommended for users of this workspace. "recommendations": [ "langium.langium-vscode" ] diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json index 66f6ed10a..6048bac53 100644 --- a/packages/generator-langium/templates/package.json +++ b/packages/generator-langium/templates/package.json @@ -1,9 +1,9 @@ { - "name": "<%= extension-name %>", + "name": "<%= extension-name %>-base", "description": "Base workspace package", "version": "0.0.1", "type": "module", - "private": true, + "private": true, "files": [ "out", "src" @@ -14,13 +14,12 @@ "build": "npm run compile && npm run build --workspaces", "lint": "eslint src --ext ts", "langium:generate": "npm run --workspace packages/language langium:generate", - "langium:watch": "npm run --workspace packages/language langium:watch", - "test": "vitest run" + "langium:watch": "npm run --workspace packages/language langium:watch" }, "devDependencies": { "@types/node": "^18.0.0", - "@typescript-eslint/parser": "~7.11.0", - "@typescript-eslint/eslint-plugin": "~7.11.0", + "@typescript-eslint/parser": "~7.13.0", + "@typescript-eslint/eslint-plugin": "~7.13.0", "eslint": "~8.57.0", "typescript": "~5.4.5" }, diff --git a/packages/generator-langium/templates/packages/cli/package.json b/packages/generator-langium/templates/packages/cli/package.json index 37787fc10..a9118e18c 100644 --- a/packages/generator-langium/templates/packages/cli/package.json +++ b/packages/generator-langium/templates/packages/cli/package.json @@ -20,9 +20,7 @@ "dependencies": { "<%= extension-name %>-language": "0.0.1", "chalk": "~5.3.0", - "commander": "~11.0.0" - }, - "devDependencies": { + "commander": "~11.1.0" }, "volta": { "node": "18.20.3", diff --git a/packages/generator-langium/templates/packages/extension/package.json b/packages/generator-langium/templates/packages/extension/package.json index a7b91a12d..ca53291d7 100644 --- a/packages/generator-langium/templates/packages/extension/package.json +++ b/packages/generator-langium/templates/packages/extension/package.json @@ -39,6 +39,6 @@ "devDependencies": { "@types/vscode": "~1.67.0", "concurrently": "~8.2.1", - "esbuild": "~0.20.2" + "esbuild": "~0.21.5" } } diff --git a/packages/generator-langium/templates/packages/language/package.json b/packages/generator-langium/templates/packages/language/package.json index 1016b0aa8..fb672a899 100644 --- a/packages/generator-langium/templates/packages/language/package.json +++ b/packages/generator-langium/templates/packages/language/package.json @@ -34,8 +34,7 @@ "langium": "~3.0.0" }, "devDependencies": { - "langium-cli": "~3.0.3", - "vitest": "~1.6.0" + "langium-cli": "~3.0.3" }, "volta": { "node": "18.20.3", diff --git a/packages/generator-langium/templates/packages/web/package.json b/packages/generator-langium/templates/packages/web/package.json index cf0dc52c4..26999962c 100644 --- a/packages/generator-langium/templates/packages/web/package.json +++ b/packages/generator-langium/templates/packages/web/package.json @@ -27,8 +27,8 @@ }, "devDependencies": { "@codingame/esbuild-import-meta-url-plugin": "~1.0.2", - "vite": "~5.2.12", - "http-server": "~14.1.1" + "vite": "~5.2.13", + "http-server": "~14.1.1" }, "volta": { "node": "18.20.3", diff --git a/packages/generator-langium/templates/packages/web/vite.config.ts b/packages/generator-langium/templates/packages/web/vite.config.ts index ca7bb008d..0effd610e 100644 --- a/packages/generator-langium/templates/packages/web/vite.config.ts +++ b/packages/generator-langium/templates/packages/web/vite.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable header/header */ import { defineConfig } from 'vite'; import * as path from 'path'; import importMetaUrlPlugin from '@codingame/esbuild-import-meta-url-plugin'; diff --git a/packages/generator-langium/templates/tsconfig.build.json b/packages/generator-langium/templates/tsconfig.build.json index c7a88d536..73049333e 100644 --- a/packages/generator-langium/templates/tsconfig.build.json +++ b/packages/generator-langium/templates/tsconfig.build.json @@ -1,10 +1,6 @@ { "files": [], "references": [ - { "path": "./packages/language/tsconfig.src.json" }, - { "path": "./packages/language/tsconfig.test.json" }, - { "path": "./packages/cli/tsconfig.json" }, - { "path": "./packages/web/tsconfig.json" }, - { "path": "./packages/extension/tsconfig.json" } + { "path": "./packages/language/tsconfig.src.json" } ] } diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 30446d434..7c9bbc06b 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -30,30 +30,67 @@ describe('Check yeoman generator works', () => { const files = (targetRoot: string) => [ targetRoot + '/.eslintrc.json', targetRoot + '/.gitignore', - targetRoot + '/langium-config.json', - targetRoot + '/langium-quickstart.md', + targetRoot + '/tsconfig.build.json', targetRoot + '/tsconfig.json', targetRoot + '/package.json', targetRoot + '/.vscode/extensions.json', + targetRoot + '/.vscode/launch.json', targetRoot + '/.vscode/tasks.json', - targetRoot + '/src/language/hello-world-module.ts', - targetRoot + '/src/language/hello-world-validator.ts', - targetRoot + '/src/language/hello-world.langium' + targetRoot + '/packages/language/src/hello-world-module.ts', + targetRoot + '/packages/language/src/hello-world-validator.ts', + targetRoot + '/packages/language/src/hello-world.langium', + targetRoot + '/packages/language/src/syntaxes/hello-world.monarch.ts', + targetRoot + '/packages/language/src/generated/ast.ts', + targetRoot + '/packages/language/src/generated/grammar.ts', + targetRoot + '/packages/language/src/generated/module.ts', ]; - const testFiles = (targetRoot: string) => [ - targetRoot + '/tsconfig.src.json', - targetRoot + '/test/parsing/parsing.test.ts', - targetRoot + '/test/linking/linking.test.ts', - targetRoot + '/test/validating/validating.test.ts', + const filesTest = (targetRoot: string) => [ + targetRoot + '/packages/language/tsconfig.test.json', + targetRoot + '/packages/language/test/linking/linking.test.ts', + targetRoot + '/packages/language/test/parsing/parsing.test.ts', + targetRoot + '/packages/language/test/validating/validating.test.ts', ]; - test('1 Should produce files for Core', async () => { + const filesCli = (targetRoot: string) => [ + targetRoot + '/packages/cli/bin/cli.js', + targetRoot + '/packages/cli/src/cli-util.ts', + targetRoot + '/packages/cli/src/generator.ts', + targetRoot + '/packages/cli/src/main.ts', + targetRoot + '/packages/cli/package.json', + targetRoot + '/packages/cli/tsconfig.json' + ]; + + const filesWeb = (targetRoot: string) => [ + targetRoot + '/packages/web/src/main-browser.ts', + targetRoot + '/packages/web/src/setupClassic.ts', + targetRoot + '/packages/web/src/setupCommon.ts', + targetRoot + '/packages/web/src/setupExtended.ts', + targetRoot + '/packages/web/static/monacoClassic.html', + targetRoot + '/packages/web/static/monacoExtended.html', + targetRoot + '/packages/web/static/styles.css', + targetRoot + '/packages/web/index.html', + targetRoot + '/packages/web/language-configuration.json', + targetRoot + '/packages/web/package.json', + targetRoot + '/packages/web/tsconfig.json', + targetRoot + '/packages/web/vite.config.ts' + ]; + + const filesExtension = (targetRoot: string) => [ + targetRoot + '/packages/extension/src/extension/main.ts', + targetRoot + '/packages/extension/src/language/main.ts', + targetRoot + '/packages/extension/.vscodeignore', + targetRoot + '/packages/extension/esbuild.mjs', + targetRoot + '/packages/extension/language-configuration.json', + targetRoot + '/packages/extension/package.json', + targetRoot + '/packages/extension/tsconfig.json' + ]; + test('1 Should produce files for Core', async () => { const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples - const targetRoot = path.resolve(packageTestDir, '../../../examples'); + const targetRoot = path.resolve(packageTestDir, '../../../examples/generator-tests/test1'); const extensionName = answersForCore.extensionName; // remove examples/hello-world (if existing) now and finally (don't delete everything else in examples) @@ -70,27 +107,29 @@ describe('Check yeoman generator works', () => { console.log(`Generating into directory: ${workingDir}`); }) .withAnswers(answersForCore) + // speed up tests by skipping install .withArguments('skip-install') + // speed up tests by skipping build + .withArguments('skip-build') .then((result) => { const projectRoot = targetRoot + '/' + extensionName; result.assertFile(files(projectRoot)); - result.assertNoFile(testFiles(projectRoot)); + result.assertNoFile(filesTest(projectRoot)); result.assertJsonFileContent(projectRoot + '/package.json', PACKAGE_JSON_EXPECTATION); result.assertFileContent(projectRoot + '/.vscode/tasks.json', TASKS_JSON_EXPECTATION); }).finally(() => { + // clean-up examples/generator-tests/test1/hello-world context.cleanTestDirectory(true); }); - context.cleanTestDirectory(true); // clean-up examples/hello-world }, 120_000); test('2 Should produce files for Core & CLI & test', async () => { - const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples - const targetRoot = path.resolve(packageTestDir, '../../../examples'); + const targetRoot = path.resolve(packageTestDir, '../../../examples/generator-tests/test2'); const extensionName = 'hello-world'; // remove examples/hello-world (if existing) now and finally (don't delete everything else in examples) @@ -106,7 +145,6 @@ describe('Check yeoman generator works', () => { // just for double checking console.log(`Generating into directory: ${workingDir}`); }) - .withArguments('skip-install') .withAnswers( { ...answersForCore, extensionName, @@ -114,15 +152,16 @@ describe('Check yeoman generator works', () => { includeTest: true }).then((result) => { const projectRoot = targetRoot + '/' + extensionName; - result.assertJsonFileContent(projectRoot + '/package.json', { - ...PACKAGE_JSON_EXPECTATION, - files: [ 'bin', 'out', 'src' ], - scripts: { - ...PACKAGE_JSON_EXPECTATION.scripts, - build: PACKAGE_JSON_EXPECTATION.scripts.build.replace(/tsconfig.json/, 'tsconfig.src.json'), - watch: PACKAGE_JSON_EXPECTATION.scripts.watch.replace(/tsconfig.json/, 'tsconfig.src.json') - } - }); + + result.assertFile(files(projectRoot)); + result.assertFile(filesTest(projectRoot)); + result.assertFile(filesCli(projectRoot)); + + const packageJson = JSON.parse(JSON.stringify(PACKAGE_JSON_EXPECTATION)); + packageJson.workspaces.push('packages/cli'); + packageJson.scripts.test = 'npm run --workspace packages/language test'; + result.assertJsonFileContent(projectRoot + '/package.json', packageJson); + result.assertJsonFileContent(projectRoot + '/packages/cli/package.json', PACKAGE_JSON_EXPECTATION_CLI); const returnVal = result.generator.spawnSync('npm', ['test'], { cwd: result.generator._extensionPath() @@ -131,39 +170,204 @@ describe('Check yeoman generator works', () => { result.assertTextEqual(String(returnVal.exitCode), '0'); }).finally(() => { + // clean-up examples/generator-tests/test2/hello-world context.cleanTestDirectory(true); }); }, 120_000); -}); -// eslint-disable-next-line @typescript-eslint/no-var-requires -const langiumVersion = `~${require('../../langium/package.json').version}`; -// eslint-disable-next-line @typescript-eslint/no-var-requires -const langiumCliVersion = `~${require('../../langium-cli/package.json').version}`; + test('3 Should produce files for Core & CLI & web & extension without tests', async () => { + const context = createHelpers({}).run(path.join(moduleRoot)); + + // generate in examples + const targetRoot = path.resolve(packageTestDir, '../../../examples/generator-tests/test3'); + const extensionName = 'hello-world'; + + // remove examples/hello-world (if existing) now and finally (don't delete everything else in examples) + context.targetDirectory = path.resolve(targetRoot, extensionName); + context.cleanTestDirectory(true); + + await context + .withOptions({ + // we need to explicitly tell the generator it's destinationRoot + destinationRoot: targetRoot + }) + .onTargetDirectory(workingDir => { + // just for double checking + console.log(`Generating into directory: ${workingDir}`); + }) + .withAnswers( { + ...answersForCore, + extensionName, + includeCLI: true, + includeWeb: true, + includeVSCode: true + }) + // speed up tests by skipping install + .withArguments('skip-install') + // speed up tests by skipping build + .withArguments('skip-build') + .then((result) => { + const projectRoot = targetRoot + '/' + extensionName; + + result.assertFile(files(projectRoot)); + result.assertNoFile(filesTest(projectRoot)); + result.assertFile(filesCli(projectRoot)); + result.assertFile(filesWeb(projectRoot)); + result.assertFile(filesExtension(projectRoot)); + + const packageJson = JSON.parse(JSON.stringify(PACKAGE_JSON_EXPECTATION)); + packageJson.workspaces.push('packages/cli'); + packageJson.workspaces.push('packages/web'); + packageJson.workspaces.push('packages/extension'); + result.assertJsonFileContent(projectRoot + '/package.json', packageJson); + result.assertJsonFileContent(projectRoot + '/packages/cli/package.json', PACKAGE_JSON_EXPECTATION_CLI); + result.assertJsonFileContent(projectRoot + '/packages/web/package.json', PACKAGE_JSON_EXPECTATION_WEB); + result.assertJsonFileContent(projectRoot + '/packages/extension/package.json', PACKAGE_JSON_EXPECTATION_EXTENSION); + }).finally(() => { + // clean-up examples/generator-tests/test3/hello-world + context.cleanTestDirectory(true); + }); + }, 150_000); +}); // eslint-disable-next-line @typescript-eslint/no-explicit-any const PACKAGE_JSON_EXPECTATION: Record = { - name: 'hello-world', - description: 'Please enter a brief description here', + name: 'hello-world-base', + description: 'Base workspace package', version: '0.0.1', + type: 'module', + private: true, files: ['out', 'src'], scripts: { - 'build': 'tsc -b tsconfig.json', - 'watch': 'tsc -b tsconfig.json --watch', + 'compile': 'tsc -b tsconfig.build.json', + 'watch': 'tsc -b tsconfig.build.json --watch', + 'build': 'npm run compile && npm run build --workspaces', 'lint': 'eslint src --ext ts', - 'langium:generate': 'langium generate', - 'langium:watch': 'langium generate --watch' - }, - 'dependencies': { - 'langium': langiumVersion + 'langium:generate': 'npm run --workspace packages/language langium:generate', + 'langium:watch': 'npm run --workspace packages/language langium:watch' }, 'devDependencies': { '@types/node': '^18.0.0', - '@typescript-eslint/eslint-plugin': '~7.3.1', - '@typescript-eslint/parser': '~7.3.1', + '@typescript-eslint/eslint-plugin': '~7.13.0', + '@typescript-eslint/parser': '~7.13.0', 'eslint': '~8.57.0', - 'langium-cli': langiumCliVersion, - 'typescript': '~5.1.6' + 'typescript': '~5.4.5' + }, + volta: { + 'node': '18.20.3', + 'npm': '10.7.0' + }, + workspaces: [ + 'packages/language' + ] +}; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const PACKAGE_JSON_EXPECTATION_CLI: Record = { + name: 'hello-world-cli', + description: 'The cli specific package', + version: '0.0.1', + type: 'module', + engines: { + node: '>=18.0.0' + }, + files: ['bin', 'out', 'src'], + bin: { + 'hello-world-cli': './bin/cli.js' + }, + scripts: { + 'build': "echo 'No build step'" + }, + dependencies: { + 'hello-world-language': '0.0.1', + 'chalk': '~5.3.0', + 'commander': '~11.1.0' + }, + volta: { + 'node': '18.20.3', + 'npm': '10.7.0' + } +}; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const PACKAGE_JSON_EXPECTATION_WEB: Record = { + name: 'hello-world-web', + description: 'The web specific package', + version: '0.0.1', + type: 'module', + engines: { + node: '>=18.0.0' + }, + files: ['out', 'src'], + scripts: { + 'build': 'vite build', + 'bundle:serve': 'http-server ./dist --port 5175', + 'dev': 'vite', + 'dev:debug': 'vite --debug --force', + 'serve': 'npm run dev' + }, + dependencies: { + '@codingame/monaco-vscode-editor-service-override': '~5.2.0', + '@codingame/monaco-vscode-keybindings-service-override': '~5.2.0', + 'monaco-editor': 'npm:@codingame/monaco-vscode-editor-api@~5.2.0', + 'monaco-editor-wrapper': '~5.2.0', + 'monaco-languageclient': '~8.5.0', + 'vscode': 'npm:@codingame/monaco-vscode-api@~5.2.0' + }, + devDependencies: { + '@codingame/esbuild-import-meta-url-plugin': '~1.0.2', + 'vite': '~5.2.13', + 'http-server': '~14.1.1' + }, + volta: { + node: '18.20.3', + npm: '10.7.0' + } +}; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const PACKAGE_JSON_EXPECTATION_EXTENSION: Record = { + name: 'hello-world-extension', + description: 'The extension specific package', + version: '0.0.1', + displayName: 'hello-world', + engines: { + vscode: '^1.67.0' + }, + categories: [ + 'Programming Languages' + ], + contributes: { + languages: [{ + id: 'hello-world', + aliases: ['Hello World', 'hello-world'], + extensions: ['.hello'], + configuration: './language-configuration.json' + }], + grammars: [{ + language: 'hello-world', + scopeName: 'source.hello-world', + path: 'syntaxes/hello-world.tmLanguage.json' + }] + }, + activationEvents: [ + 'onLanguage:hello-world' + ], + main: './out/extension/main.cjs', + scripts: { + 'vscode:prepublish': 'npm run build && npm run lint', + 'build': 'tsc -b tsconfig.json && node esbuild.mjs', + 'watch': 'concurrently -n tsc,esbuild -c blue,yellow "tsc -b tsconfig.json --watch" "node esbuild.mjs --watch"' + }, + dependencies: { + 'hello-world-language': '0.0.1', + 'vscode-languageclient': '~9.0.1', + 'vscode-languageserver': '~9.0.1' + }, + devDependencies: { + '@types/vscode': '~1.67.0', + 'concurrently': '~8.2.1', + 'esbuild': '~0.21.5' } }; diff --git a/packages/langium-cli/package.json b/packages/langium-cli/package.json index a885008c6..74d13b0d8 100644 --- a/packages/langium-cli/package.json +++ b/packages/langium-cli/package.json @@ -44,15 +44,15 @@ }, "dependencies": { "chalk": "~5.3.0", - "commander": "~11.0.0", - "fs-extra": "~11.1.1", + "commander": "~11.1.0", + "fs-extra": "~11.2.0", "jsonschema": "~1.4.1", "langium": "~3.1.0", "langium-railroad": "~3.1.0", "lodash": "~4.17.21" }, "devDependencies": { - "@types/fs-extra": "~11.0.1" + "@types/fs-extra": "~11.0.4" }, "volta": { "node": "18.19.1", diff --git a/vitest.workspace.js b/vitest.workspace.js new file mode 100644 index 000000000..6023ebdbf --- /dev/null +++ b/vitest.workspace.js @@ -0,0 +1,5 @@ +import { defineWorkspace } from 'vitest/config' + +export default defineWorkspace([ + "./vite.config.mts" +]) From 66d1e216f85c7c4d70dff30b62da143bba008c95 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 14 Jun 2024 11:52:27 +0200 Subject: [PATCH 03/15] Move test output to packages/generator-langium/test/genetator-tests --- .gitignore | 2 +- packages/generator-langium/test/yeoman-generator.test.ts | 6 +++--- packages/generator-langium/tsconfig.test.json | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index cf9565e33..ad306047e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ node_modules/ *.vsix *.tsbuildinfo hello-world -examples/generator-tests +generator-tests diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 7c9bbc06b..f13dfebbf 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -90,7 +90,7 @@ describe('Check yeoman generator works', () => { const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples - const targetRoot = path.resolve(packageTestDir, '../../../examples/generator-tests/test1'); + const targetRoot = path.resolve(packageTestDir, './generator-tests/test1'); const extensionName = answersForCore.extensionName; // remove examples/hello-world (if existing) now and finally (don't delete everything else in examples) @@ -129,7 +129,7 @@ describe('Check yeoman generator works', () => { const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples - const targetRoot = path.resolve(packageTestDir, '../../../examples/generator-tests/test2'); + const targetRoot = path.resolve(packageTestDir, './generator-tests/test2'); const extensionName = 'hello-world'; // remove examples/hello-world (if existing) now and finally (don't delete everything else in examples) @@ -179,7 +179,7 @@ describe('Check yeoman generator works', () => { const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples - const targetRoot = path.resolve(packageTestDir, '../../../examples/generator-tests/test3'); + const targetRoot = path.resolve(packageTestDir, './generator-tests/test3'); const extensionName = 'hello-world'; // remove examples/hello-world (if existing) now and finally (don't delete everything else in examples) diff --git a/packages/generator-langium/tsconfig.test.json b/packages/generator-langium/tsconfig.test.json index 0ab1f7056..f3136b8c2 100644 --- a/packages/generator-langium/tsconfig.test.json +++ b/packages/generator-langium/tsconfig.test.json @@ -10,4 +10,8 @@ "include": [ "test/**/*", ] + , + "exclude": [ + "test/generator-tests", + ] } From 96bd3abd22ef4a1e313cc22e6e40401c0f80a76e Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 14 Jun 2024 13:49:16 +0200 Subject: [PATCH 04/15] fix: web languageId and fileExt replacement / configuration, remove need for http-server --- .../generator-langium/templates/packages/web/package.json | 6 ++---- .../templates/packages/web/src/setupClassic.ts | 3 ++- .../templates/packages/web/src/setupExtended.ts | 6 +++--- packages/generator-langium/test/yeoman-generator.test.ts | 6 ++---- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/generator-langium/templates/packages/web/package.json b/packages/generator-langium/templates/packages/web/package.json index 26999962c..1986a7862 100644 --- a/packages/generator-langium/templates/packages/web/package.json +++ b/packages/generator-langium/templates/packages/web/package.json @@ -12,10 +12,9 @@ ], "scripts": { "build": "vite build", - "bundle:serve": "http-server ./dist --port 5175", "dev": "vite", "dev:debug": "vite --debug --force", - "serve": "npm run dev" + "serve": "vite preview" }, "dependencies": { "@codingame/monaco-vscode-editor-service-override": "~5.2.0", @@ -27,8 +26,7 @@ }, "devDependencies": { "@codingame/esbuild-import-meta-url-plugin": "~1.0.2", - "vite": "~5.2.13", - "http-server": "~14.1.1" + "vite": "~5.2.13" }, "volta": { "node": "18.20.3", diff --git a/packages/generator-langium/templates/packages/web/src/setupClassic.ts b/packages/generator-langium/templates/packages/web/src/setupClassic.ts index 722c33fe1..ce6717d6c 100644 --- a/packages/generator-langium/templates/packages/web/src/setupClassic.ts +++ b/packages/generator-langium/templates/packages/web/src/setupClassic.ts @@ -11,7 +11,8 @@ export const setupConfigClassic = (): UserConfig => { codeResources: { main: { text: '// <%= RawLanguageName %> is running in the web!', - uri: '/workspace/hello-world.<%= file-extension %>', + fileExt: '<%= file-glob-extension %>', + enforceLanguageId: '<%= language-id %>' } }, languageDef: { diff --git a/packages/generator-langium/templates/packages/web/src/setupExtended.ts b/packages/generator-langium/templates/packages/web/src/setupExtended.ts index 080894440..1856348e2 100644 --- a/packages/generator-langium/templates/packages/web/src/setupExtended.ts +++ b/packages/generator-langium/templates/packages/web/src/setupExtended.ts @@ -14,7 +14,7 @@ export const setupConfigExtended = (): UserConfig => { codeResources: { main: { text: '// <%= RawLanguageName %> is running in the web!', - uri: '/workspace/hello-world.<%= file-extension %>', + uri: '/workspace/hello-world.<%= file-glob-extension %>', } }, extensions: [{ @@ -29,7 +29,7 @@ export const setupConfigExtended = (): UserConfig => { languages: [{ id: '<%= language-id %>', extensions: [ - '.<%= language-id %>' + '.<%= file-glob-extension %>' ], configuration: './language-configuration.json' }], @@ -41,7 +41,7 @@ export const setupConfigExtended = (): UserConfig => { } }, filesOrContents: extensionFilesOrContents, - }], + }], userConfiguration: { json: JSON.stringify({ 'workbench.colorTheme': 'Default Dark Modern', diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index f13dfebbf..147408df9 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -301,10 +301,9 @@ const PACKAGE_JSON_EXPECTATION_WEB: Record = { files: ['out', 'src'], scripts: { 'build': 'vite build', - 'bundle:serve': 'http-server ./dist --port 5175', 'dev': 'vite', 'dev:debug': 'vite --debug --force', - 'serve': 'npm run dev' + 'serve': 'vite preview' }, dependencies: { '@codingame/monaco-vscode-editor-service-override': '~5.2.0', @@ -316,8 +315,7 @@ const PACKAGE_JSON_EXPECTATION_WEB: Record = { }, devDependencies: { '@codingame/esbuild-import-meta-url-plugin': '~1.0.2', - 'vite': '~5.2.13', - 'http-server': '~14.1.1' + 'vite': '~5.2.13' }, volta: { node: '18.20.3', From a57d24f647e9c08a00ba2202bbd8f24f2ea203eb Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Sat, 15 Jun 2024 18:22:40 +0200 Subject: [PATCH 05/15] Implemented a first set of review comments --- packages/generator-langium/src/index.ts | 1 - .../templates/.vscode/launch.json | 8 ++-- .../generator-langium/templates/gitignore.txt | 2 +- .../generator-langium/templates/package.json | 9 +--- .../templates/packages/cli/src/generator.ts | 2 +- .../templates/packages/cli/src/main.ts | 2 +- .../packages/cli/src/{cli-util.ts => util.ts} | 0 .../packages/extension/.vscodeignore | 2 - .../packages/language/langium-quickstart.md | 41 ++++++++++--------- .../test/{linking => }/linking.test.ts | 0 .../test/{parsing => }/parsing.test.ts | 5 ++- .../test/{validating => }/validating.test.ts | 7 ++-- .../packages/language/tsconfig.src.json | 4 +- .../test/yeoman-generator.test.ts | 22 +++++----- 14 files changed, 49 insertions(+), 56 deletions(-) rename packages/generator-langium/templates/packages/cli/src/{cli-util.ts => util.ts} (100%) rename packages/generator-langium/templates/packages/language/test/{linking => }/linking.test.ts (100%) rename packages/generator-langium/templates/packages/language/test/{parsing => }/parsing.test.ts (91%) rename packages/generator-langium/templates/packages/language/test/{validating => }/validating.test.ts (92%) diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index eb55f5c49..6e21d1a82 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -20,7 +20,6 @@ const PACKAGE_LANGUAGE = 'packages/language'; const PACKAGE_CLI = 'packages/cli'; const PACKAGE_WEB = 'packages/web'; const PACKAGE_EXTENSION = 'packages/extension'; -// const TEMPLATE_TEST_DIR = '../templates/packages/language/test'; const USER_DIR = '.'; const EXTENSION_NAME = /<%= extension-name %>/g; diff --git a/packages/generator-langium/templates/.vscode/launch.json b/packages/generator-langium/templates/.vscode/launch.json index e44e9fbc0..454b7dc95 100644 --- a/packages/generator-langium/templates/.vscode/launch.json +++ b/packages/generator-langium/templates/.vscode/launch.json @@ -10,11 +10,12 @@ "type": "extensionHost", "request": "launch", "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" + "--extensionDevelopmentPath=${workspaceFolder}/packages/extension" ], "sourceMaps": true, "outFiles": [ - "${workspaceFolder}/out/**/*.js" + "${workspaceFolder}/packages/language/out/**/*.js", + "${workspaceFolder}/packages/extension/out/**/*.js" ] }, { @@ -27,7 +28,8 @@ ], "sourceMaps": true, "outFiles": [ - "${workspaceFolder}/out/**/*.js", + "${workspaceFolder}/packages/language/out/**/*.js", + "${workspaceFolder}/packages/extension/out/**/*.js", "${workspaceFolder}/node_modules/langium" ] } diff --git a/packages/generator-langium/templates/gitignore.txt b/packages/generator-langium/templates/gitignore.txt index 4c9df9f0b..32c0c06f5 100644 --- a/packages/generator-langium/templates/gitignore.txt +++ b/packages/generator-langium/templates/gitignore.txt @@ -4,5 +4,5 @@ !.vscode/tasks.json node_modules/ out/ -src/language/generated/ +src/generated/ syntaxes/ diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json index 6048bac53..3e85776f3 100644 --- a/packages/generator-langium/templates/package.json +++ b/packages/generator-langium/templates/package.json @@ -1,17 +1,12 @@ { - "name": "<%= extension-name %>-base", + "name": "<%= extension-name %>-workspace", "description": "Base workspace package", "version": "0.0.1", "type": "module", "private": true, - "files": [ - "out", - "src" - ], "scripts": { - "compile": "tsc -b tsconfig.build.json", "watch": "tsc -b tsconfig.build.json --watch", - "build": "npm run compile && npm run build --workspaces", + "build": "tsc -b tsconfig.build.json && npm run build --workspaces", "lint": "eslint src --ext ts", "langium:generate": "npm run --workspace packages/language langium:generate", "langium:watch": "npm run --workspace packages/language langium:watch" diff --git a/packages/generator-langium/templates/packages/cli/src/generator.ts b/packages/generator-langium/templates/packages/cli/src/generator.ts index fe6c8f973..0866085ef 100644 --- a/packages/generator-langium/templates/packages/cli/src/generator.ts +++ b/packages/generator-langium/templates/packages/cli/src/generator.ts @@ -2,7 +2,7 @@ import type { Model } from '<%= language-id %>-language'; import { expandToNode, joinToNode, toString } from 'langium/generate'; import * as fs from 'node:fs'; import * as path from 'node:path'; -import { extractDestinationAndName } from './cli-util.js'; +import { extractDestinationAndName } from './util.js'; export function generateJavaScript(model: Model, filePath: string, destination: string | undefined): string { const data = extractDestinationAndName(filePath, destination); diff --git a/packages/generator-langium/templates/packages/cli/src/main.ts b/packages/generator-langium/templates/packages/cli/src/main.ts index 4dbd61697..41ab16def 100644 --- a/packages/generator-langium/templates/packages/cli/src/main.ts +++ b/packages/generator-langium/templates/packages/cli/src/main.ts @@ -2,7 +2,7 @@ import type { Model } from '<%= language-id %>-language'; import { create<%= LanguageName %>Services, <%= LanguageName %>LanguageMetaData } from '<%= language-id %>-language'; import chalk from 'chalk'; import { Command } from 'commander'; -import { extractAstNode } from './cli-util.js'; +import { extractAstNode } from './util.js'; import { generateJavaScript } from './generator.js'; import { NodeFileSystem } from 'langium/node'; import * as url from 'node:url'; diff --git a/packages/generator-langium/templates/packages/cli/src/cli-util.ts b/packages/generator-langium/templates/packages/cli/src/util.ts similarity index 100% rename from packages/generator-langium/templates/packages/cli/src/cli-util.ts rename to packages/generator-langium/templates/packages/cli/src/util.ts diff --git a/packages/generator-langium/templates/packages/extension/.vscodeignore b/packages/generator-langium/templates/packages/extension/.vscodeignore index 4f97a2668..dceac54db 100644 --- a/packages/generator-langium/templates/packages/extension/.vscodeignore +++ b/packages/generator-langium/templates/packages/extension/.vscodeignore @@ -1,4 +1,2 @@ .vscode/** .vscode-test/** -.gitignore -langium-quickstart.md diff --git a/packages/generator-langium/templates/packages/language/langium-quickstart.md b/packages/generator-langium/templates/packages/language/langium-quickstart.md index 0c3fdb472..746d3ceb8 100644 --- a/packages/generator-langium/templates/packages/language/langium-quickstart.md +++ b/packages/generator-langium/templates/packages/language/langium-quickstart.md @@ -3,32 +3,33 @@ ## What's in the folder This folder contains all necessary files for your language extension. - * `package.json` - the manifest file in which you declare your language support. - * `language-configuration.json` - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. - * `src/extension/main.ts` - the main code of the extension, which is responsible for launching a language server and client. - * `src/language/<%= language-id %>.langium` - the grammar definition of your language. - * `src/language/main.ts` - the entry point of the language server process. - * `src/language/<%= language-id %>-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services. - * `src/language/<%= language-id %>-validator.ts` - an example validator. You should change it to reflect the semantics of your language. - * `src/cli/main.ts` - the entry point of the command line interface (CLI) of your language. - * `src/cli/generator.ts` - the code generator used by the CLI to write output files from DSL documents. - * `src/cli/cli-util.ts` - utility code for the CLI. + +* `package.json` - the manifest file in which you declare your language support. +* `language-configuration.json` - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. +* `src/extension/main.ts` - the main code of the extension, which is responsible for launching a language server and client. +* `src/language/<%= language-id %>.langium` - the grammar definition of your language. +* `src/language/main.ts` - the entry point of the language server process. +* `src/language/<%= language-id %>-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services. +* `src/language/<%= language-id %>-validator.ts` - an example validator. You should change it to reflect the semantics of your language. +* `src/cli/main.ts` - the entry point of the command line interface (CLI) of your language. +* `src/cli/generator.ts` - the code generator used by the CLI to write output files from DSL documents. +* `src/cli/util.ts` - utility code for the CLI. ## Get up and running straight away - * Run `npm run langium:generate` to generate TypeScript code from the grammar definition. - * Run `npm run build` to compile all TypeScript code. - * Press `F5` to open a new window with your extension loaded. - * Create a new file with a file name suffix matching your language. - * Verify that syntax highlighting, validation, completion etc. are working as expected. - * Run `node ./bin/cli` to see options for the CLI; `node ./bin/cli generate ` generates code for a given DSL file. +* Run `npm run langium:generate` to generate TypeScript code from the grammar definition. +* Run `npm run build` to compile all TypeScript code. +* Press `F5` to open a new window with your extension loaded. +* Create a new file with a file name suffix matching your language. +* Verify that syntax highlighting, validation, completion etc. are working as expected. +* Run `node ./bin/cli` to see options for the CLI; `node ./bin/cli generate ` generates code for a given DSL file. ## Make changes - * Run `npm run watch` to have the TypeScript compiler run automatically after every change of the source files. - * Run `npm run langium:watch` to have the Langium generator run automatically after every change of the grammar declaration. - * You can relaunch the extension from the debug toolbar after making changes to the files listed above. - * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. +* Run `npm run watch` to have the TypeScript compiler run automatically after every change of the source files. +* Run `npm run langium:watch` to have the Langium generator run automatically after every change of the grammar declaration. +* You can relaunch the extension from the debug toolbar after making changes to the files listed above. +* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. ## Install your extension diff --git a/packages/generator-langium/templates/packages/language/test/linking/linking.test.ts b/packages/generator-langium/templates/packages/language/test/linking.test.ts similarity index 100% rename from packages/generator-langium/templates/packages/language/test/linking/linking.test.ts rename to packages/generator-langium/templates/packages/language/test/linking.test.ts diff --git a/packages/generator-langium/templates/packages/language/test/parsing/parsing.test.ts b/packages/generator-langium/templates/packages/language/test/parsing.test.ts similarity index 91% rename from packages/generator-langium/templates/packages/language/test/parsing/parsing.test.ts rename to packages/generator-langium/templates/packages/language/test/parsing.test.ts index f27815ed5..0d6e54354 100644 --- a/packages/generator-langium/templates/packages/language/test/parsing/parsing.test.ts +++ b/packages/generator-langium/templates/packages/language/test/parsing.test.ts @@ -2,7 +2,8 @@ import { beforeAll, describe, expect, test } from "vitest"; import { EmptyFileSystem, type LangiumDocument } from "langium"; import { expandToString as s } from "langium/generate"; import { parseHelper } from "langium/test"; -import { create<%= LanguageName %>Services, isModel, Model } from "<%= language-id %>-language"; +import type { Model } from "<%= language-id %>-language"; +import { create<%= LanguageName %>Services, isModel } from "<%= language-id %>-language"; let services: ReturnTypeServices>; let parse: ReturnType>; @@ -54,6 +55,6 @@ function checkDocumentValid(document: LangiumDocument): string | undefined { ${document.parseResult.parserErrors.map(e => e.message).join('\n ')} ` || document.parseResult.value === undefined && `ParseResult is 'undefined'.` - || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a '${Model}'.` + || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a Model'.` || undefined; } diff --git a/packages/generator-langium/templates/packages/language/test/validating/validating.test.ts b/packages/generator-langium/templates/packages/language/test/validating.test.ts similarity index 92% rename from packages/generator-langium/templates/packages/language/test/validating/validating.test.ts rename to packages/generator-langium/templates/packages/language/test/validating.test.ts index fe8ac1c22..bd6432790 100644 --- a/packages/generator-langium/templates/packages/language/test/validating/validating.test.ts +++ b/packages/generator-langium/templates/packages/language/test/validating.test.ts @@ -3,7 +3,8 @@ import { EmptyFileSystem, type LangiumDocument } from "langium"; import { expandToString as s } from "langium/generate"; import { parseHelper } from "langium/test"; import type { Diagnostic } from "vscode-languageserver-types"; -import { create<%= LanguageName %>Services, isModel, Model } from "<%= language-id %>-language"; +import type { Model } from "<%= language-id %>-language"; +import { create<%= LanguageName %>Services, isModel } from "<%= language-id %>-language"; let services: ReturnTypeServices>; let parse: ReturnType>; @@ -19,7 +20,7 @@ beforeAll(async () => { }); describe('Validating', () => { - + test('check no errors', async () => { document = await parse(` person Langium @@ -56,7 +57,7 @@ function checkDocumentValid(document: LangiumDocument): string | undefined { ${document.parseResult.parserErrors.map(e => e.message).join('\n ')} ` || document.parseResult.value === undefined && `ParseResult is 'undefined'.` - || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a '${Model}'.` + || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a 'Model'.` || undefined; } diff --git a/packages/generator-langium/templates/packages/language/tsconfig.src.json b/packages/generator-langium/templates/packages/language/tsconfig.src.json index 87e2fcdc6..b95fbed91 100644 --- a/packages/generator-langium/templates/packages/language/tsconfig.src.json +++ b/packages/generator-langium/templates/packages/language/tsconfig.src.json @@ -2,11 +2,9 @@ "extends": "../../tsconfig.json", "compilerOptions": { "rootDir": "src", - "outDir": "out", - "declarationDir": "out", + "outDir": "out" }, "include": [ "src/**/*.ts", ] } - \ No newline at end of file diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 147408df9..6cf1c54fe 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -42,19 +42,19 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/language/src/syntaxes/hello-world.monarch.ts', targetRoot + '/packages/language/src/generated/ast.ts', targetRoot + '/packages/language/src/generated/grammar.ts', - targetRoot + '/packages/language/src/generated/module.ts', + targetRoot + '/packages/language/src/generated/module.ts' ]; const filesTest = (targetRoot: string) => [ targetRoot + '/packages/language/tsconfig.test.json', - targetRoot + '/packages/language/test/linking/linking.test.ts', - targetRoot + '/packages/language/test/parsing/parsing.test.ts', - targetRoot + '/packages/language/test/validating/validating.test.ts', + targetRoot + '/packages/language/test/linking.test.ts', + targetRoot + '/packages/language/test/parsing.test.ts', + targetRoot + '/packages/language/test/validating.test.ts' ]; const filesCli = (targetRoot: string) => [ targetRoot + '/packages/cli/bin/cli.js', - targetRoot + '/packages/cli/src/cli-util.ts', + targetRoot + '/packages/cli/src/util.ts', targetRoot + '/packages/cli/src/generator.ts', targetRoot + '/packages/cli/src/main.ts', targetRoot + '/packages/cli/package.json', @@ -86,7 +86,7 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/extension/tsconfig.json' ]; - test('1 Should produce files for Core', async () => { + test('1 Should produce files for workspace and language (no test)', async () => { const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples @@ -125,7 +125,7 @@ describe('Check yeoman generator works', () => { }); }, 120_000); - test('2 Should produce files for Core & CLI & test', async () => { + test('2 Should produce files for workspace and languag (plus test) and cli', async () => { const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples @@ -175,7 +175,7 @@ describe('Check yeoman generator works', () => { }); }, 120_000); - test('3 Should produce files for Core & CLI & web & extension without tests', async () => { + test('3 Should produce files for workspace, language (no test), cli, web and extension', async () => { const context = createHelpers({}).run(path.join(moduleRoot)); // generate in examples @@ -232,16 +232,14 @@ describe('Check yeoman generator works', () => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const PACKAGE_JSON_EXPECTATION: Record = { - name: 'hello-world-base', + name: 'hello-world-workspace', description: 'Base workspace package', version: '0.0.1', type: 'module', private: true, - files: ['out', 'src'], scripts: { - 'compile': 'tsc -b tsconfig.build.json', 'watch': 'tsc -b tsconfig.build.json --watch', - 'build': 'npm run compile && npm run build --workspaces', + 'build': 'tsc -b tsconfig.build.json && npm run build --workspaces', 'lint': 'eslint src --ext ts', 'langium:generate': 'npm run --workspace packages/language langium:generate', 'langium:watch': 'npm run --workspace packages/language langium:watch' From 35721eb36d01fd5f43b5672fafdd6f4b63f928e4 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Sun, 16 Jun 2024 09:56:30 +0200 Subject: [PATCH 06/15] Implement further review comments --- packages/generator-langium/templates/gitignore.txt | 4 +++- .../templates/packages/language/test/linking.test.ts | 5 +++-- .../templates/packages/language/test/parsing.test.ts | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/generator-langium/templates/gitignore.txt b/packages/generator-langium/templates/gitignore.txt index 32c0c06f5..06e1951c0 100644 --- a/packages/generator-langium/templates/gitignore.txt +++ b/packages/generator-langium/templates/gitignore.txt @@ -3,6 +3,8 @@ !.vscode/launch.json !.vscode/tasks.json node_modules/ +dist/ out/ -src/generated/ +**/src/generated syntaxes/ +*.tsbuildinfo diff --git a/packages/generator-langium/templates/packages/language/test/linking.test.ts b/packages/generator-langium/templates/packages/language/test/linking.test.ts index 89f12495a..a6f09f6ca 100644 --- a/packages/generator-langium/templates/packages/language/test/linking.test.ts +++ b/packages/generator-langium/templates/packages/language/test/linking.test.ts @@ -2,7 +2,8 @@ import { afterEach, beforeAll, describe, expect, test } from "vitest"; import { EmptyFileSystem, type LangiumDocument } from "langium"; import { expandToString as s } from "langium/generate"; import { clearDocuments, parseHelper } from "langium/test"; -import { create<%= LanguageName %>Services, isModel, Model } from "<%= language-id %>-language"; +import type { Model } from "<%= language-id %>-language"; +import { create<%= LanguageName %>Services, isModel } from "<%= language-id %>-language"; let services: ReturnTypeServices>; let parse: ReturnType>; @@ -47,6 +48,6 @@ function checkDocumentValid(document: LangiumDocument): string | undefined { ${document.parseResult.parserErrors.map(e => e.message).join('\n ')} ` || document.parseResult.value === undefined && `ParseResult is 'undefined'.` - || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a '${Model}'.` + || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a 'Model'.` || undefined; } diff --git a/packages/generator-langium/templates/packages/language/test/parsing.test.ts b/packages/generator-langium/templates/packages/language/test/parsing.test.ts index 0d6e54354..f9b5fa44b 100644 --- a/packages/generator-langium/templates/packages/language/test/parsing.test.ts +++ b/packages/generator-langium/templates/packages/language/test/parsing.test.ts @@ -55,6 +55,6 @@ function checkDocumentValid(document: LangiumDocument): string | undefined { ${document.parseResult.parserErrors.map(e => e.message).join('\n ')} ` || document.parseResult.value === undefined && `ParseResult is 'undefined'.` - || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a Model'.` + || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a 'Model'.` || undefined; } From ea179bc602a0691eae353236f5e3a63aaab87392 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Wed, 19 Jun 2024 10:43:39 +0200 Subject: [PATCH 07/15] Update generator documentation in repo. At build:clean to generated project --- packages/generator-langium/src/index.ts | 6 ++- .../generator-langium/templates/README.md | 16 ++++++++ .../generator-langium/templates/package.json | 3 ++ .../templates/packages/cli/README.md | 19 +++++++++ .../templates/packages/cli/package.json | 4 +- .../packages/extension/langium-quickstart.md | 37 +++++++++++++++++ .../templates/packages/extension/package.json | 2 + .../packages/language/.vscode-extensions.json | 10 ----- .../templates/packages/language/README.md | 17 ++++++++ .../packages/language/langium-quickstart.md | 41 ------------------- .../templates/packages/language/package.json | 4 +- .../templates/packages/web/README.md | 35 ++++++++++++++++ .../templates/packages/web/package.json | 2 + .../test/yeoman-generator.test.ts | 21 ++++++++-- 14 files changed, 160 insertions(+), 57 deletions(-) create mode 100644 packages/generator-langium/templates/README.md create mode 100644 packages/generator-langium/templates/packages/cli/README.md create mode 100644 packages/generator-langium/templates/packages/extension/langium-quickstart.md delete mode 100644 packages/generator-langium/templates/packages/language/.vscode-extensions.json create mode 100644 packages/generator-langium/templates/packages/language/README.md delete mode 100644 packages/generator-langium/templates/packages/language/langium-quickstart.md create mode 100644 packages/generator-langium/templates/packages/web/README.md diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index 6e21d1a82..2a882699a 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -184,6 +184,7 @@ export class LangiumGenerator extends Generator { '.eslintrc.json', 'tsconfig.json', 'tsconfig.build.json', + 'README.md', '.vscode' ]; for (const path of baseFiles) { @@ -200,7 +201,7 @@ export class LangiumGenerator extends Generator { const languageFiles = [ 'package.json', 'langium-config.json', - 'langium-quickstart.md', + 'README.md', 'tsconfig.json', 'tsconfig.src.json', 'vitest.config.ts', @@ -241,6 +242,7 @@ export class LangiumGenerator extends Generator { const cliFiles = [ 'package.json', 'tsconfig.json', + 'README.md', 'bin', 'src' ]; @@ -260,6 +262,7 @@ export class LangiumGenerator extends Generator { const webFiles = [ 'package.json', 'language-configuration.json', + 'README.md', 'tsconfig.json', 'index.html', 'vite.config.ts', @@ -282,6 +285,7 @@ export class LangiumGenerator extends Generator { const extensionFiles = [ '.vscodeignore', 'esbuild.mjs', + 'langium-quickstart.md', 'language-configuration.json', 'package.json', 'tsconfig.json', diff --git a/packages/generator-langium/templates/README.md b/packages/generator-langium/templates/README.md new file mode 100644 index 000000000..df087c223 --- /dev/null +++ b/packages/generator-langium/templates/README.md @@ -0,0 +1,16 @@ +# Workspace overview + +Depending on the selection during the project generation you will have one or more packages contained in the packages directory. Check the : + +- [packages/language](./packages/language/README.md) is always available and contains the language definition. +- [packages/cli](./packages/cli/README.md) *Optional* Is only available if you chose to use the command-line interface. +- [packages/extension](./packages/extension/langium-quickstart.md) *Optional* Contains the VSCode extension if you chose to create it. +- [packages/web](./packages/web/README.md) *Optional* if selected contains the language server running in a web browser and a monaco-editor with language support similar to the onm from VSCode. + +## What's in the folder? + +- [.eslintrc.json](.eslintrc.json) - Configuration file for eslint +- [.gitignore](.gitignore) - Files ignored by git +- [package.json](./package.json) - The manifest file the main workspace package +- [tsconfig.json](./tsconfig.json) - The base TypeScript compiler configuration +- [tsconfig.build.json](./package.json) - Configuration used to build the complete source code. diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json index 3e85776f3..93bc7742b 100644 --- a/packages/generator-langium/templates/package.json +++ b/packages/generator-langium/templates/package.json @@ -5,8 +5,10 @@ "type": "module", "private": true, "scripts": { + "clean": "npm run clean --workspaces", "watch": "tsc -b tsconfig.build.json --watch", "build": "tsc -b tsconfig.build.json && npm run build --workspaces", + "build:clean": "npm run clean && npm run build", "lint": "eslint src --ext ts", "langium:generate": "npm run --workspace packages/language langium:generate", "langium:watch": "npm run --workspace packages/language langium:watch" @@ -16,6 +18,7 @@ "@typescript-eslint/parser": "~7.13.0", "@typescript-eslint/eslint-plugin": "~7.13.0", "eslint": "~8.57.0", + "shx": "~0.3.4", "typescript": "~5.4.5" }, "volta": { diff --git a/packages/generator-langium/templates/packages/cli/README.md b/packages/generator-langium/templates/packages/cli/README.md new file mode 100644 index 000000000..1bf4b8a6c --- /dev/null +++ b/packages/generator-langium/templates/packages/cli/README.md @@ -0,0 +1,19 @@ +# Command-line interface (CLI) + +Check [this part](https://langium.org/docs/learn/minilogo/customizing_cli/) of the Langium Minilogo Tutorial as a useful guide to the CLI. + +## What's in the folder? + +- [package.json](./package.json) - The manifest file of your cli package. +- [tsconfig.src.json](./tsconfig.src.json) - The package specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) +- [tsconfig.json](./tsconfig.json) - TypeScript compiler configuration options required for proper functionality of VSCode. +- [src/cli/main.ts](src/cli/main.ts) - the entry point of the command line interface (CLI) of your language. +- [src/cli/generator.ts](src/cli/generator.ts) - the code generator used by the CLI to write output files from DSL documents. +- [src/cli/util.ts](src/cli/util.ts) - utility code for the CLI. + +If you selected the test option as well, then you have the following for file as well: + +- [tsconfig.test.json](./tsconfig.test.json) - The package specific TypeScript compiler configuration for the unit tests extending the [tsconfig.src.config](tsconfig.src.json) +- [test/linking.test.ts](test/linking.test.ts) - Unit tests checking linking. +- [test/parsing.test.ts](test/parsing.test.ts) - Unit tests regarding parsing. +- [test/validating.test.ts](test/validating.test.ts) - Unit tests regarding validation. diff --git a/packages/generator-langium/templates/packages/cli/package.json b/packages/generator-langium/templates/packages/cli/package.json index a9118e18c..46dad2d5a 100644 --- a/packages/generator-langium/templates/packages/cli/package.json +++ b/packages/generator-langium/templates/packages/cli/package.json @@ -15,7 +15,9 @@ "<%= language-id %>-cli": "./bin/cli.js" }, "scripts": { - "build": "echo 'No build step'" + "clean": "shx rm -fr *.tsbuildinfo out", + "build": "echo 'No build step'", + "build:clean": "npm run clean && npm run build" }, "dependencies": { "<%= extension-name %>-language": "0.0.1", diff --git a/packages/generator-langium/templates/packages/extension/langium-quickstart.md b/packages/generator-langium/templates/packages/extension/langium-quickstart.md new file mode 100644 index 000000000..5a1ba5105 --- /dev/null +++ b/packages/generator-langium/templates/packages/extension/langium-quickstart.md @@ -0,0 +1,37 @@ +# Langium VS Code Extension + +Welcome to your Langium VSCode extension. This folder contains all necessary files for your language extension. + +## What's in the folder? + +- [package.json](./package.json) - the manifest file in which you declare your language support. +- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) +- [esbuid.mjs](esbuild.mjs) - Configuration file for esbuild that is used to create the VSCode extension bundle. +- [language-configuration.json](language-configuration.json) - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. +- [src/language/main.ts](src/language/main.ts) - the entry point of the language server process. +- [src/extension/main.ts](src/extension/main.ts) - the main code of the extension, which is responsible for launching a language server and client. + +## Get up and running straight away + +- Run `npm run langium:generate` to generate TypeScript code from the grammar definition. +- Run `npm run build` to compile all TypeScript code. +- Press `F5` to open a new window with your extension loaded. +- Create a new file with a file name suffix matching your language. +- Verify that syntax highlighting, validation, completion etc. are working as expected. +- Run `node ./bin/cli` to see options for the CLI; `node ./bin/cli generate ` generates code for a given DSL file. + +## Make changes + +- Run `npm run watch` to have the TypeScript compiler run automatically after every change of the source files. +- Run `npm run langium:watch` to have the Langium generator run automatically after every change of the grammar declaration. +- You can relaunch the extension from the debug toolbar after making changes to the files listed above. +- You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. + +## Install your extension + +- To start using your extension with VS Code, copy it into the `/.vscode/extensions` folder and restart Code. +- To share your extension with the world, read the [VS Code documentation](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) about publishing an extension. + +## To Go Further + +Documentation about the Langium framework is available at diff --git a/packages/generator-langium/templates/packages/extension/package.json b/packages/generator-langium/templates/packages/extension/package.json index ca53291d7..011328af8 100644 --- a/packages/generator-langium/templates/packages/extension/package.json +++ b/packages/generator-langium/templates/packages/extension/package.json @@ -27,8 +27,10 @@ ], "main": "./out/extension/main.cjs", "scripts": { + "clean": "shx rm -fr *.tsbuildinfo out", "vscode:prepublish": "npm run build && npm run lint", "build": "tsc -b tsconfig.json && node esbuild.mjs", + "build:clean": "npm run clean && npm run build", "watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.json --watch\" \"node esbuild.mjs --watch\"" }, "dependencies": { diff --git a/packages/generator-langium/templates/packages/language/.vscode-extensions.json b/packages/generator-langium/templates/packages/language/.vscode-extensions.json deleted file mode 100644 index 7f73a0a33..000000000 --- a/packages/generator-langium/templates/packages/language/.vscode-extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - - // List of extensions which should be recommended for users of this workspace. - "recommendations": [ - "langium.langium-vscode", - "vitest.explorer" - ] -} diff --git a/packages/generator-langium/templates/packages/language/README.md b/packages/generator-langium/templates/packages/language/README.md new file mode 100644 index 000000000..57396c287 --- /dev/null +++ b/packages/generator-langium/templates/packages/language/README.md @@ -0,0 +1,17 @@ +# The mandatory language package + +As a good entry point to our documentation, please use to this [guide](https://langium.org/docs/learn/workflow/write_grammar/). + +## What's in the folder? + +- [package.json](./package.json) - The manifest file of your language package. +- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) +- [src/<%= language-id %>.langium](src/<%= language-id %>.langium) - the grammar definition of your language +- [src/<%= language-id %>-module.ts](src/<%= language-id %>-module.ts) - the dependency injection module of your language implementation. Use this to register overridden and added services. +- [src/<%= language-id %>-validator.ts](src/<%= language-id %>-validator.ts) - an example validator. You should change it to reflect the semantics of your language +- [src/generated/ast.ts](src/generated/ast.ts) - Generated AST +- [src/generated/grammar.ts](src/generated/grammar.ts) - Generated Grammar +- [src/generated/module.ts](src/generated/module.ts) - Generated Module +- [src/syntaxes/<%= language-id %>.monarch.ts](src/syntaxes/<%= language-id %>.monarch.ts) - Monarch based syntax highlighting instructions +- [syntaxes/<%= language-id %>.tmLanguage.json](syntaxes/<%= language-id %>.tmLanguage.json) - Textmate based syntax highlighting instructions +- [src/index.ts](src/index.ts) Defines what is exported to other packages. diff --git a/packages/generator-langium/templates/packages/language/langium-quickstart.md b/packages/generator-langium/templates/packages/language/langium-quickstart.md deleted file mode 100644 index 746d3ceb8..000000000 --- a/packages/generator-langium/templates/packages/language/langium-quickstart.md +++ /dev/null @@ -1,41 +0,0 @@ -# Welcome to your Langium VS Code Extension - -## What's in the folder - -This folder contains all necessary files for your language extension. - -* `package.json` - the manifest file in which you declare your language support. -* `language-configuration.json` - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. -* `src/extension/main.ts` - the main code of the extension, which is responsible for launching a language server and client. -* `src/language/<%= language-id %>.langium` - the grammar definition of your language. -* `src/language/main.ts` - the entry point of the language server process. -* `src/language/<%= language-id %>-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services. -* `src/language/<%= language-id %>-validator.ts` - an example validator. You should change it to reflect the semantics of your language. -* `src/cli/main.ts` - the entry point of the command line interface (CLI) of your language. -* `src/cli/generator.ts` - the code generator used by the CLI to write output files from DSL documents. -* `src/cli/util.ts` - utility code for the CLI. - -## Get up and running straight away - -* Run `npm run langium:generate` to generate TypeScript code from the grammar definition. -* Run `npm run build` to compile all TypeScript code. -* Press `F5` to open a new window with your extension loaded. -* Create a new file with a file name suffix matching your language. -* Verify that syntax highlighting, validation, completion etc. are working as expected. -* Run `node ./bin/cli` to see options for the CLI; `node ./bin/cli generate ` generates code for a given DSL file. - -## Make changes - -* Run `npm run watch` to have the TypeScript compiler run automatically after every change of the source files. -* Run `npm run langium:watch` to have the Langium generator run automatically after every change of the grammar declaration. -* You can relaunch the extension from the debug toolbar after making changes to the files listed above. -* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. - -## Install your extension - -* To start using your extension with VS Code, copy it into the `/.vscode/extensions` folder and restart Code. -* To share your extension with the world, read the [VS Code documentation](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) about publishing an extension. - -## To Go Further - -Documentation about the Langium framework is available at https://langium.org diff --git a/packages/generator-langium/templates/packages/language/package.json b/packages/generator-langium/templates/packages/language/package.json index fb672a899..b34aaaff7 100644 --- a/packages/generator-langium/templates/packages/language/package.json +++ b/packages/generator-langium/templates/packages/language/package.json @@ -26,12 +26,14 @@ } }, "scripts": { + "clean": "shx rm -fr *.tsbuildinfo out", "build": "echo 'No build step'", + "build:clean": "npm run clean && npm run build", "langium:generate": "langium generate", "langium:watch": "langium generate --watch" }, "dependencies": { - "langium": "~3.0.0" + "langium": "~3.0.0" }, "devDependencies": { "langium-cli": "~3.0.3" diff --git a/packages/generator-langium/templates/packages/web/README.md b/packages/generator-langium/templates/packages/web/README.md new file mode 100644 index 000000000..d5d325140 --- /dev/null +++ b/packages/generator-langium/templates/packages/web/README.md @@ -0,0 +1,35 @@ +# Web-based editor and language server + +How the web based editor works is well defined [here](https://langium.org/docs/learn/minilogo/langium_and_monaco). + +## What's in the folder? + +- [index.html](index.html) - Entry page that let's you decide which web editor version is used. +- [language-configuration.json](language-configuration.json) - the language configuration used in the web editor, defining the tokens that are used for comments and brackets. +- [package.json](./package.json) - The manifest file of your web editor package. +- [src/main-browser.ts](src/main-browser.ts) - The the language server running in a web worker. +- [src/setupClassic.ts](src/setupClassic.ts) - Create monaco-editor with classic configuration (monarch sytax highlighting) +- [src/setupCommon.ts](src/setupCommon.ts) - Common settings for monaco-editor +- [src/setupExtended.ts](src/setupExtended.ts) - Create monaco-editor with extended configuration (textmate sytax highlighting) +- [static/monacoClassic.html](static/monacoClassic.html) - Page for classic monaco-editor +- [static/monacoExtended.html](static/monacoExtended.html) - Page for extended monaco-editor +- [static/styles.css](static/styles.css) - Stylesheets used by the HTML pages +- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) +- [vite.config.ts](vite.config.ts) - Vite/rollup production build instructions + +## Run the web application + +The generation post-step ensure that the whole project is built. +You can run chose to run the application either in development mode (code changes are directly available in the application) or production mode (bundled). + +For development: + +```shell +npm run dev +``` + +For production: + +```shell +npm run serve +``` diff --git a/packages/generator-langium/templates/packages/web/package.json b/packages/generator-langium/templates/packages/web/package.json index 1986a7862..849b414b9 100644 --- a/packages/generator-langium/templates/packages/web/package.json +++ b/packages/generator-langium/templates/packages/web/package.json @@ -11,7 +11,9 @@ "src" ], "scripts": { + "clean": "shx rm -fr *.tsbuildinfo out dist", "build": "vite build", + "build:clean": "npm run clean && npm run build", "dev": "vite", "dev:debug": "vite --debug --force", "serve": "vite preview" diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 6cf1c54fe..bae0ffe30 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -33,16 +33,19 @@ describe('Check yeoman generator works', () => { targetRoot + '/tsconfig.build.json', targetRoot + '/tsconfig.json', targetRoot + '/package.json', + targetRoot + '/README.md', targetRoot + '/.vscode/extensions.json', targetRoot + '/.vscode/launch.json', targetRoot + '/.vscode/tasks.json', + targetRoot + '/packages/language/README.md', targetRoot + '/packages/language/src/hello-world-module.ts', targetRoot + '/packages/language/src/hello-world-validator.ts', targetRoot + '/packages/language/src/hello-world.langium', targetRoot + '/packages/language/src/syntaxes/hello-world.monarch.ts', targetRoot + '/packages/language/src/generated/ast.ts', targetRoot + '/packages/language/src/generated/grammar.ts', - targetRoot + '/packages/language/src/generated/module.ts' + targetRoot + '/packages/language/src/generated/module.ts', + targetRoot + '/packages/language/syntaxes/hello-world.tmLanguage.json' ]; const filesTest = (targetRoot: string) => [ @@ -57,6 +60,7 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/cli/src/util.ts', targetRoot + '/packages/cli/src/generator.ts', targetRoot + '/packages/cli/src/main.ts', + targetRoot + '/packages/cli/README.md', targetRoot + '/packages/cli/package.json', targetRoot + '/packages/cli/tsconfig.json' ]; @@ -73,7 +77,8 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/web/language-configuration.json', targetRoot + '/packages/web/package.json', targetRoot + '/packages/web/tsconfig.json', - targetRoot + '/packages/web/vite.config.ts' + targetRoot + '/packages/web/vite.config.ts', + targetRoot + '/packages/web/README.md', ]; const filesExtension = (targetRoot: string) => [ @@ -81,6 +86,7 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/extension/src/language/main.ts', targetRoot + '/packages/extension/.vscodeignore', targetRoot + '/packages/extension/esbuild.mjs', + targetRoot + '/packages/extension/langium-quickstart.md', targetRoot + '/packages/extension/language-configuration.json', targetRoot + '/packages/extension/package.json', targetRoot + '/packages/extension/tsconfig.json' @@ -238,8 +244,10 @@ const PACKAGE_JSON_EXPECTATION: Record = { type: 'module', private: true, scripts: { + 'clean': 'npm run clean --workspaces', 'watch': 'tsc -b tsconfig.build.json --watch', 'build': 'tsc -b tsconfig.build.json && npm run build --workspaces', + 'build:clean': 'npm run clean && npm run build', 'lint': 'eslint src --ext ts', 'langium:generate': 'npm run --workspace packages/language langium:generate', 'langium:watch': 'npm run --workspace packages/language langium:watch' @@ -249,6 +257,7 @@ const PACKAGE_JSON_EXPECTATION: Record = { '@typescript-eslint/eslint-plugin': '~7.13.0', '@typescript-eslint/parser': '~7.13.0', 'eslint': '~8.57.0', + 'shx': '~0.3.4', 'typescript': '~5.4.5' }, volta: { @@ -274,7 +283,9 @@ const PACKAGE_JSON_EXPECTATION_CLI: Record = { 'hello-world-cli': './bin/cli.js' }, scripts: { - 'build': "echo 'No build step'" + 'clean': 'shx rm -fr *.tsbuildinfo out', + 'build': "echo 'No build step'", + 'build:clean': 'npm run clean && npm run build' }, dependencies: { 'hello-world-language': '0.0.1', @@ -298,7 +309,9 @@ const PACKAGE_JSON_EXPECTATION_WEB: Record = { }, files: ['out', 'src'], scripts: { + 'clean': 'shx rm -fr *.tsbuildinfo out dist', 'build': 'vite build', + 'build:clean': 'npm run clean && npm run build', 'dev': 'vite', 'dev:debug': 'vite --debug --force', 'serve': 'vite preview' @@ -351,8 +364,10 @@ const PACKAGE_JSON_EXPECTATION_EXTENSION: Record = { ], main: './out/extension/main.cjs', scripts: { + 'clean': 'shx rm -fr *.tsbuildinfo out', 'vscode:prepublish': 'npm run build && npm run lint', 'build': 'tsc -b tsconfig.json && node esbuild.mjs', + 'build:clean': 'npm run clean && npm run build', 'watch': 'concurrently -n tsc,esbuild -c blue,yellow "tsc -b tsconfig.json --watch" "node esbuild.mjs --watch"' }, dependencies: { From 23b3283b78f435db1f613887ebef3a28773bb7f0 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 21 Jun 2024 14:22:52 +0200 Subject: [PATCH 08/15] Updated READMEs once more --- .../generator-langium/templates/README.md | 13 +++++++---- .../templates/packages/cli/README.md | 16 ++++--------- .../packages/extension/langium-quickstart.md | 8 +++---- .../templates/packages/language/README.md | 23 ++++++++++++------- .../templates/packages/web/README.md | 16 ++++++------- 5 files changed, 40 insertions(+), 36 deletions(-) diff --git a/packages/generator-langium/templates/README.md b/packages/generator-langium/templates/README.md index df087c223..7d25bb5f9 100644 --- a/packages/generator-langium/templates/README.md +++ b/packages/generator-langium/templates/README.md @@ -1,16 +1,19 @@ # Workspace overview -Depending on the selection during the project generation you will have one or more packages contained in the packages directory. Check the : +Depending on the selection during the project generation you will have one or more packages contained in the packages directory. +Please check the specific projects here: -- [packages/language](./packages/language/README.md) is always available and contains the language definition. +- [packages/language](./packages/language/README.md) This package is always available and contains the language definition. - [packages/cli](./packages/cli/README.md) *Optional* Is only available if you chose to use the command-line interface. - [packages/extension](./packages/extension/langium-quickstart.md) *Optional* Contains the VSCode extension if you chose to create it. -- [packages/web](./packages/web/README.md) *Optional* if selected contains the language server running in a web browser and a monaco-editor with language support similar to the onm from VSCode. +- [packages/web](./packages/web/README.md) *Optional* If selected contains the language server running in a web browser and a monaco-editor with language support similar to the onm from VSCode. ## What's in the folder? -- [.eslintrc.json](.eslintrc.json) - Configuration file for eslint -- [.gitignore](.gitignore) - Files ignored by git +Some file are contained in the root directory as well. + - [package.json](./package.json) - The manifest file the main workspace package - [tsconfig.json](./tsconfig.json) - The base TypeScript compiler configuration - [tsconfig.build.json](./package.json) - Configuration used to build the complete source code. +- [.eslintrc.json](.eslintrc.json) - Configuration file for eslint +- [.gitignore](.gitignore) - Files ignored by git diff --git a/packages/generator-langium/templates/packages/cli/README.md b/packages/generator-langium/templates/packages/cli/README.md index 1bf4b8a6c..82c6c9bce 100644 --- a/packages/generator-langium/templates/packages/cli/README.md +++ b/packages/generator-langium/templates/packages/cli/README.md @@ -5,15 +5,9 @@ Check [this part](https://langium.org/docs/learn/minilogo/customizing_cli/) of t ## What's in the folder? - [package.json](./package.json) - The manifest file of your cli package. -- [tsconfig.src.json](./tsconfig.src.json) - The package specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) +- [tsconfig.src.json](./tsconfig.src.json) - The package specific TypeScript compiler configuration extending the [base config](../../tsconfig.json). - [tsconfig.json](./tsconfig.json) - TypeScript compiler configuration options required for proper functionality of VSCode. -- [src/cli/main.ts](src/cli/main.ts) - the entry point of the command line interface (CLI) of your language. -- [src/cli/generator.ts](src/cli/generator.ts) - the code generator used by the CLI to write output files from DSL documents. -- [src/cli/util.ts](src/cli/util.ts) - utility code for the CLI. - -If you selected the test option as well, then you have the following for file as well: - -- [tsconfig.test.json](./tsconfig.test.json) - The package specific TypeScript compiler configuration for the unit tests extending the [tsconfig.src.config](tsconfig.src.json) -- [test/linking.test.ts](test/linking.test.ts) - Unit tests checking linking. -- [test/parsing.test.ts](test/parsing.test.ts) - Unit tests regarding parsing. -- [test/validating.test.ts](test/validating.test.ts) - Unit tests regarding validation. +- [bin/cli.js](bin/cli/cli.js) - Script referenced in the [package.json](./package.json) and used to execute the command-line interface. +- [src/cli/main.ts](src/cli/main.ts) - The entry point of the command line interface (CLI) of your language. +- [src/cli/generator.ts](src/cli/generator.ts) - The code generator used by the CLI to write output files from DSL documents. +- [src/cli/util.ts](src/cli/util.ts) - Utility code for the CLI. diff --git a/packages/generator-langium/templates/packages/extension/langium-quickstart.md b/packages/generator-langium/templates/packages/extension/langium-quickstart.md index 5a1ba5105..ae7de4d2c 100644 --- a/packages/generator-langium/templates/packages/extension/langium-quickstart.md +++ b/packages/generator-langium/templates/packages/extension/langium-quickstart.md @@ -4,12 +4,12 @@ Welcome to your Langium VSCode extension. This folder contains all necessary fil ## What's in the folder? -- [package.json](./package.json) - the manifest file in which you declare your language support. -- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) +- [package.json](./package.json) - The manifest file in which you declare your language support. +- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json). - [esbuid.mjs](esbuild.mjs) - Configuration file for esbuild that is used to create the VSCode extension bundle. - [language-configuration.json](language-configuration.json) - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. -- [src/language/main.ts](src/language/main.ts) - the entry point of the language server process. -- [src/extension/main.ts](src/extension/main.ts) - the main code of the extension, which is responsible for launching a language server and client. +- [src/language/main.ts](src/language/main.ts) - The entry point of the language server process. +- [src/extension/main.ts](src/extension/main.ts) - The main code of the extension, which is responsible for launching a language server and client. ## Get up and running straight away diff --git a/packages/generator-langium/templates/packages/language/README.md b/packages/generator-langium/templates/packages/language/README.md index 57396c287..13970257c 100644 --- a/packages/generator-langium/templates/packages/language/README.md +++ b/packages/generator-langium/templates/packages/language/README.md @@ -6,12 +6,19 @@ As a good entry point to our documentation, please use to this [guide](https://l - [package.json](./package.json) - The manifest file of your language package. - [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) -- [src/<%= language-id %>.langium](src/<%= language-id %>.langium) - the grammar definition of your language -- [src/<%= language-id %>-module.ts](src/<%= language-id %>-module.ts) - the dependency injection module of your language implementation. Use this to register overridden and added services. -- [src/<%= language-id %>-validator.ts](src/<%= language-id %>-validator.ts) - an example validator. You should change it to reflect the semantics of your language -- [src/generated/ast.ts](src/generated/ast.ts) - Generated AST -- [src/generated/grammar.ts](src/generated/grammar.ts) - Generated Grammar -- [src/generated/module.ts](src/generated/module.ts) - Generated Module -- [src/syntaxes/<%= language-id %>.monarch.ts](src/syntaxes/<%= language-id %>.monarch.ts) - Monarch based syntax highlighting instructions -- [syntaxes/<%= language-id %>.tmLanguage.json](syntaxes/<%= language-id %>.tmLanguage.json) - Textmate based syntax highlighting instructions +- [src/<%= language-id %>.langium](src/<%= language-id %>.langium) - The grammar definition of your language +- [src/<%= language-id %>-module.ts](src/<%= language-id %>-module.ts) - The dependency injection module of your language implementation. Use this to register overridden and added services. +- [src/<%= language-id %>-validator.ts](src/<%= language-id %>-validator.ts) - An example validator. You should change it to reflect the semantics of your language. +- [src/generated/ast.ts](src/generated/ast.ts) - AST generated by `langium generate`. +- [src/generated/grammar.ts](src/generated/grammar.ts) - Grammar generated by `langium generate`. +- [src/generated/module.ts](src/generated/module.ts) - Module generated by `langium generate`. +- [src/syntaxes/<%= language-id %>.monarch.ts](src/syntaxes/<%= language-id %>.monarch.ts) - Monarch based syntax highlighting instructions. +- [syntaxes/<%= language-id %>.tmLanguage.json](syntaxes/<%= language-id %>.tmLanguage.json) - Textmate based syntax highlighting instructions. - [src/index.ts](src/index.ts) Defines what is exported to other packages. + +If you selected the test option as well, then the following files will be present in addition: + +- [tsconfig.test.json](./tsconfig.test.json) - The package specific TypeScript compiler configuration for the unit tests extending the [tsconfig.src.config](./tsconfig.src.json) +- [test/linking.test.ts](test/linking.test.ts) - Unit tests checking linking. +- [test/parsing.test.ts](test/parsing.test.ts) - Unit tests regarding parsing. +- [test/validating.test.ts](test/validating.test.ts) - Unit tests regarding validation. diff --git a/packages/generator-langium/templates/packages/web/README.md b/packages/generator-langium/templates/packages/web/README.md index d5d325140..47e741bee 100644 --- a/packages/generator-langium/templates/packages/web/README.md +++ b/packages/generator-langium/templates/packages/web/README.md @@ -5,21 +5,21 @@ How the web based editor works is well defined [here](https://langium.org/docs/l ## What's in the folder? - [index.html](index.html) - Entry page that let's you decide which web editor version is used. -- [language-configuration.json](language-configuration.json) - the language configuration used in the web editor, defining the tokens that are used for comments and brackets. +- [language-configuration.json](language-configuration.json) - The language configuration used in the web editor, defining the tokens that are used for comments and brackets. - [package.json](./package.json) - The manifest file of your web editor package. - [src/main-browser.ts](src/main-browser.ts) - The the language server running in a web worker. -- [src/setupClassic.ts](src/setupClassic.ts) - Create monaco-editor with classic configuration (monarch sytax highlighting) -- [src/setupCommon.ts](src/setupCommon.ts) - Common settings for monaco-editor -- [src/setupExtended.ts](src/setupExtended.ts) - Create monaco-editor with extended configuration (textmate sytax highlighting) -- [static/monacoClassic.html](static/monacoClassic.html) - Page for classic monaco-editor -- [static/monacoExtended.html](static/monacoExtended.html) - Page for extended monaco-editor -- [static/styles.css](static/styles.css) - Stylesheets used by the HTML pages +- [src/setupClassic.ts](src/setupClassic.ts) - Use monaco-editor with classic configuration (monarch sytax highlighting). +- [src/setupCommon.ts](src/setupCommon.ts) - File containing common settings for monaco-editor. +- [src/setupExtended.ts](src/setupExtended.ts) - Use monaco-editor with extended configuration (textmate sytax highlighting). +- [static/monacoClassic.html](static/monacoClassic.html) - Web page containing the classic monaco-editor. +- [static/monacoExtended.html](static/monacoExtended.html) - Web page containing the extended monaco-editor. +- [static/styles.css](static/styles.css) - Stylesheets used by the HTML pages. - [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) - [vite.config.ts](vite.config.ts) - Vite/rollup production build instructions ## Run the web application -The generation post-step ensure that the whole project is built. +The generation post-step ensure that the whole project is built, so you don't have to repeat it before issuing the next steps below. You can run chose to run the application either in development mode (code changes are directly available in the application) or production mode (bundled). For development: From dbb7a40a0c22f5c385b2b73b29ed1404adfd912a Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Tue, 2 Jul 2024 19:17:15 +0200 Subject: [PATCH 09/15] Updated monaco-editor-wrapper to the latest version --- .../generator-langium/templates/package.json | 6 ++--- .../templates/packages/extension/package.json | 4 ++-- .../templates/packages/language/package.json | 4 ++-- .../templates/packages/web/package.json | 14 +++++------ .../test/yeoman-generator.test.ts | 24 +++++++++---------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json index 93bc7742b..19c2ad2cb 100644 --- a/packages/generator-langium/templates/package.json +++ b/packages/generator-langium/templates/package.json @@ -15,11 +15,11 @@ }, "devDependencies": { "@types/node": "^18.0.0", - "@typescript-eslint/parser": "~7.13.0", - "@typescript-eslint/eslint-plugin": "~7.13.0", + "@typescript-eslint/parser": "~7.15.0", + "@typescript-eslint/eslint-plugin": "~7.15.0", "eslint": "~8.57.0", "shx": "~0.3.4", - "typescript": "~5.4.5" + "typescript": "~5.5.3" }, "volta": { "node": "18.20.3", diff --git a/packages/generator-langium/templates/packages/extension/package.json b/packages/generator-langium/templates/packages/extension/package.json index 011328af8..d0d3db95f 100644 --- a/packages/generator-langium/templates/packages/extension/package.json +++ b/packages/generator-langium/templates/packages/extension/package.json @@ -40,7 +40,7 @@ }, "devDependencies": { "@types/vscode": "~1.67.0", - "concurrently": "~8.2.1", - "esbuild": "~0.21.5" + "concurrently": "~8.2.2", + "esbuild": "~0.23.0" } } diff --git a/packages/generator-langium/templates/packages/language/package.json b/packages/generator-langium/templates/packages/language/package.json index b34aaaff7..6edcd96a1 100644 --- a/packages/generator-langium/templates/packages/language/package.json +++ b/packages/generator-langium/templates/packages/language/package.json @@ -33,10 +33,10 @@ "langium:watch": "langium generate --watch" }, "dependencies": { - "langium": "~3.0.0" + "langium": "~3.1.1" }, "devDependencies": { - "langium-cli": "~3.0.3" + "langium-cli": "~3.1.0" }, "volta": { "node": "18.20.3", diff --git a/packages/generator-langium/templates/packages/web/package.json b/packages/generator-langium/templates/packages/web/package.json index 849b414b9..f2c230755 100644 --- a/packages/generator-langium/templates/packages/web/package.json +++ b/packages/generator-langium/templates/packages/web/package.json @@ -19,16 +19,16 @@ "serve": "vite preview" }, "dependencies": { - "@codingame/monaco-vscode-editor-service-override": "~5.2.0", - "@codingame/monaco-vscode-keybindings-service-override": "~5.2.0", - "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~5.2.0", - "monaco-editor-wrapper": "~5.2.0", - "monaco-languageclient": "~8.5.0", - "vscode": "npm:@codingame/monaco-vscode-api@~5.2.0" + "@codingame/monaco-vscode-editor-service-override": "~6.0.3", + "@codingame/monaco-vscode-keybindings-service-override": "~6.0.3", + "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~6.0.3", + "monaco-editor-wrapper": "~5.3.1", + "monaco-languageclient": "~8.6.0", + "vscode": "npm:@codingame/monaco-vscode-api@~6.0.3" }, "devDependencies": { "@codingame/esbuild-import-meta-url-plugin": "~1.0.2", - "vite": "~5.2.13" + "vite": "~5.3.2" }, "volta": { "node": "18.20.3", diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index bae0ffe30..dbf74f112 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -254,11 +254,11 @@ const PACKAGE_JSON_EXPECTATION: Record = { }, 'devDependencies': { '@types/node': '^18.0.0', - '@typescript-eslint/eslint-plugin': '~7.13.0', - '@typescript-eslint/parser': '~7.13.0', + '@typescript-eslint/eslint-plugin': '~7.15.0', + '@typescript-eslint/parser': '~7.15.0', 'eslint': '~8.57.0', 'shx': '~0.3.4', - 'typescript': '~5.4.5' + 'typescript': '~5.5.3' }, volta: { 'node': '18.20.3', @@ -317,16 +317,16 @@ const PACKAGE_JSON_EXPECTATION_WEB: Record = { 'serve': 'vite preview' }, dependencies: { - '@codingame/monaco-vscode-editor-service-override': '~5.2.0', - '@codingame/monaco-vscode-keybindings-service-override': '~5.2.0', - 'monaco-editor': 'npm:@codingame/monaco-vscode-editor-api@~5.2.0', - 'monaco-editor-wrapper': '~5.2.0', - 'monaco-languageclient': '~8.5.0', - 'vscode': 'npm:@codingame/monaco-vscode-api@~5.2.0' + '@codingame/monaco-vscode-editor-service-override': '~6.0.3', + '@codingame/monaco-vscode-keybindings-service-override': '~6.0.3', + 'monaco-editor': 'npm:@codingame/monaco-vscode-editor-api@~6.0.3', + 'monaco-editor-wrapper': '~5.3.1', + 'monaco-languageclient': '~8.6.0', + 'vscode': 'npm:@codingame/monaco-vscode-api@~6.0.3' }, devDependencies: { '@codingame/esbuild-import-meta-url-plugin': '~1.0.2', - 'vite': '~5.2.13' + 'vite': '~5.3.2' }, volta: { node: '18.20.3', @@ -377,8 +377,8 @@ const PACKAGE_JSON_EXPECTATION_EXTENSION: Record = { }, devDependencies: { '@types/vscode': '~1.67.0', - 'concurrently': '~8.2.1', - 'esbuild': '~0.21.5' + 'concurrently': '~8.2.2', + 'esbuild': '~0.23.0' } }; From da5562de174fa506764fe8d1b38892f9d6979d92 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 5 Jul 2024 16:40:16 +0200 Subject: [PATCH 10/15] Implement review comments: tmLanguage location and package names use languageId --- packages/generator-langium/templates/package.json | 2 +- .../templates/packages/cli/package.json | 4 ++-- .../templates/packages/extension/package.json | 9 +++++---- .../templates/packages/language/package.json | 2 +- .../templates/packages/web/package.json | 13 +++++++------ .../templates/packages/web/src/setupExtended.ts | 2 +- .../generator-langium/test/yeoman-generator.test.ts | 10 ++++------ 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json index 19c2ad2cb..aa7b19ca9 100644 --- a/packages/generator-langium/templates/package.json +++ b/packages/generator-langium/templates/package.json @@ -1,5 +1,5 @@ { - "name": "<%= extension-name %>-workspace", + "name": "<%= language-id %>-workspace", "description": "Base workspace package", "version": "0.0.1", "type": "module", diff --git a/packages/generator-langium/templates/packages/cli/package.json b/packages/generator-langium/templates/packages/cli/package.json index 46dad2d5a..08416672e 100644 --- a/packages/generator-langium/templates/packages/cli/package.json +++ b/packages/generator-langium/templates/packages/cli/package.json @@ -1,5 +1,5 @@ { - "name": "<%= extension-name %>-cli", + "name": "<%= language-id %>-cli", "description": "The cli specific package", "version": "0.0.1", "type": "module", @@ -20,7 +20,7 @@ "build:clean": "npm run clean && npm run build" }, "dependencies": { - "<%= extension-name %>-language": "0.0.1", + "<%= language-id %>-language": "0.0.1", "chalk": "~5.3.0", "commander": "~11.1.0" }, diff --git a/packages/generator-langium/templates/packages/extension/package.json b/packages/generator-langium/templates/packages/extension/package.json index d0d3db95f..9c09bd22b 100644 --- a/packages/generator-langium/templates/packages/extension/package.json +++ b/packages/generator-langium/templates/packages/extension/package.json @@ -27,14 +27,15 @@ ], "main": "./out/extension/main.cjs", "scripts": { - "clean": "shx rm -fr *.tsbuildinfo out", + "clean": "shx rm -fr *.tsbuildinfo out syntaxes", "vscode:prepublish": "npm run build && npm run lint", - "build": "tsc -b tsconfig.json && node esbuild.mjs", + "build:prepare": "shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/<%= language-id %>.tmLanguage.json ./syntaxes/<%= language-id %>.tmLanguage.json", + "build": "npm run build:prepare && tsc -b tsconfig.json && node esbuild.mjs", "build:clean": "npm run clean && npm run build", - "watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.json --watch\" \"node esbuild.mjs --watch\"" + "watch": "npm run build:prepare && concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.json --watch\" \"node esbuild.mjs --watch\"" }, "dependencies": { - "<%= extension-name %>-language": "0.0.1", + "<%= language-id %>-language": "0.0.1", "vscode-languageclient": "~9.0.1", "vscode-languageserver": "~9.0.1" }, diff --git a/packages/generator-langium/templates/packages/language/package.json b/packages/generator-langium/templates/packages/language/package.json index 6edcd96a1..1c0df435b 100644 --- a/packages/generator-langium/templates/packages/language/package.json +++ b/packages/generator-langium/templates/packages/language/package.json @@ -1,5 +1,5 @@ { - "name": "<%= extension-name %>-language", + "name": "<%= language-id %>-language", "description": "The language specific package", "version": "0.0.1", "type": "module", diff --git a/packages/generator-langium/templates/packages/web/package.json b/packages/generator-langium/templates/packages/web/package.json index f2c230755..7bb20993a 100644 --- a/packages/generator-langium/templates/packages/web/package.json +++ b/packages/generator-langium/templates/packages/web/package.json @@ -1,5 +1,5 @@ { - "name": "<%= extension-name %>-web", + "name": "<%= language-id %>-web", "description": "The web specific package", "version": "0.0.1", "type": "module", @@ -11,12 +11,13 @@ "src" ], "scripts": { - "clean": "shx rm -fr *.tsbuildinfo out dist", - "build": "vite build", + "clean": "shx rm -fr *.tsbuildinfo out dist syntaxes", + "build:prepare": "shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/<%= language-id %>.tmLanguage.json ./syntaxes/<%= language-id %>.tmLanguage.json", + "build": "npm run build:prepare && vite build", "build:clean": "npm run clean && npm run build", - "dev": "vite", - "dev:debug": "vite --debug --force", - "serve": "vite preview" + "dev": "npm run build:prepare && vite", + "dev:debug": "npm run build:prepare && vite --debug --force", + "serve": "npm run build:prepare && vite preview" }, "dependencies": { "@codingame/monaco-vscode-editor-service-override": "~6.0.3", diff --git a/packages/generator-langium/templates/packages/web/src/setupExtended.ts b/packages/generator-langium/templates/packages/web/src/setupExtended.ts index 1856348e2..a8e626bc9 100644 --- a/packages/generator-langium/templates/packages/web/src/setupExtended.ts +++ b/packages/generator-langium/templates/packages/web/src/setupExtended.ts @@ -4,7 +4,7 @@ import { configureWorker, defineUserServices } from './setupCommon.js'; export const setupConfigExtended = (): UserConfig => { const extensionFilesOrContents = new Map(); extensionFilesOrContents.set('/language-configuration.json', new URL('../language-configuration.json', import.meta.url)); - extensionFilesOrContents.set('/<%= language-id %>-grammar.json', new URL('../../language/syntaxes/<%= language-id %>.tmLanguage.json', import.meta.url)); + extensionFilesOrContents.set('/<%= language-id %>-grammar.json', new URL('../syntaxes/<%= language-id %>.tmLanguage.json', import.meta.url)); return { wrapperConfig: { diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index dbf74f112..7220bad80 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -73,6 +73,7 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/web/static/monacoClassic.html', targetRoot + '/packages/web/static/monacoExtended.html', targetRoot + '/packages/web/static/styles.css', + targetRoot + '/packages/web/syntaxes/hello-world.tmLanguage.json', targetRoot + '/packages/web/index.html', targetRoot + '/packages/web/language-configuration.json', targetRoot + '/packages/web/package.json', @@ -84,6 +85,7 @@ describe('Check yeoman generator works', () => { const filesExtension = (targetRoot: string) => [ targetRoot + '/packages/extension/src/extension/main.ts', targetRoot + '/packages/extension/src/language/main.ts', + targetRoot + '/packages/extension/syntaxes/hello-world.tmLanguage.json', targetRoot + '/packages/extension/.vscodeignore', targetRoot + '/packages/extension/esbuild.mjs', targetRoot + '/packages/extension/langium-quickstart.md', @@ -208,10 +210,6 @@ describe('Check yeoman generator works', () => { includeWeb: true, includeVSCode: true }) - // speed up tests by skipping install - .withArguments('skip-install') - // speed up tests by skipping build - .withArguments('skip-build') .then((result) => { const projectRoot = targetRoot + '/' + extensionName; @@ -309,7 +307,7 @@ const PACKAGE_JSON_EXPECTATION_WEB: Record = { }, files: ['out', 'src'], scripts: { - 'clean': 'shx rm -fr *.tsbuildinfo out dist', + 'clean': 'shx rm -fr *.tsbuildinfo out dist syntaxes', 'build': 'vite build', 'build:clean': 'npm run clean && npm run build', 'dev': 'vite', @@ -364,7 +362,7 @@ const PACKAGE_JSON_EXPECTATION_EXTENSION: Record = { ], main: './out/extension/main.cjs', scripts: { - 'clean': 'shx rm -fr *.tsbuildinfo out', + 'clean': 'shx rm -fr *.tsbuildinfo out syntaxes', 'vscode:prepublish': 'npm run build && npm run lint', 'build': 'tsc -b tsconfig.json && node esbuild.mjs', 'build:clean': 'npm run clean && npm run build', From 351915c305b3e3196fd23b2ab289479a9e215285 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 5 Jul 2024 16:54:48 +0200 Subject: [PATCH 11/15] Fix documentation and fix tests --- .../templates/packages/cli/README.md | 4 ++++ .../packages/extension/langium-quickstart.md | 9 ++++----- .../test/yeoman-generator.test.ts | 14 ++++++++------ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/generator-langium/templates/packages/cli/README.md b/packages/generator-langium/templates/packages/cli/README.md index 82c6c9bce..daff992e4 100644 --- a/packages/generator-langium/templates/packages/cli/README.md +++ b/packages/generator-langium/templates/packages/cli/README.md @@ -11,3 +11,7 @@ Check [this part](https://langium.org/docs/learn/minilogo/customizing_cli/) of t - [src/cli/main.ts](src/cli/main.ts) - The entry point of the command line interface (CLI) of your language. - [src/cli/generator.ts](src/cli/generator.ts) - The code generator used by the CLI to write output files from DSL documents. - [src/cli/util.ts](src/cli/util.ts) - Utility code for the CLI. + +## Instructions + +Run `node ./bin/cli` to see options for the CLI; `node ./bin/cli generate ` generates code for a given DSL file. diff --git a/packages/generator-langium/templates/packages/extension/langium-quickstart.md b/packages/generator-langium/templates/packages/extension/langium-quickstart.md index ae7de4d2c..56553d30c 100644 --- a/packages/generator-langium/templates/packages/extension/langium-quickstart.md +++ b/packages/generator-langium/templates/packages/extension/langium-quickstart.md @@ -6,10 +6,10 @@ Welcome to your Langium VSCode extension. This folder contains all necessary fil - [package.json](./package.json) - The manifest file in which you declare your language support. - [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json). -- [esbuid.mjs](esbuild.mjs) - Configuration file for esbuild that is used to create the VSCode extension bundle. -- [language-configuration.json](language-configuration.json) - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. -- [src/language/main.ts](src/language/main.ts) - The entry point of the language server process. -- [src/extension/main.ts](src/extension/main.ts) - The main code of the extension, which is responsible for launching a language server and client. +- [esbuild.mjs](./esbuild.mjs) - Configuration file for esbuild that is used to create the VSCode extension bundle. +- [language-configuration.json](./language-configuration.json) - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. +- [src/language/main.ts](./src/language/main.ts) - The entry point of the language server process. +- [src/extension/main.ts](./src/extension/main.ts) - The main code of the extension, which is responsible for launching a language server and client. ## Get up and running straight away @@ -18,7 +18,6 @@ Welcome to your Langium VSCode extension. This folder contains all necessary fil - Press `F5` to open a new window with your extension loaded. - Create a new file with a file name suffix matching your language. - Verify that syntax highlighting, validation, completion etc. are working as expected. -- Run `node ./bin/cli` to see options for the CLI; `node ./bin/cli generate ` generates code for a given DSL file. ## Make changes diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 7220bad80..441448417 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -308,11 +308,12 @@ const PACKAGE_JSON_EXPECTATION_WEB: Record = { files: ['out', 'src'], scripts: { 'clean': 'shx rm -fr *.tsbuildinfo out dist syntaxes', - 'build': 'vite build', + 'build:prepare': 'shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/hello-world.tmLanguage.json ./syntaxes/hello-world.tmLanguage.json', + 'build': 'npm run build:prepare && vite build', 'build:clean': 'npm run clean && npm run build', - 'dev': 'vite', - 'dev:debug': 'vite --debug --force', - 'serve': 'vite preview' + 'dev': 'npm run build:prepare && vite', + 'dev:debug': 'npm run build:prepare && vite --debug --force', + 'serve': 'npm run build:prepare && vite preview' }, dependencies: { '@codingame/monaco-vscode-editor-service-override': '~6.0.3', @@ -364,9 +365,10 @@ const PACKAGE_JSON_EXPECTATION_EXTENSION: Record = { scripts: { 'clean': 'shx rm -fr *.tsbuildinfo out syntaxes', 'vscode:prepublish': 'npm run build && npm run lint', - 'build': 'tsc -b tsconfig.json && node esbuild.mjs', + 'build:prepare': 'shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/hello-world.tmLanguage.json ./syntaxes/hello-world.tmLanguage.json', + 'build': 'npm run build:prepare && tsc -b tsconfig.json && node esbuild.mjs', 'build:clean': 'npm run clean && npm run build', - 'watch': 'concurrently -n tsc,esbuild -c blue,yellow "tsc -b tsconfig.json --watch" "node esbuild.mjs --watch"' + 'watch': 'npm run build:prepare && concurrently -n tsc,esbuild -c blue,yellow "tsc -b tsconfig.json --watch" "node esbuild.mjs --watch"' }, dependencies: { 'hello-world-language': '0.0.1', From 176e78ad6f57d09b04920082a1da9f77389318c7 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Mon, 8 Jul 2024 10:05:21 +0200 Subject: [PATCH 12/15] fix: monarch is only generated and included if web project us selected --- packages/generator-langium/src/index.ts | 48 ++++++++++++++++++- .../packages/language/langium-config.json | 15 ------ .../templates/packages/language/src/index.ts | 6 --- .../test/yeoman-generator.test.ts | 6 ++- 4 files changed, 51 insertions(+), 24 deletions(-) delete mode 100644 packages/generator-langium/templates/packages/language/langium-config.json delete mode 100644 packages/generator-langium/templates/packages/language/src/index.ts diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index 2a882699a..a4500cb40 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -47,6 +47,22 @@ export interface PostAnwers { openWith: 'code' | false } +/** + * This is a sub-set of LangiumConfig from langium-cli. + * We copy this to not introduce a dependency to langium-cli itself. + */ +export interface LangiumLanguageConfigSubset { + id: string + grammar: string + fileExtensions?: string[] + textMate?: { + out: string + } + monarch?: { + out: string + } +} + function printLogo(log: (message: string) => void): void { log('\u001b[36m┌─────┐ ─┐'); log('\u001b[36;1m┌───┐ │ ╶─╮ ┌─╮ ╭─╮ \u001b[36m╷ ╷ ╷ ┌─┬─╮'); @@ -200,7 +216,6 @@ export class LangiumGenerator extends Generator { this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_LANGUAGE}`)); const languageFiles = [ 'package.json', - 'langium-config.json', 'README.md', 'tsconfig.json', 'tsconfig.src.json', @@ -219,6 +234,26 @@ export class LangiumGenerator extends Generator { ); } + const langiumConfigJson = { + projectName: languageName, + languages: [{ + id: languageId, + grammar: `src/${languageId}.langium`, + fileExtensions: [ fileExtensionGlob ], + textMate: { + out: `syntaxes/${languageId}.tmLanguage.json` + } + } as LangiumLanguageConfigSubset], + out: 'src/generated' + }; + + let languageIndex = `export * from './${languageId}-module.js'; +export * from './${languageId}-validator.js'; +export * from './generated/ast.js'; +export * from './generated/grammar.js'; +export * from './generated/module.js'; +`; + if (this.answers.includeTest) { mainPackageJson.scripts.test = 'npm run --workspace packages/language test'; @@ -278,8 +313,19 @@ export class LangiumGenerator extends Generator { } mainPackageJson.workspaces.push('packages/web'); tsConfigBuildJson.references.push({ path: './packages/web/tsconfig.json' }); + + this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_LANGUAGE}`)); + langiumConfigJson.languages[0].monarch = { + out: `src/syntaxes/${languageId}.monarch.ts` + }; + + languageIndex = languageIndex?.concat(`\nexport { default as monarchSyntax } from './syntaxes/${languageId}.monarch.js';`); } + // Write language index.ts and langium-config.json after possible alteration from web inclusion + this.fs.write(this._extensionPath('packages/language/src/index.ts'), languageIndex); + this.fs.writeJSON(this._extensionPath('packages/language/langium-config.json'), langiumConfigJson, undefined, 4); + if (this.answers.includeVSCode) { this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_EXTENSION}`)); const extensionFiles = [ diff --git a/packages/generator-langium/templates/packages/language/langium-config.json b/packages/generator-langium/templates/packages/language/langium-config.json deleted file mode 100644 index 8326d9efe..000000000 --- a/packages/generator-langium/templates/packages/language/langium-config.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "projectName": "<%= LanguageName %>", - "languages": [{ - "id": "<%= language-id %>", - "grammar": "src/<%= language-id %>.langium", - "fileExtensions": <%= file-extension %>, - "textMate": { - "out": "syntaxes/<%= language-id %>.tmLanguage.json" - }, - "monarch": { - "out": "src/syntaxes/<%= language-id %>.monarch.ts" - } - }], - "out": "src/generated" -} diff --git a/packages/generator-langium/templates/packages/language/src/index.ts b/packages/generator-langium/templates/packages/language/src/index.ts deleted file mode 100644 index 32a299ef0..000000000 --- a/packages/generator-langium/templates/packages/language/src/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './<%= language-id %>-module.js'; -export * from './<%= language-id %>-validator.js'; -export * from './generated/ast.js'; -export * from './generated/grammar.js'; -export * from './generated/module.js'; -export { default as monarchSyntax } from './syntaxes/<%= language-id %>.monarch.js'; diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 441448417..4e4eb42ac 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -41,11 +41,11 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/language/src/hello-world-module.ts', targetRoot + '/packages/language/src/hello-world-validator.ts', targetRoot + '/packages/language/src/hello-world.langium', - targetRoot + '/packages/language/src/syntaxes/hello-world.monarch.ts', targetRoot + '/packages/language/src/generated/ast.ts', targetRoot + '/packages/language/src/generated/grammar.ts', targetRoot + '/packages/language/src/generated/module.ts', - targetRoot + '/packages/language/syntaxes/hello-world.tmLanguage.json' + targetRoot + '/packages/language/syntaxes/hello-world.tmLanguage.json', + targetRoot + '/packages/language/langium-config.json' ]; const filesTest = (targetRoot: string) => [ @@ -80,6 +80,8 @@ describe('Check yeoman generator works', () => { targetRoot + '/packages/web/tsconfig.json', targetRoot + '/packages/web/vite.config.ts', targetRoot + '/packages/web/README.md', + // only present when web project was selected + targetRoot + '/packages/language/src/syntaxes/hello-world.monarch.ts' ]; const filesExtension = (targetRoot: string) => [ From 782a12eee7fc36f7a8fdc4221f3a1405fc487df5 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Mon, 8 Jul 2024 13:33:42 +0200 Subject: [PATCH 13/15] fix: correction to cli --- packages/generator-langium/templates/packages/cli/bin/cli.js | 2 +- packages/generator-langium/templates/packages/cli/src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/generator-langium/templates/packages/cli/bin/cli.js b/packages/generator-langium/templates/packages/cli/bin/cli.js index e166dc613..697962f65 100644 --- a/packages/generator-langium/templates/packages/cli/bin/cli.js +++ b/packages/generator-langium/templates/packages/cli/bin/cli.js @@ -1,4 +1,4 @@ #!/usr/bin/env node -import main from '../out/cli/main.js'; +import main from '../out/main.js'; main(); diff --git a/packages/generator-langium/templates/packages/cli/src/main.ts b/packages/generator-langium/templates/packages/cli/src/main.ts index 41ab16def..a03006b86 100644 --- a/packages/generator-langium/templates/packages/cli/src/main.ts +++ b/packages/generator-langium/templates/packages/cli/src/main.ts @@ -10,7 +10,7 @@ import * as fs from 'node:fs/promises'; import * as path from 'node:path'; const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); -const packagePath = path.resolve(__dirname, '..', '..', 'package.json'); +const packagePath = path.resolve(__dirname, '..', 'package.json'); const packageContent = await fs.readFile(packagePath, 'utf-8'); export const generateAction = async (fileName: string, opts: GenerateOptions): Promise => { From cff11baab391cab8c976ca599839976d7c6d76f5 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Thu, 8 Aug 2024 15:26:20 +0200 Subject: [PATCH 14/15] Rebased branch once more and contained smaller changes due to further review comments --- packages/generator-langium/templates/gitignore.txt | 1 + packages/generator-langium/templates/package.json | 2 +- .../templates/packages/extension/package.json | 5 ++++- packages/generator-langium/test/yeoman-generator.test.ts | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/generator-langium/templates/gitignore.txt b/packages/generator-langium/templates/gitignore.txt index 06e1951c0..d78f76825 100644 --- a/packages/generator-langium/templates/gitignore.txt +++ b/packages/generator-langium/templates/gitignore.txt @@ -8,3 +8,4 @@ out/ **/src/generated syntaxes/ *.tsbuildinfo +*.vsix diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json index aa7b19ca9..3a356c31e 100644 --- a/packages/generator-langium/templates/package.json +++ b/packages/generator-langium/templates/package.json @@ -9,7 +9,7 @@ "watch": "tsc -b tsconfig.build.json --watch", "build": "tsc -b tsconfig.build.json && npm run build --workspaces", "build:clean": "npm run clean && npm run build", - "lint": "eslint src --ext ts", + "lint": "eslint {**/src/**/*.ts,**/src/**/*.tsx,**/test/**/*.ts,**/test/**/*.tsx}", "langium:generate": "npm run --workspace packages/language langium:generate", "langium:watch": "npm run --workspace packages/language langium:watch" }, diff --git a/packages/generator-langium/templates/packages/extension/package.json b/packages/generator-langium/templates/packages/extension/package.json index 9c09bd22b..ac065c4af 100644 --- a/packages/generator-langium/templates/packages/extension/package.json +++ b/packages/generator-langium/templates/packages/extension/package.json @@ -28,7 +28,7 @@ "main": "./out/extension/main.cjs", "scripts": { "clean": "shx rm -fr *.tsbuildinfo out syntaxes", - "vscode:prepublish": "npm run build && npm run lint", + "vscode:prepublish": "npm run build && npm run --prefix ../.. lint", "build:prepare": "shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/<%= language-id %>.tmLanguage.json ./syntaxes/<%= language-id %>.tmLanguage.json", "build": "npm run build:prepare && tsc -b tsconfig.json && node esbuild.mjs", "build:clean": "npm run clean && npm run build", @@ -43,5 +43,8 @@ "@types/vscode": "~1.67.0", "concurrently": "~8.2.2", "esbuild": "~0.23.0" + }, + "vsce": { + "dependencies": false } } diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 4e4eb42ac..7396e14bd 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -248,7 +248,7 @@ const PACKAGE_JSON_EXPECTATION: Record = { 'watch': 'tsc -b tsconfig.build.json --watch', 'build': 'tsc -b tsconfig.build.json && npm run build --workspaces', 'build:clean': 'npm run clean && npm run build', - 'lint': 'eslint src --ext ts', + 'lint': 'eslint {**/src/**/*.ts,**/src/**/*.tsx,**/test/**/*.ts,**/test/**/*.tsx}', 'langium:generate': 'npm run --workspace packages/language langium:generate', 'langium:watch': 'npm run --workspace packages/language langium:watch' }, @@ -366,7 +366,7 @@ const PACKAGE_JSON_EXPECTATION_EXTENSION: Record = { main: './out/extension/main.cjs', scripts: { 'clean': 'shx rm -fr *.tsbuildinfo out syntaxes', - 'vscode:prepublish': 'npm run build && npm run lint', + 'vscode:prepublish': 'npm run build && npm run --prefix ../.. lint', 'build:prepare': 'shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/hello-world.tmLanguage.json ./syntaxes/hello-world.tmLanguage.json', 'build': 'npm run build:prepare && tsc -b tsconfig.json && node esbuild.mjs', 'build:clean': 'npm run clean && npm run build', From 6f10baa7d5f6c93610aae7683945fb8320f5dfec Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Mon, 12 Aug 2024 10:37:44 +0200 Subject: [PATCH 15/15] Do not use "run --prefix" and align eslint+plugin version with typescript --- package-lock.json | 224 ++++++++++-------- package.json | 6 +- .../generator-langium/templates/package.json | 4 +- .../templates/packages/extension/package.json | 2 +- .../test/yeoman-generator.test.ts | 8 +- packages/generator-langium/tsconfig.test.json | 3 +- 6 files changed, 131 insertions(+), 116 deletions(-) diff --git a/package-lock.json b/package-lock.json index 44da10e30..377b4fed2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,14 +20,14 @@ "devDependencies": { "@types/node": "~16.18.41", "@types/vscode": "~1.67.0", - "@typescript-eslint/eslint-plugin": "~6.4.1", - "@typescript-eslint/parser": "~6.4.1", + "@typescript-eslint/eslint-plugin": "~7.18.0", + "@typescript-eslint/parser": "~7.18.0", "@vitest/coverage-v8": "~1.6.0", "@vitest/ui": "~1.6.0", "concurrently": "~8.2.1", "editorconfig": "~2.0.0", "esbuild": "~0.19.2", - "eslint": "~8.56.0", + "eslint": "~8.57.0", "eslint-plugin-header": "~3.1.1", "shx": "~0.3.4", "typescript": "~5.4.5", @@ -792,9 +792,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.7.0.tgz", - "integrity": "sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -824,9 +824,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1675,12 +1675,6 @@ "rxjs": "^7.2.0" } }, - "node_modules/@types/json-schema": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", - "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", - "dev": true - }, "node_modules/@types/jsonfile": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", @@ -1736,12 +1730,6 @@ "@types/node": "*" } }, - "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", - "dev": true - }, "node_modules/@types/through": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@types/through/-/through-0.0.30.tgz", @@ -1766,33 +1754,31 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz", - "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", + "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.4.1", - "@typescript-eslint/type-utils": "6.4.1", - "@typescript-eslint/utils": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/type-utils": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1800,27 +1786,36 @@ } } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/@typescript-eslint/parser": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz", - "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.4.1", - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/typescript-estree": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1829,16 +1824,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz", - "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1" + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1846,25 +1841,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz", - "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.4.1", - "@typescript-eslint/utils": "6.4.1", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1873,12 +1868,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz", - "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1886,21 +1881,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz", - "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/visitor-keys": "6.4.1", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -1912,42 +1908,63 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/utils": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz", - "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.4.1", - "@typescript-eslint/types": "6.4.1", - "@typescript-eslint/typescript-estree": "6.4.1", - "semver": "^7.5.4" + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz", - "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.4.1", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -4298,16 +4315,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -7304,6 +7321,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -9691,12 +9709,9 @@ "devOptional": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -10866,12 +10881,12 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", - "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" @@ -12320,7 +12335,8 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "devOptional": true }, "node_modules/yargs-parser": { "version": "10.1.0", diff --git a/package.json b/package.json index b300f710e..cd29b6fc5 100644 --- a/package.json +++ b/package.json @@ -26,14 +26,14 @@ "devDependencies": { "@types/node": "~16.18.41", "@types/vscode": "~1.67.0", - "@typescript-eslint/eslint-plugin": "~6.4.1", - "@typescript-eslint/parser": "~6.4.1", + "@typescript-eslint/eslint-plugin": "~7.18.0", + "@typescript-eslint/parser": "~7.18.0", "@vitest/coverage-v8": "~1.6.0", "@vitest/ui": "~1.6.0", "concurrently": "~8.2.1", "editorconfig": "~2.0.0", "esbuild": "~0.19.2", - "eslint": "~8.56.0", + "eslint": "~8.57.0", "eslint-plugin-header": "~3.1.1", "shx": "~0.3.4", "typescript": "~5.4.5", diff --git a/packages/generator-langium/templates/package.json b/packages/generator-langium/templates/package.json index 3a356c31e..4667cbe51 100644 --- a/packages/generator-langium/templates/package.json +++ b/packages/generator-langium/templates/package.json @@ -15,8 +15,8 @@ }, "devDependencies": { "@types/node": "^18.0.0", - "@typescript-eslint/parser": "~7.15.0", - "@typescript-eslint/eslint-plugin": "~7.15.0", + "@typescript-eslint/parser": "~7.18.0", + "@typescript-eslint/eslint-plugin": "~7.18.0", "eslint": "~8.57.0", "shx": "~0.3.4", "typescript": "~5.5.3" diff --git a/packages/generator-langium/templates/packages/extension/package.json b/packages/generator-langium/templates/packages/extension/package.json index ac065c4af..f09953f02 100644 --- a/packages/generator-langium/templates/packages/extension/package.json +++ b/packages/generator-langium/templates/packages/extension/package.json @@ -28,7 +28,7 @@ "main": "./out/extension/main.cjs", "scripts": { "clean": "shx rm -fr *.tsbuildinfo out syntaxes", - "vscode:prepublish": "npm run build && npm run --prefix ../.. lint", + "vscode:prepublish": "npm run build && npm run --include-workspace-root --workspace=../.. lint", "build:prepare": "shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/<%= language-id %>.tmLanguage.json ./syntaxes/<%= language-id %>.tmLanguage.json", "build": "npm run build:prepare && tsc -b tsconfig.json && node esbuild.mjs", "build:clean": "npm run clean && npm run build", diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 7396e14bd..ee16dede0 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -10,7 +10,7 @@ import * as url from 'node:url'; import { describe, test } from 'vitest'; import type * as Generator from 'yeoman-generator'; import { createHelpers } from 'yeoman-test'; -import type { Answers, LangiumGenerator, PostAnwers } from '../src/index.js'; +import type { Answers, LangiumGenerator, PostAnwers } from 'generator-langium'; const answersForCore: Answers & PostAnwers = { extensionName: 'hello-world', @@ -254,8 +254,8 @@ const PACKAGE_JSON_EXPECTATION: Record = { }, 'devDependencies': { '@types/node': '^18.0.0', - '@typescript-eslint/eslint-plugin': '~7.15.0', - '@typescript-eslint/parser': '~7.15.0', + '@typescript-eslint/eslint-plugin': '~7.18.0', + '@typescript-eslint/parser': '~7.18.0', 'eslint': '~8.57.0', 'shx': '~0.3.4', 'typescript': '~5.5.3' @@ -366,7 +366,7 @@ const PACKAGE_JSON_EXPECTATION_EXTENSION: Record = { main: './out/extension/main.cjs', scripts: { 'clean': 'shx rm -fr *.tsbuildinfo out syntaxes', - 'vscode:prepublish': 'npm run build && npm run --prefix ../.. lint', + 'vscode:prepublish': 'npm run build && npm run --include-workspace-root --workspace=../.. lint', 'build:prepare': 'shx mkdir -p ./syntaxes/ && shx cp -f ../language/syntaxes/hello-world.tmLanguage.json ./syntaxes/hello-world.tmLanguage.json', 'build': 'npm run build:prepare && tsc -b tsconfig.json && node esbuild.mjs', 'build:clean': 'npm run clean && npm run build', diff --git a/packages/generator-langium/tsconfig.test.json b/packages/generator-langium/tsconfig.test.json index f3136b8c2..1bf4aa90c 100644 --- a/packages/generator-langium/tsconfig.test.json +++ b/packages/generator-langium/tsconfig.test.json @@ -9,8 +9,7 @@ }], "include": [ "test/**/*", - ] - , + ], "exclude": [ "test/generator-tests", ]