From ffebe9cc7a7966a7c5bb301753c6e6d05f698a95 Mon Sep 17 00:00:00 2001 From: Markus Rudolph Date: Tue, 23 Apr 2024 09:16:29 +0200 Subject: [PATCH] Move process dependency to node-util.ts --- examples/arithmetics/package.json | 2 +- .../arithmetics/src/language-server/generated/ast.ts | 2 +- .../src/language-server/generated/grammar.ts | 2 +- .../src/language-server/generated/module.ts | 2 +- examples/domainmodel/package.json | 2 +- .../domainmodel/src/language-server/generated/ast.ts | 2 +- .../src/language-server/generated/grammar.ts | 2 +- .../src/language-server/generated/module.ts | 2 +- examples/requirements/package.json | 2 +- .../src/language-server/generated/ast.ts | 2 +- .../src/language-server/generated/grammar.ts | 2 +- .../src/language-server/generated/module.ts | 2 +- examples/statemachine/package.json | 2 +- .../src/language-server/generated/ast.ts | 2 +- .../src/language-server/generated/grammar.ts | 2 +- .../src/language-server/generated/module.ts | 2 +- package-lock.json | 12 ++++++------ .../generator-langium/templates/core/.package.json | 2 +- packages/langium-cli/package.json | 2 +- packages/langium-cli/src/generate.ts | 4 ++-- packages/langium-cli/src/generator/langium-util.ts | 8 -------- packages/langium-cli/src/generator/node-util.ts | 8 ++++++++ packages/langium/package.json | 2 +- packages/langium/src/grammar/generated/grammar.ts | 2 +- packages/langium/src/grammar/generated/module.ts | 2 +- packages/langium/src/languages/generated/ast.ts | 2 +- 26 files changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/arithmetics/package.json b/examples/arithmetics/package.json index 0b6b3bd86..e9c09c48f 100644 --- a/examples/arithmetics/package.json +++ b/examples/arithmetics/package.json @@ -74,7 +74,7 @@ "vscode-languageserver": "~9.0.1" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "volta": { "node": "18.19.1", diff --git a/examples/arithmetics/src/language-server/generated/ast.ts b/examples/arithmetics/src/language-server/generated/ast.ts index 04d173c3c..a7df050e4 100644 --- a/examples/arithmetics/src/language-server/generated/ast.ts +++ b/examples/arithmetics/src/language-server/generated/ast.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/arithmetics/src/language-server/generated/grammar.ts b/examples/arithmetics/src/language-server/generated/grammar.ts index 48d635669..c9de8398e 100644 --- a/examples/arithmetics/src/language-server/generated/grammar.ts +++ b/examples/arithmetics/src/language-server/generated/grammar.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/arithmetics/src/language-server/generated/module.ts b/examples/arithmetics/src/language-server/generated/module.ts index 44c056b7f..6ef91a6da 100644 --- a/examples/arithmetics/src/language-server/generated/module.ts +++ b/examples/arithmetics/src/language-server/generated/module.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/domainmodel/package.json b/examples/domainmodel/package.json index da5d5e868..1d0795ba4 100644 --- a/examples/domainmodel/package.json +++ b/examples/domainmodel/package.json @@ -66,7 +66,7 @@ "vscode-languageserver": "~9.0.1" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "volta": { "node": "18.19.1", diff --git a/examples/domainmodel/src/language-server/generated/ast.ts b/examples/domainmodel/src/language-server/generated/ast.ts index d13389be5..8bfa033c0 100644 --- a/examples/domainmodel/src/language-server/generated/ast.ts +++ b/examples/domainmodel/src/language-server/generated/ast.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/domainmodel/src/language-server/generated/grammar.ts b/examples/domainmodel/src/language-server/generated/grammar.ts index af6962f5c..6aaf222cd 100644 --- a/examples/domainmodel/src/language-server/generated/grammar.ts +++ b/examples/domainmodel/src/language-server/generated/grammar.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/domainmodel/src/language-server/generated/module.ts b/examples/domainmodel/src/language-server/generated/module.ts index dfb78c289..f06733e98 100644 --- a/examples/domainmodel/src/language-server/generated/module.ts +++ b/examples/domainmodel/src/language-server/generated/module.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/requirements/package.json b/examples/requirements/package.json index fc272a307..34c0d1567 100644 --- a/examples/requirements/package.json +++ b/examples/requirements/package.json @@ -76,7 +76,7 @@ "vscode-languageserver": "~9.0.1" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "volta": { "node": "18.19.1", diff --git a/examples/requirements/src/language-server/generated/ast.ts b/examples/requirements/src/language-server/generated/ast.ts index 4814e3c10..5a183834c 100644 --- a/examples/requirements/src/language-server/generated/ast.ts +++ b/examples/requirements/src/language-server/generated/ast.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/requirements/src/language-server/generated/grammar.ts b/examples/requirements/src/language-server/generated/grammar.ts index 4b7244cfe..401d4fbb8 100644 --- a/examples/requirements/src/language-server/generated/grammar.ts +++ b/examples/requirements/src/language-server/generated/grammar.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/requirements/src/language-server/generated/module.ts b/examples/requirements/src/language-server/generated/module.ts index 7e5c5701b..52176b19f 100644 --- a/examples/requirements/src/language-server/generated/module.ts +++ b/examples/requirements/src/language-server/generated/module.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/statemachine/package.json b/examples/statemachine/package.json index ee647a4bf..d120c34ab 100644 --- a/examples/statemachine/package.json +++ b/examples/statemachine/package.json @@ -64,7 +64,7 @@ "vscode-languageserver": "~9.0.1" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "volta": { "node": "18.19.1", diff --git a/examples/statemachine/src/language-server/generated/ast.ts b/examples/statemachine/src/language-server/generated/ast.ts index c5d15d2d1..57085b1ad 100644 --- a/examples/statemachine/src/language-server/generated/ast.ts +++ b/examples/statemachine/src/language-server/generated/ast.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/statemachine/src/language-server/generated/grammar.ts b/examples/statemachine/src/language-server/generated/grammar.ts index b280dd5d6..c0b748685 100644 --- a/examples/statemachine/src/language-server/generated/grammar.ts +++ b/examples/statemachine/src/language-server/generated/grammar.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/examples/statemachine/src/language-server/generated/module.ts b/examples/statemachine/src/language-server/generated/module.ts index 5aff61979..1b3bc8ea1 100644 --- a/examples/statemachine/src/language-server/generated/module.ts +++ b/examples/statemachine/src/language-server/generated/module.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/package-lock.json b/package-lock.json index 112ab6da8..797cac4bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "arithmetics-cli": "bin/cli.js" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "engines": { "vscode": "^1.67.0" @@ -86,7 +86,7 @@ "domainmodel-cli": "bin/cli.js" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "engines": { "vscode": "^1.67.0" @@ -117,7 +117,7 @@ "requirements-and-tests-lang-cli": "bin/cli.js" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "engines": { "vscode": "^1.67.0" @@ -149,7 +149,7 @@ "statemachine-cli": "bin/cli.js" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "engines": { "vscode": "^1.67.0" @@ -13980,14 +13980,14 @@ "vscode-uri": "~3.0.8" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "engines": { "node": ">=16.0.0" } }, "packages/langium-cli": { - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "dependencies": { "chalk": "~5.3.0", diff --git a/packages/generator-langium/templates/core/.package.json b/packages/generator-langium/templates/core/.package.json index d28a882f3..0630a1a69 100644 --- a/packages/generator-langium/templates/core/.package.json +++ b/packages/generator-langium/templates/core/.package.json @@ -22,7 +22,7 @@ "@typescript-eslint/parser": "~7.3.1", "@typescript-eslint/eslint-plugin": "~7.3.1", "eslint": "~8.57.0", - "langium-cli": "~3.0.2", + "langium-cli": "~3.0.3", "typescript": "~5.1.6" }, "volta": { diff --git a/packages/langium-cli/package.json b/packages/langium-cli/package.json index 762ab1c1d..e2f7caadd 100644 --- a/packages/langium-cli/package.json +++ b/packages/langium-cli/package.json @@ -1,6 +1,6 @@ { "name": "langium-cli", - "version": "3.0.2", + "version": "3.0.3", "description": "CLI for Langium - the language engineering tool", "homepage": "https://langium.org", "engines": { diff --git a/packages/langium-cli/src/generate.ts b/packages/langium-cli/src/generate.ts index e3fe2d0a9..47b064676 100644 --- a/packages/langium-cli/src/generate.ts +++ b/packages/langium-cli/src/generate.ts @@ -17,8 +17,8 @@ import { generateModule } from './generator/module-generator.js'; import { generateTextMate } from './generator/highlighting/textmate-generator.js'; import { generateMonarch } from './generator/highlighting/monarch-generator.js'; import { generatePrismHighlighting } from './generator/highlighting/prism-generator.js'; -import { elapsedTime, getTime, log } from './generator/langium-util.js'; -import { getUserChoice, schema } from './generator/node-util.js'; +import { getTime, log } from './generator/langium-util.js'; +import { elapsedTime, getUserChoice, schema } from './generator/node-util.js'; import { RelativePath } from './package-types.js'; import { getFilePath } from './package.js'; import { validateParser } from './parser-validation.js'; diff --git a/packages/langium-cli/src/generator/langium-util.ts b/packages/langium-cli/src/generator/langium-util.ts index eb42749c2..c6c7f5306 100644 --- a/packages/langium-cli/src/generator/langium-util.ts +++ b/packages/langium-cli/src/generator/langium-util.ts @@ -15,14 +15,6 @@ export function log(level: 'log' | 'warn' | 'error', options: { watch?: boolean } } -let start = process.hrtime(); - -export function elapsedTime(): string { - const elapsed = process.hrtime(start)[1] / 1000000; // divide by a million to get nano to milli - start = process.hrtime(); // reset the timer - return elapsed.toFixed(); -} - export function getTime(): string { const date = new Date(); return `[${chalk.gray(`${padZeroes(date.getHours())}:${padZeroes(date.getMinutes())}:${padZeroes(date.getSeconds())}`)}] `; diff --git a/packages/langium-cli/src/generator/node-util.ts b/packages/langium-cli/src/generator/node-util.ts index d0667e62c..5d9805991 100644 --- a/packages/langium-cli/src/generator/node-util.ts +++ b/packages/langium-cli/src/generator/node-util.ts @@ -57,3 +57,11 @@ export async function getUserChoice(text: string, values: R[], export const cliVersion = getLangiumCliVersion(); export const generatedHeader = getGeneratedHeader(); export const schema = fs.readJson(path.resolve(getDirname(), '../../langium-config-schema.json'), { encoding: 'utf-8' }); + +let start = process.hrtime(); + +export function elapsedTime(): string { + const elapsed = process.hrtime(start)[1] / 1000000; // divide by a million to get nano to milli + start = process.hrtime(); // reset the timer + return elapsed.toFixed(); +} diff --git a/packages/langium/package.json b/packages/langium/package.json index a41dc105b..60a4ac3f9 100644 --- a/packages/langium/package.json +++ b/packages/langium/package.json @@ -70,7 +70,7 @@ "vscode-uri": "~3.0.8" }, "devDependencies": { - "langium-cli": "~3.0.2" + "langium-cli": "~3.0.3" }, "volta": { "node": "18.19.1", diff --git a/packages/langium/src/grammar/generated/grammar.ts b/packages/langium/src/grammar/generated/grammar.ts index 444e8191d..72060e563 100644 --- a/packages/langium/src/grammar/generated/grammar.ts +++ b/packages/langium/src/grammar/generated/grammar.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/packages/langium/src/grammar/generated/module.ts b/packages/langium/src/grammar/generated/module.ts index edddee448..d6cf95ebf 100644 --- a/packages/langium/src/grammar/generated/module.ts +++ b/packages/langium/src/grammar/generated/module.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/ diff --git a/packages/langium/src/languages/generated/ast.ts b/packages/langium/src/languages/generated/ast.ts index 6e8f1963b..e96439b5e 100644 --- a/packages/langium/src/languages/generated/ast.ts +++ b/packages/langium/src/languages/generated/ast.ts @@ -1,5 +1,5 @@ /****************************************************************************** - * This file was generated by langium-cli 3.0.2. + * This file was generated by langium-cli 3.0.3. * DO NOT EDIT MANUALLY! ******************************************************************************/