Skip to content

Commit

Permalink
build(deps): Bump langium from 1.2.1 to 2.0.2 (#548)
Browse files Browse the repository at this point in the history
Bumps
[langium](https://github.com/eclipse-langium/langium/tree/HEAD/packages/langium)
from 1.2.1 to 2.0.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/eclipse-langium/langium/releases">langium's
releases</a>.</em></p>
<blockquote>
<h2>v2.0.0</h2>
<p>Changes: <a
href="https://github.com/eclipse-langium/langium/blob/main/packages/langium/CHANGELOG.md#v200-aug-2023">https://github.com/eclipse-langium/langium/blob/main/packages/langium/CHANGELOG.md#v200-aug-2023</a></p>
<h2>v1.3.0</h2>
<p>Changes: <a
href="https://github.com/eclipse-langium/langium/blob/main/packages/langium/CHANGELOG.md#v130-aug-2023">https://github.com/eclipse-langium/langium/blob/main/packages/langium/CHANGELOG.md#v130-aug-2023</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/eclipse-langium/langium/blob/main/packages/langium/CHANGELOG.md">langium's
changelog</a>.</em></p>
<blockquote>
<h2>v2.0.1 (Aug. 2023)</h2>
<p>Publish Langium's own grammar using minified JSON (<a
href="https://redirect.github.com/eclipse-langium/langium/pull/1158">#1158</a>).</p>
<h2>v2.0.0 (Aug. 2023)</h2>
<h3>EcmaScript Modules (ESM)</h3>
<p>Langium is now compiling to ESM instead of CommonJS (CJS).
CommonJS is the JavaScript convention introduced by Node.js and has
historically been used in all Node.js based application.
With the introduction of ESM to modern versions of the Node.js runtime,
more and more projects and libraries are making the move to ESM. Since a
lot of our dependencies have moved on, we decided to do so as well.</p>
<p>While ESM based projects in Node.js can continue to import CJS code,
CJS projects cannot (easily) import ESM code.
This is a <strong>very important change</strong> for adopters, as it
prevents using Langium as-is in CJS projects.
This leaves us with a problem, as all vscode extensions need to run as
CJS code.
Luckily, JavaScript bundlers such as <code>esbuild</code> are capable of
transforming ESM code into CJS code.
Using a bundler for vscode extensions and language servers is heavily
recommended anyway,
so we hope that adopters don't have much trouble upgrading to Langium
2.0.
You can find a small instruction manual on how to migrate TypeScript
projects to ESM <a
href="https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm">here</a>.</p>
<p>Note that the newest version of the yeoman generator contains a
ready-to-use bundler configuration.
Adopters can use the generated project as a basis for upgrading to 2.0.
We also have <a href="https://langium.org/guides/code-bundling/">a guide
available on our website</a> that goes into more detail on this topic.
If you have any questions on this topic, feel free to ask us on the <a
href="https://github.com/langium/langium/discussions">GitHub Discussions
Board</a>.</p>
<h3>General Improvements</h3>
<ul>
<li>The <code>DefaultDocumentBuilder</code> has been refactored to allow
for more flexible and fine-grained validation behavior. (<a
href="https://redirect.github.com/langium/langium/pull/1094">#1094</a>).</li>
</ul>
<h3>Breaking Changes</h3>
<ul>
<li>The <code>CodeLensProvider</code>, <code>DocumentLinkProvider</code>
and <code>InlayHintProvider</code> services were moved from the shared
LSP services container to the language specific services container.
Additionally, their <code>resolve</code> methods have been removed (<a
href="https://redirect.github.com/langium/langium/pull/1107">#1107</a>).</li>
<li>Deprecated a few properties available on CST nodes. They have been
renamed and their old property names will be deleted in a future version
(<a
href="https://redirect.github.com/langium/langium/pull/1131">#1131</a>):
<ul>
<li><code>CstNode#parent</code> -&gt; <code>container</code></li>
<li><code>CstNode#feature</code> -&gt; <code>grammarSource</code></li>
<li><code>CstNode#element</code> -&gt; <code>astNode</code></li>
<li><code>CompositeCstNode#children</code> -&gt;
<code>content</code></li>
</ul>
</li>
<li>The <code>IndexManager#getAffectedDocuments</code> has been changed
to <code>isAffected</code>. Instead of returning a stream of all
affected documents of a change, it now only returns whether a specified
document is affected by the change of a set of documents (<a
href="https://redirect.github.com/langium/langium/pull/1094">#1094</a>).</li>
<li>The <code>BuildOptions#validationChecks</code> property has been
replaced with <code>validation?: boolean | ValidationOptions</code> (<a
href="https://redirect.github.com/langium/langium/pull/1094">#1094</a>).</li>
</ul>
<hr />
<h2>v1.3.0 (Aug. 2023)</h2>
<h3>Regular Expression Flags</h3>
<p>With <a
href="https://redirect.github.com/eclipse-langium/langium/pull/1070">#1070</a>,
the Langium grammar language now supports regular expression flags as
part of terminal definitions:</p>
<ol>
<li><code>u</code> Enables unicode support for the specified
terminal.</li>
<li><code>i</code> Makes the terminal case-insensitive.</li>
<li><code>s</code> Makes the wild character &quot;<code>.</code>&quot;
match newlines as well.</li>
</ol>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/eclipse-langium/langium/commits/HEAD/packages/langium">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=langium&package-manager=npm_and_yarn&previous-version=1.2.1&new-version=2.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>
  • Loading branch information
dependabot[bot] and lars-reimann authored Sep 6, 2023
1 parent cddf273 commit befa503
Show file tree
Hide file tree
Showing 34 changed files with 1,593 additions and 766 deletions.
File renamed without changes.
14 changes: 7 additions & 7 deletions docs/development/langium-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## What's in the folder

This folder contains all necessary files for your language extension.
The project 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.ts` - the main code of the extension, which is responsible for launching a language server and client.
* `src/language-server/safe-ds.langium` - the grammar definition of your language.
* `src/language-server/main.ts` - the entry point of the language server process.
* `src/language-server/safe-ds-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services.
* `src/language-server/safe-ds-validator.ts` - an example validator. You should change it to reflect the semantics of your language.
* `src/cli/index.ts` - the entry point of the command line interface (CLI) of your language.
* `src/extension/main.ts` - the main code of the extension, which is responsible for launching a language server and client.
* `src/language/grammar/safe-ds.langium` - the grammar definition of your language.
* `src/language/main.ts` - the entry point of the language server process.
* `src/language/safe-ds-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services.
* `src/language/validation/safe-ds-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.

Expand Down
54 changes: 54 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//@ts-check
import * as esbuild from 'esbuild';

const watch = process.argv.includes('--watch');
const minify = process.argv.includes('--minify');

const success = watch ? 'Watch build succeeded' : 'Build succeeded';

const getTime = function () {
const date = new Date();
return `[${`${padZeroes(date.getHours())}:${padZeroes(date.getMinutes())}:${padZeroes(date.getSeconds())}`}] `;
}

const padZeroes = function (i) {
return i.toString().padStart(2, '0');
}

const plugins = [{
name: 'watch-plugin',
setup(build) {
build.onEnd(result => {
if (result.errors.length === 0) {
console.log(getTime() + success);
}
});
},
}];

const ctx = await esbuild.context({
// Entry points for the vscode extension and the language server
entryPoints: ['src/extension/main.ts', 'src/language/main.ts'],
outdir: 'out',
bundle: true,
target: "ES2017",
// VSCode's extension host is still using cjs, so we need to transform the code
format: 'cjs',
// To prevent confusing node, we explicitly use the `.cjs` extension
outExtension: {
'.js': '.cjs'
},
loader: { '.ts': 'ts' },
external: ['vscode'],
platform: 'node',
sourcemap: !minify,
minify,
plugins
});

if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
ctx.dispose();
}
4 changes: 2 additions & 2 deletions langium-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"languages": [
{
"id": "safe-ds",
"grammar": "src/language-server/grammar/safe-ds.langium",
"grammar": "src/language/grammar/safe-ds.langium",
"fileExtensions": [".sdspipe", ".sdsstub", ".sdstest"],
"textMate": {
"out": "syntaxes/safe-ds.tmLanguage.json"
}
}
],
"out": "src/language-server/generated"
"out": "src/language/generated"
}
Loading

0 comments on commit befa503

Please sign in to comment.