Skip to content

Commit

Permalink
Move process node dependency to node-util.ts (#1466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lotes committed Apr 23, 2024
1 parent 12f70c5 commit 3a5a539
Show file tree
Hide file tree
Showing 26 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion examples/arithmetics/package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion examples/domainmodel/package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion examples/requirements/package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion examples/statemachine/package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
@@ -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!
******************************************************************************/

Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/generator-langium/templates/core/.package.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion 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": {
Expand Down
4 changes: 2 additions & 2 deletions packages/langium-cli/src/generate.ts
Expand Up @@ -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';
Expand Down
8 changes: 0 additions & 8 deletions packages/langium-cli/src/generator/langium-util.ts
Expand Up @@ -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())}`)}] `;
Expand Down
8 changes: 8 additions & 0 deletions packages/langium-cli/src/generator/node-util.ts
Expand Up @@ -57,3 +57,11 @@ export async function getUserChoice<R extends string>(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();
}
2 changes: 1 addition & 1 deletion packages/langium/package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 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!
******************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion 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!
******************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion 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!
******************************************************************************/

Expand Down

0 comments on commit 3a5a539

Please sign in to comment.