Skip to content

Commit

Permalink
Made one test execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Lotes committed Nov 13, 2024
1 parent dd40c1c commit 05d2ed3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
39 changes: 28 additions & 11 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"langium:generate": "npm run langium:generate --workspace=examples/ox --workspace=examples/lox",
"langium:watch": "npm run langium:watch --workspace=examples/ox --workspace=examples/lox",
"vscode:prepublish": "npm run build && npm run lint",
"reset:repo": "git clean -f -X -d"
"reset:repo": "git clean -f -X -d",
"version:dependencies": "node ./scripts/update-version.js && npm install"
},
"devDependencies": {
"@types/node": "~18.19.55",
Expand All @@ -49,6 +50,7 @@
"esbuild": "~0.24.0",
"eslint": "~8.57.1",
"eslint-plugin-header": "~3.1.1",
"fs-extra": "^11.2.0",
"shx": "~0.3.4",
"typescript": "~5.5.4",
"vitest": "~2.1.2"
Expand Down
12 changes: 6 additions & 6 deletions scripts/update-versions.js → scripts/update-version.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs-extra');
const path = require('path');
import fs from 'fs-extra';
import path from 'path';

async function runUpdate() {
const langiumPath = getPath('typir', true);
Expand All @@ -13,17 +13,17 @@ async function runUpdate() {
]);
}

async function replaceAll(project, package, version) {
const path = getPath(project, package);
async function replaceAll(project, pkg, version) {
const path = getPath(project, pkg);
let content = await fs.readFile(path, 'utf-8');
content = content
.replace(/(?<="typir": "[~\^]?)\d+\.\d+\.\d+/g, version)
.replace(/(?<="typir-langium": "[~\^]?)\d+\.\d+\.\d+/g, version)
await fs.writeFile(path, content);
}

function getPath(project, package) {
return path.join(package ? 'packages' : 'examples', project, 'package.json');
function getPath(project, pkg) {
return path.join(pkg ? 'packages' : 'examples', project, 'package.json');
}

runUpdate();

0 comments on commit 05d2ed3

Please sign in to comment.