From f97b1af00aca336d65009d59831c5e520bd91774 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Wed, 29 May 2024 17:08:59 +0200 Subject: [PATCH 01/17] 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 ebeff54bd005f974639c28c8e78fb3f3bd6af9bb Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 14 Jun 2024 11:37:51 +0200 Subject: [PATCH 02/17] 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 | 744 +++++++++--------- package.json | 7 +- 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, 684 insertions(+), 492 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 0765aa9d7..b49b55173 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.1.6", - "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.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", "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,9 +328,9 @@ } }, "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.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -320,13 +352,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.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -374,9 +406,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" ], @@ -992,21 +1024,15 @@ "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 +1359,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", "cpu": [ "arm" ], @@ -1346,9 +1372,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", "cpu": [ "arm64" ], @@ -1359,9 +1385,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", + "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", "cpu": [ "arm64" ], @@ -1372,9 +1398,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", "cpu": [ "x64" ], @@ -1385,9 +1411,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", "cpu": [ "arm" ], @@ -1398,9 +1424,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", "cpu": [ "arm" ], @@ -1411,9 +1437,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", "cpu": [ "arm64" ], @@ -1424,9 +1450,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", "cpu": [ "arm64" ], @@ -1437,9 +1463,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", "cpu": [ "ppc64" ], @@ -1450,9 +1476,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", "cpu": [ "riscv64" ], @@ -1463,9 +1489,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", "cpu": [ "s390x" ], @@ -1476,9 +1502,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", "cpu": [ "x64" ], @@ -1489,9 +1515,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", "cpu": [ "x64" ], @@ -1502,9 +1528,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", "cpu": [ "arm64" ], @@ -1515,9 +1541,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", "cpu": [ "ia32" ], @@ -1528,9 +1554,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.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", "cpu": [ "x64" ], @@ -1632,16 +1658,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 +1672,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 +1958,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 +1968,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 +1999,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" }, @@ -2030,9 +2040,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 +2054,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 +2066,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 +2083,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 +2616,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.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", + "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2627,10 +2637,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" } @@ -3493,6 +3506,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 +3625,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 +3687,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 +3875,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 +4643,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 +5804,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 +6887,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.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", + "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", "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 +7014,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 +7300,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.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" } }, "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 +7798,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 +8883,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": { @@ -8952,14 +8944,14 @@ } }, "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.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", + "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", "dev": true, "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" + "confbox": "^0.1.7", + "mlly": "^1.7.0", + "pathe": "^1.1.2" } }, "node_modules/postcss": { @@ -9210,9 +9202,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 +9574,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.18.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", + "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -9597,22 +9589,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.18.0", + "@rollup/rollup-android-arm64": "4.18.0", + "@rollup/rollup-darwin-arm64": "4.18.0", + "@rollup/rollup-darwin-x64": "4.18.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", + "@rollup/rollup-linux-arm-musleabihf": "4.18.0", + "@rollup/rollup-linux-arm64-gnu": "4.18.0", + "@rollup/rollup-linux-arm64-musl": "4.18.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", + "@rollup/rollup-linux-riscv64-gnu": "4.18.0", + "@rollup/rollup-linux-s390x-gnu": "4.18.0", + "@rollup/rollup-linux-x64-gnu": "4.18.0", + "@rollup/rollup-linux-x64-musl": "4.18.0", + "@rollup/rollup-win32-arm64-msvc": "4.18.0", + "@rollup/rollup-win32-ia32-msvc": "4.18.0", + "@rollup/rollup-win32-x64-msvc": "4.18.0", "fsevents": "~2.3.2" } }, @@ -9977,15 +9969,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 +10041,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 +10748,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.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", "dev": true }, "node_modules/tinypool": { @@ -10988,9 +10971,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.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", "dev": true }, "node_modules/undici-types": { @@ -11355,20 +11338,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", @@ -11411,12 +11380,12 @@ } }, "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.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.1.tgz", + "integrity": "sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==", "dev": true, "dependencies": { - "esbuild": "^0.20.1", + "esbuild": "^0.21.3", "postcss": "^8.4.38", "rollup": "^4.13.0" }, @@ -11466,9 +11435,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", @@ -11488,9 +11457,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" ], @@ -11504,9 +11473,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" ], @@ -11520,9 +11489,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" ], @@ -11536,9 +11505,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" ], @@ -11552,9 +11521,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" ], @@ -11568,9 +11537,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" ], @@ -11584,9 +11553,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" ], @@ -11600,9 +11569,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" ], @@ -11616,9 +11585,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" ], @@ -11632,9 +11601,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" ], @@ -11648,9 +11617,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" ], @@ -11664,9 +11633,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" ], @@ -11680,9 +11649,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" ], @@ -11696,9 +11665,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" ], @@ -11712,9 +11681,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" ], @@ -11728,9 +11697,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" ], @@ -11744,9 +11713,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" ], @@ -11760,9 +11729,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" ], @@ -11776,9 +11745,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" ], @@ -11792,9 +11761,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" ], @@ -11808,9 +11777,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" ], @@ -11824,9 +11793,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" ], @@ -11840,9 +11809,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": { @@ -11852,42 +11821,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", @@ -11901,7 +11870,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": { @@ -11916,8 +11885,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": "*" }, @@ -13280,10 +13249,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", @@ -13332,9 +13301,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.5", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-MBIOHVZqVqgfro1euRDWX7OO0fBVUUMrN6Pwm8LQsz8cWhEpihlvR70ENj3f40j58TNxZaWv2ndSkInykNBBJw==", "dev": true }, "packages/generator-langium/node_modules/@types/which": { @@ -13991,8 +13960,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", @@ -14002,12 +13971,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", @@ -14019,6 +13998,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 497d09f3a..24c241023 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "lint": "npm run lint --workspaces", "test": "vitest", "test-ui": "vitest --ui", + "test:run": "vitest run", "coverage": "vitest run --coverage", "validate-exports": "npm run validate-exports --workspace=langium", "version:dependencies": "node ./scripts/update-version.js && npm install", @@ -27,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", "esbuild": "~0.19.2", "eslint": "~8.56.0", @@ -36,7 +37,7 @@ "editorconfig": "~2.0.0", "shx": "~0.3.4", "typescript": "~5.1.6", - "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 a756d0a2cd8c9f6d6fef2e8eda48f476558d184e Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 14 Jun 2024 11:52:27 +0200 Subject: [PATCH 03/17] 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 c6dc9297ce359f5f8200bc7fff69b670ee0ab6d0 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 14 Jun 2024 13:49:16 +0200 Subject: [PATCH 04/17] 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 4411b25c23c8c0dd0f34e9fcc6b4714f5d6fcd90 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Sat, 15 Jun 2024 18:22:40 +0200 Subject: [PATCH 05/17] 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 5cc78c46fa1c096e6b2f1c4226792e2c0bafe559 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Sun, 16 Jun 2024 09:56:30 +0200 Subject: [PATCH 06/17] 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 c0e73c436b01f7e4d75939661987aa3cb639b79d Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Wed, 19 Jun 2024 10:43:39 +0200 Subject: [PATCH 07/17] 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 d3ed623b22dbcb58ee5a0e820072b100fb0e1a0f Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 21 Jun 2024 14:22:52 +0200 Subject: [PATCH 08/17] 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 38d69547039080d256b2fb80656eea5e481593f8 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Tue, 2 Jul 2024 19:17:15 +0200 Subject: [PATCH 09/17] 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 3c0b81de7b244a72f35e56bf0ab23c5e51c2d811 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 5 Jul 2024 16:40:16 +0200 Subject: [PATCH 10/17] 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 1067de6b688b9d99c9f1130a63ec40942684ed43 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Fri, 5 Jul 2024 16:54:48 +0200 Subject: [PATCH 11/17] 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 069f622c1ff6ca4a2ea9cc125ea93c169ee071e9 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Mon, 8 Jul 2024 10:05:21 +0200 Subject: [PATCH 12/17] 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 42e3a41943e09b1045ec67514fc841b7ac587c79 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Mon, 8 Jul 2024 13:33:42 +0200 Subject: [PATCH 13/17] 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 149b6a3e72f7bbd4336718b535c4dd693cb02084 Mon Sep 17 00:00:00 2001 From: Abdelrahman Abounegm Date: Tue, 6 Aug 2024 18:48:51 +0300 Subject: [PATCH 14/17] Add prompt option for IntelliJ --- packages/generator-langium/src/index.ts | 12 ++++++++++++ .../generator-langium/test/yeoman-generator.test.ts | 1 + 2 files changed, 13 insertions(+) diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index a4500cb40..7d9110b33 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -38,6 +38,7 @@ export interface Answers { rawLanguageName: string; fileExtensions: string; includeVSCode: boolean; + includeIntelliJ: boolean; includeCLI: boolean; includeWeb: boolean; includeTest: boolean; @@ -135,6 +136,17 @@ export class LangiumGenerator extends Generator { message: 'Include VSCode extension?', default: 'yes' }, + { + type: 'confirm', + name: 'includeIntelliJ', + // Currently, the IntelliJ plugin depends on files generated for the VS Code extension. + when: (answers: Answers): boolean => answers.includeVSCode, + prefix: description( + 'Your language can be run inside of a JetBrains IntelliJ-based IDE plugin.' + ), + message: 'Include IntelliJ integration?', + default: 'yes', + }, { type: 'confirm', name: 'includeCLI', diff --git a/packages/generator-langium/test/yeoman-generator.test.ts b/packages/generator-langium/test/yeoman-generator.test.ts index 4e4eb42ac..b1781f235 100644 --- a/packages/generator-langium/test/yeoman-generator.test.ts +++ b/packages/generator-langium/test/yeoman-generator.test.ts @@ -17,6 +17,7 @@ const answersForCore: Answers & PostAnwers = { rawLanguageName: 'Hello World', fileExtensions: '.hello', includeVSCode: false, + includeIntelliJ: false, includeCLI: false, includeWeb: false, includeTest: false, From 50b2af598f5d5ceefe4e4439798ee3fc5796d043 Mon Sep 17 00:00:00 2001 From: Abdelrahman Abounegm Date: Tue, 6 Aug 2024 18:50:25 +0300 Subject: [PATCH 15/17] Add placeholders for Java's style --- packages/generator-langium/src/index.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index 7d9110b33..30347399d 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -26,10 +26,13 @@ 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 FILE_EXTENSION_DEFAULT = /<%= file-extension-default %>/g; +const FILE_EXTENSIONS_SEMI = /<%= file-extensions-semi %>/g; const LANGUAGE_NAME = /<%= LanguageName %>/g; const LANGUAGE_ID = /<%= language-id %>/g; const LANGUAGE_PATH_ID = /language-id/g; +const LANGUAGE_PATH_UPPER = /LanguageId/g; const NEWLINES = /\r?\n/g; @@ -188,6 +191,8 @@ export class LangiumGenerator extends Generator { this.answers.fileExtensions = `[${fileExtensions.map(ext => `".${ext}"`).join(', ')}]`; const fileExtensionGlob = fileExtensions.length > 1 ? `{${fileExtensions.join(',')}}` : fileExtensions[0]; + const fileExtensionDefault = fileExtensions[0]; + const fileExtensionSemi = fileExtensions.join(';'); this.answers.rawLanguageName = this.answers.rawLanguageName.replace( /(?![\w| |\-|_])./g, @@ -199,8 +204,8 @@ export class LangiumGenerator extends Generator { const languageId = _.kebabCase(this.answers.rawLanguageName); const templateCopyOptions: CopyOptions = { - process: content => this._replaceTemplateWords(fileExtensionGlob, languageName, languageId, content), - processDestinationPath: path => this._replaceTemplateNames(languageId, path) + process: content => this._replaceTemplateWords(fileExtensionGlob, fileExtensionDefault, fileExtensionSemi, languageName, languageId, content), + processDestinationPath: path => this._replaceTemplateNames(languageId, languageName, path) }; const pathBase = path.join(__dirname, BASE_DIR); @@ -409,19 +414,23 @@ export * from './generated/module.js'; return this.destinationPath(USER_DIR, this.answers.extensionName, ...path); } - _replaceTemplateWords(fileExtensionGlob: string, languageName: string, languageId: string, content: string | Buffer): string { + _replaceTemplateWords(fileExtensionGlob: string, fileExtensionDefault: string, fileExtensionsSemi: 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) .replace(FILE_EXTENSION, this.answers.fileExtensions) .replace(FILE_EXTENSION_GLOB, fileExtensionGlob) + .replace(FILE_EXTENSION_DEFAULT, fileExtensionDefault) + .replace(FILE_EXTENSIONS_SEMI, fileExtensionsSemi) .replace(LANGUAGE_NAME, languageName) .replace(LANGUAGE_ID, languageId) .replace(NEWLINES, EOL); } - _replaceTemplateNames(languageId: string, path: string): string { - return path.replace(LANGUAGE_PATH_ID, languageId); + _replaceTemplateNames(languageId: string, languageName: string, path: string): string { + return path + .replace(LANGUAGE_PATH_ID, languageId) + .replace(LANGUAGE_PATH_UPPER, languageName); } } From 13bc0f210aa8b557d8f6cb68d5626cca7001e908 Mon Sep 17 00:00:00 2001 From: Abdelrahman Abounegm Date: Tue, 6 Aug 2024 18:50:36 +0300 Subject: [PATCH 16/17] Add IntelliJ plugin template --- packages/generator-langium/src/index.ts | 24 ++ .../packages/intellij-plugin/.gitignore | 5 + .../packages/intellij-plugin/CHANGELOG.md | 5 + .../packages/intellij-plugin/README.md | 23 ++ .../packages/intellij-plugin/build.gradle.kts | 153 +++++++++++ .../intellij-plugin/gradle.properties | 34 +++ .../intellij-plugin/gradle/libs.versions.toml | 20 ++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43504 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + .../packages/intellij-plugin/gradlew | 252 ++++++++++++++++++ .../packages/intellij-plugin/gradlew.bat | 94 +++++++ .../intellij-plugin/settings.gradle.kts | 1 + .../LanguageId/lang/LanguageIdFileType.kt | 16 ++ .../kotlin/LanguageId/lang/LanguageIdIcons.kt | 8 + .../LanguageId/lang/LanguageIdLanguage.kt | 7 + .../lang/LanguageIdLanguageServer.kt | 26 ++ .../lang/LanguageIdLanguageServerFactory.kt | 9 + .../lang/LanguageIdTextMateBundleProvider.kt | 13 + .../src/main/resources/META-INF/plugin.xml | 45 ++++ .../main/resources/META-INF/pluginIcon.svg | 28 ++ .../main/resources/icons/language-id-logo.svg | 28 ++ 21 files changed, 798 insertions(+) create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/.gitignore create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/README.md create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/gradle.properties create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/gradle/libs.versions.toml create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/gradle/wrapper/gradle-wrapper.jar create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/gradle/wrapper/gradle-wrapper.properties create mode 100755 packages/generator-langium/templates/packages/intellij-plugin/gradlew create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/gradlew.bat create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/settings.gradle.kts create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdFileType.kt create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdIcons.kt create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguage.kt create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServer.kt create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServerFactory.kt create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdTextMateBundleProvider.kt create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/plugin.xml create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/pluginIcon.svg create mode 100644 packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/icons/language-id-logo.svg diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index 30347399d..70091be81 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -20,6 +20,7 @@ const PACKAGE_LANGUAGE = 'packages/language'; const PACKAGE_CLI = 'packages/cli'; const PACKAGE_WEB = 'packages/web'; const PACKAGE_EXTENSION = 'packages/extension'; +const PACKAGE_INTELLIJ = 'packages/intellij-plugin'; const USER_DIR = '.'; const EXTENSION_NAME = /<%= extension-name %>/g; @@ -365,6 +366,29 @@ export * from './generated/module.js'; tsConfigBuildJson.references.push({ path: './packages/extension/tsconfig.json' }); } + if (this.answers.includeIntelliJ) { + this.sourceRoot(path.join(__dirname, `${BASE_DIR}/${PACKAGE_INTELLIJ}`)); + const pluginFiles = [ + 'gradle', + 'src', + '.gitignore', + 'build.gradle.kts', + 'CHANGELOG.md', + 'gradle.properties', + 'gradlew', + 'gradlew.bat', + 'README.md', + 'settings.gradle.kts', + ]; + for (const path of pluginFiles) { + this.fs.copy( + this.templatePath(path), + this._extensionPath(`${PACKAGE_INTELLIJ}/${path}`), + templateCopyOptions + ); + } + } + this.fs.writeJSON(this._extensionPath('.package.json'), mainPackageJson, undefined, 4); this.fs.move(this._extensionPath('.package.json'), this._extensionPath('package.json'), templateCopyOptions); diff --git a/packages/generator-langium/templates/packages/intellij-plugin/.gitignore b/packages/generator-langium/templates/packages/intellij-plugin/.gitignore new file mode 100644 index 000000000..ffabde684 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/.gitignore @@ -0,0 +1,5 @@ +.gradle +.idea +.intellijPlatform +.qodana +build diff --git a/packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md b/packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md new file mode 100644 index 000000000..6a18e05b9 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md @@ -0,0 +1,5 @@ + + +# <%= LanguageName %> Changelog + +## Unreleased diff --git a/packages/generator-langium/templates/packages/intellij-plugin/README.md b/packages/generator-langium/templates/packages/intellij-plugin/README.md new file mode 100644 index 000000000..5ea8c6009 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/README.md @@ -0,0 +1,23 @@ +# <%= LanguageName %> IntelliJ plugin + + + + + +This plugin adds support for the <%= LanguageName %> language in JetBrains IntelliJ-based IDEs. + + + +## Installation + +- Using the IDE built-in plugin system: + + Settings/Preferences > Plugins > Marketplace > Search for "<%= LanguageName %>" > + Install + +--- + +Plugin based on the [IntelliJ Platform Plugin Template][template]. + +[template]: https://github.com/JetBrains/intellij-platform-plugin-template diff --git a/packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts b/packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts new file mode 100644 index 000000000..ae08c8023 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts @@ -0,0 +1,153 @@ +import org.jetbrains.changelog.Changelog +import org.jetbrains.changelog.markdownToHTML + +plugins { + id("java") // Java support + alias(libs.plugins.kotlin) // Kotlin support + alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin + alias(libs.plugins.changelog) // Gradle Changelog Plugin + alias(libs.plugins.qodana) // Gradle Qodana Plugin + alias(libs.plugins.kover) // Gradle Kover Plugin +} + +group = providers.gradleProperty("pluginGroup").get() +version = providers.gradleProperty("pluginVersion").get() + +// Set the JVM language level used to build the project. +kotlin { + jvmToolchain(17) +} + +// Configure project's dependencies +repositories { + mavenCentral() + + // IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html + intellijPlatform { + defaultRepositories() + } +} + +// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog +dependencies { + // IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html + intellijPlatform { + plugin("com.redhat.devtools.lsp4ij:0.3.0") + bundledPlugin("org.jetbrains.plugins.textmate") + + create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) + + // Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins. + bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') }) + + // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace. + plugins(providers.gradleProperty("platformPlugins").map { it.split(',') }) + + instrumentationTools() + pluginVerifier() + zipSigner() + } +} + +// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html +intellijPlatform { + pluginConfiguration { + name = providers.gradleProperty("pluginName") + + version = providers.gradleProperty("pluginVersion") + + // Extract the section from README.md and provide for the plugin's manifest + description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map { + val start = "" + val end = "" + + with(it.lines()) { + if (!containsAll(listOf(start, end))) { + throw GradleException("Plugin description section not found in README.md:\n$start ... $end") + } + subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML) + } + } + + val changelog = project.changelog // local variable for configuration cache compatibility + // Get the latest available change notes from the changelog file + changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion -> + with(changelog) { + renderItem( + (getOrNull(pluginVersion) ?: getUnreleased()) + .withHeader(false) + .withEmptySections(false), + Changelog.OutputType.HTML, + ) + } + } + + ideaVersion { + sinceBuild = providers.gradleProperty("pluginSinceBuild") + untilBuild = providers.gradleProperty("pluginUntilBuild") + } + } + + signing { + certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN") + privateKey = providers.environmentVariable("PRIVATE_KEY") + password = providers.environmentVariable("PRIVATE_KEY_PASSWORD") + } + + publishing { + token = providers.environmentVariable("PUBLISH_TOKEN") + // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3 + // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more: + // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel + channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) } + } + + pluginVerification { + ides { + recommended() + } + } +} + +// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin +changelog { + groups.empty() + repositoryUrl = providers.gradleProperty("pluginRepositoryUrl") +} + +// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration +kover { + reports { + total { + xml { + onCheck = true + } + } + } +} + +tasks { + prepareSandbox { + // Inspired by Prettier plugin (https://github.com/JetBrains/intellij-plugins/blob/master/prettierJS/build.gradle.kts) + from("../extension/out/language") { + include("main.cjs") + into("${intellijPlatform.pluginConfiguration.name.get()}/<%= LanguageName %>LanguageService") + } + + // Copy TextMate files from VS Code extension + from("../extension") { + include("package.json") + include("syntaxes/*.tmLanguage.json") + include("language-configuration.json") + into("${intellijPlatform.pluginConfiguration.name.get()}/textmate") + } + } + + wrapper { + gradleVersion = providers.gradleProperty("gradleVersion").get() + } + + publishPlugin { + dependsOn(patchChangelog) + } +} diff --git a/packages/generator-langium/templates/packages/intellij-plugin/gradle.properties b/packages/generator-langium/templates/packages/intellij-plugin/gradle.properties new file mode 100644 index 000000000..bdf40cf67 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/gradle.properties @@ -0,0 +1,34 @@ +# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html + +pluginGroup = <%= LanguageName %>.lang +pluginName = <%= LanguageName %> +pluginRepositoryUrl = +# SemVer format -> https://semver.org +pluginVersion = 0.0.1 + +# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html +# Version >= 2024.1 is required for the TextMate plugin +pluginSinceBuild = 241 +pluginUntilBuild = 242.* + +# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension +platformType = IC +platformVersion = 2024.1 + +# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html +# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP +platformPlugins = +# Example: platformBundledPlugins = com.intellij.java +platformBundledPlugins = + +# Gradle Releases -> https://github.com/gradle/gradle/releases +gradleVersion = 8.9 + +# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib +kotlin.stdlib.default.dependency = false + +# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html +org.gradle.configuration-cache = true + +# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html +org.gradle.caching = true diff --git a/packages/generator-langium/templates/packages/intellij-plugin/gradle/libs.versions.toml b/packages/generator-langium/templates/packages/intellij-plugin/gradle/libs.versions.toml new file mode 100644 index 000000000..1d97becec --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/gradle/libs.versions.toml @@ -0,0 +1,20 @@ +[versions] +# libraries +junit = "4.13.2" + +# plugins +changelog = "2.2.1" +intelliJPlatform = "2.0.0" +kotlin = "1.9.24" +kover = "0.8.1" +qodana = "2024.1.5" + +[libraries] +junit = { group = "junit", name = "junit", version.ref = "junit" } + +[plugins] +changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } +intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" } +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } +qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" } diff --git a/packages/generator-langium/templates/packages/intellij-plugin/gradle/wrapper/gradle-wrapper.jar b/packages/generator-langium/templates/packages/intellij-plugin/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..2c3521197d7c4586c843d1d3e9090525f1898cde GIT binary patch literal 43504 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`; zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf zR2h?lbDZQ`p9P;&DQ4F0sur@TMa!Y}S8irn(%d-gi0*WxxCSk*A?3lGh=gcYN?FGl z7D=Js!i~0=u3rox^eO3i@$0=n{K1lPNU zwmfjRVmLOCRfe=seV&P*1Iq=^i`502keY8Uy-WNPwVNNtJFx?IwAyRPZo2Wo1+S(xF37LJZ~%i)kpFQ3Fw=mXfd@>%+)RpYQLnr}B~~zoof(JVm^^&f zxKV^+3D3$A1G;qh4gPVjhrC8e(VYUHv#dy^)(RoUFM?o%W-EHxufuWf(l*@-l+7vt z=l`qmR56K~F|v<^Pd*p~1_y^P0P^aPC##d8+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*OVPfdKv z+t$Z5P!~jzZ~Y!d#iP?S{?M_g%Ua0Q)WawbIx+2uYpcf(7Im%W=rAu4dSceo7RZh# zN38=RmwOJQE$qbPXIuO^E`wSeJKCx3Q76irp~QS#19dusEVCWPrKhK9{7cbIMg9U} TZiJi*F`$tkWLn) literal 0 HcmV?d00001 diff --git a/packages/generator-langium/templates/packages/intellij-plugin/gradle/wrapper/gradle-wrapper.properties b/packages/generator-langium/templates/packages/intellij-plugin/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..09523c0e5 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/generator-langium/templates/packages/intellij-plugin/gradlew b/packages/generator-langium/templates/packages/intellij-plugin/gradlew new file mode 100755 index 000000000..f5feea6d6 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/gradlew @@ -0,0 +1,252 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/generator-langium/templates/packages/intellij-plugin/gradlew.bat b/packages/generator-langium/templates/packages/intellij-plugin/gradlew.bat new file mode 100644 index 000000000..9d21a2183 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/generator-langium/templates/packages/intellij-plugin/settings.gradle.kts b/packages/generator-langium/templates/packages/intellij-plugin/settings.gradle.kts new file mode 100644 index 000000000..add7271a9 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "<%= LanguageName %>" diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdFileType.kt b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdFileType.kt new file mode 100644 index 000000000..a2336e1d2 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdFileType.kt @@ -0,0 +1,16 @@ +package <%= LanguageName %>.lang + +import com.intellij.openapi.fileTypes.LanguageFileType +import javax.swing.Icon + +object <%= LanguageName %>FileType : LanguageFileType(<%= LanguageName %>Language.INSTANCE) { + val INSTANCE = <%= LanguageName %>FileType + + override fun getName(): String = "<%= LanguageName %>" + + override fun getDescription(): String = "<%= LanguageName %> language file" + + override fun getDefaultExtension(): String = "<%= file-extension-default %>" + + override fun getIcon(): Icon = <%= LanguageName %>Icons.Logo +} diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdIcons.kt b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdIcons.kt new file mode 100644 index 000000000..8be18cbfa --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdIcons.kt @@ -0,0 +1,8 @@ +package <%= LanguageName %>.lang + +import com.intellij.openapi.util.IconLoader + +object <%= LanguageName %>Icons { + @JvmField + val Logo = IconLoader.getIcon("/icons/<%= language-id %>-logo.svg", javaClass) +} diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguage.kt b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguage.kt new file mode 100644 index 000000000..ad382656f --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguage.kt @@ -0,0 +1,7 @@ +package <%= LanguageName %>.lang + +import com.intellij.lang.Language + +object <%= LanguageName %>Language : Language("<%= LanguageName %>") { + val INSTANCE: <%= LanguageName %>Language = <%= LanguageName %>Language +} diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServer.kt b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServer.kt new file mode 100644 index 000000000..88cc94881 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServer.kt @@ -0,0 +1,26 @@ +package <%= LanguageName %>.lang + +import com.intellij.openapi.project.Project +import com.redhat.devtools.lsp4ij.server.ProcessStreamConnectionProvider +import com.intellij.openapi.application.PluginPathManager +import com.intellij.util.EnvironmentUtil +import java.io.File +import java.nio.file.Paths +import kotlin.io.path.pathString + +class <%= LanguageName %>LanguageServer(project: Project) : ProcessStreamConnectionProvider() { + // Inspired by Haskell's IntelliJ plugin + private fun findExecutableInPATH(executable: String) = + EnvironmentUtil.getEnvironmentMap().values.flatMap { it.split(File.pathSeparator) } + .map { File(Paths.get(it, executable).pathString) }.find { it.exists() && it.canExecute() }?.path + + init { + val nodePath = findExecutableInPATH("node") ?: throw Exception("Could not find node in PATH") + + val lspExecPath = PluginPathManager.getPluginResource(this::class.java, "<%= LanguageName %>LanguageService/main.cjs")?.absolutePath + ?: throw Exception("Could not find main.cjs") + val commands: List = mutableListOf(nodePath, lspExecPath, "--stdio") + super.setCommands(commands) + super.setWorkingDirectory(project.basePath) + } +} diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServerFactory.kt b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServerFactory.kt new file mode 100644 index 000000000..b6b6942a6 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdLanguageServerFactory.kt @@ -0,0 +1,9 @@ +package <%= LanguageName %>.lang + +import com.intellij.openapi.project.Project +import com.redhat.devtools.lsp4ij.LanguageServerFactory +import com.redhat.devtools.lsp4ij.server.StreamConnectionProvider + +class <%= LanguageName %>LanguageServerFactory : LanguageServerFactory { + override fun createConnectionProvider(project: Project): StreamConnectionProvider = <%= LanguageName %>LanguageServer(project) +} diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdTextMateBundleProvider.kt b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdTextMateBundleProvider.kt new file mode 100644 index 000000000..aceec351d --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/kotlin/LanguageId/lang/LanguageIdTextMateBundleProvider.kt @@ -0,0 +1,13 @@ +package <%= LanguageName %>.lang + +import com.intellij.openapi.application.PluginPathManager +import org.jetbrains.plugins.textmate.api.TextMateBundleProvider +import org.jetbrains.plugins.textmate.api.TextMateBundleProvider.PluginBundle + +class <%= LanguageName %>TextMateBundleProvider : TextMateBundleProvider { + override fun getBundles(): List { + val textmateDir = PluginPathManager.getPluginResource(this::class.java, "textmate") ?: return emptyList() + val path = textmateDir.toPath() + return listOf(PluginBundle("<%= LanguageName %>", path)) + } +} diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/plugin.xml b/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/plugin.xml new file mode 100644 index 000000000..d801d97f3 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/plugin.xml @@ -0,0 +1,45 @@ + + + <%= LanguageName %>.lang + <%= LanguageName %> + <%= LanguageName %> + + com.intellij.modules.platform + com.redhat.devtools.lsp4ij + org.jetbrains.plugins.textmate + + + + + + + + + + + + + + + using Language Server Protocol. + ]]> + + + + + + diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/pluginIcon.svg b/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/pluginIcon.svg new file mode 100644 index 000000000..929521eb5 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/META-INF/pluginIcon.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/icons/language-id-logo.svg b/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/icons/language-id-logo.svg new file mode 100644 index 000000000..929521eb5 --- /dev/null +++ b/packages/generator-langium/templates/packages/intellij-plugin/src/main/resources/icons/language-id-logo.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5730926f45995e982e5872d93037ab7ebe6eeefc Mon Sep 17 00:00:00 2001 From: Abdelrahman Abounegm Date: Mon, 26 Aug 2024 17:12:14 +0300 Subject: [PATCH 17/17] Reuse the changelog from the VS Code extension --- packages/generator-langium/src/index.ts | 1 - .../templates/packages/intellij-plugin/CHANGELOG.md | 5 ----- .../templates/packages/intellij-plugin/build.gradle.kts | 4 ++++ 3 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md diff --git a/packages/generator-langium/src/index.ts b/packages/generator-langium/src/index.ts index 70091be81..508a1ba1b 100644 --- a/packages/generator-langium/src/index.ts +++ b/packages/generator-langium/src/index.ts @@ -373,7 +373,6 @@ export * from './generated/module.js'; 'src', '.gitignore', 'build.gradle.kts', - 'CHANGELOG.md', 'gradle.properties', 'gradlew', 'gradlew.bat', diff --git a/packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md b/packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md deleted file mode 100644 index 6a18e05b9..000000000 --- a/packages/generator-langium/templates/packages/intellij-plugin/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# <%= LanguageName %> Changelog - -## Unreleased diff --git a/packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts b/packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts index ae08c8023..f224dddcb 100644 --- a/packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts +++ b/packages/generator-langium/templates/packages/intellij-plugin/build.gradle.kts @@ -126,6 +126,10 @@ kover { } } +changelog { + path.set(file("../extension/CHANGELOG.md").canonicalPath) +} + tasks { prepareSandbox { // Inspired by Prettier plugin (https://github.com/JetBrains/intellij-plugins/blob/master/prettierJS/build.gradle.kts)