Skip to content

Commit

Permalink
Implement review comments: tmLanguage location and package names use …
Browse files Browse the repository at this point in the history
…languageId
  • Loading branch information
kaisalmen committed Jul 5, 2024
1 parent 38d6954 commit 3c0b81d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/generator-langium/templates/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "<%= extension-name %>-workspace",
"name": "<%= language-id %>-workspace",
"description": "Base workspace package",
"version": "0.0.1",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "<%= extension-name %>-cli",
"name": "<%= language-id %>-cli",
"description": "The cli specific package",
"version": "0.0.1",
"type": "module",
Expand All @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "<%= extension-name %>-language",
"name": "<%= language-id %>-language",
"description": "The language specific package",
"version": "0.0.1",
"type": "module",
Expand Down
13 changes: 7 additions & 6 deletions packages/generator-langium/templates/packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "<%= extension-name %>-web",
"name": "<%= language-id %>-web",
"description": "The web specific package",
"version": "0.0.1",
"type": "module",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
10 changes: 4 additions & 6 deletions packages/generator-langium/test/yeoman-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -309,7 +307,7 @@ const PACKAGE_JSON_EXPECTATION_WEB: Record<string, any> = {
},
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',
Expand Down Expand Up @@ -364,7 +362,7 @@ const PACKAGE_JSON_EXPECTATION_EXTENSION: Record<string, any> = {
],
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',
Expand Down

0 comments on commit 3c0b81d

Please sign in to comment.