Skip to content

Commit

Permalink
Implemented review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisalmen committed Oct 20, 2023
1 parent 05e5ce1 commit 3006542
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 30 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:1313",
"webRoot": "${workspaceFolder}"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository contains the assets required to build the Langium website and do

Our setup uses TailwindCSS to build the styles which are then copied into the Hugo installation, from which our website is finally built.

Please look into the sub folders [hugo/](hugo/README.md) and [tailwind/](tailwind/README.md).
Please look into the sub folders [core/](core/README.md) [hugo/](hugo/README.md) and [tailwind/](tailwind/README.md).

You can find the `showcase/` folder [here](hugo/content/showcase).

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# core/

We utilize [monaco-editor-wrapper](https://www.npmjs.com/package/monaco-editor-wrapper) and [@typefox/monaco-editor-react](https://www.npmjs.com/package/@typefox/monaco-editor-react) to make the monaco-editor intgration a smoother experience.

This package provides utility `createUserConfig` that provides a fully specified user configuration to be used by either of the two packages. The other purpose is to bundle the code, so it can be integrated with hugo and remove the burden dealing with complex javascript in the hugo build process.
2 changes: 1 addition & 1 deletion foundation/package.json → core/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "langium-website-foundation",
"name": "langium-website-core",
"version": "1.0.0",
"type": "module",
"description": "Bundling complex sources for hugo",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion hugo/assets/scripts/arithmetics/arithmetics-tools.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { monaco } from "langium-website-foundation/bundle";
import { monaco } from "langium-website-core/bundle";
import { Pos } from "../langium-utils/langium-ast";

export interface Evaluation {
Expand Down
2 changes: 1 addition & 1 deletion hugo/assets/scripts/arithmetics/arithmetics.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-foundation/bundle";
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-core/bundle";
import { buildWorkerDefinition } from "monaco-editor-workers";
import React from "react";
import { createRoot } from "react-dom/client";
Expand Down
2 changes: 1 addition & 1 deletion hugo/assets/scripts/domainmodel/domainmodel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-foundation/bundle";
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-core/bundle";
import { buildWorkerDefinition } from "monaco-editor-workers";
import React from "react";
import { createRoot } from "react-dom/client";
Expand Down
2 changes: 1 addition & 1 deletion hugo/assets/scripts/minilogo/minilogo-tools.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { monaco } from "langium-website-foundation/bundle";
import { monaco } from "langium-website-core/bundle";

export interface Command {
name: 'penUp' | 'penDown' | 'move' | 'color';
Expand Down
2 changes: 1 addition & 1 deletion hugo/assets/scripts/minilogo/minilogo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-foundation/bundle";
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-core/bundle";
import { buildWorkerDefinition } from "monaco-editor-workers";
import React, { createRef } from "react";
import { createRoot } from "react-dom/client";
Expand Down
2 changes: 1 addition & 1 deletion hugo/assets/scripts/sql/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { monaco } from "langium-website-foundation/bundle";
import { monaco } from "langium-website-core/bundle";

export const syntaxHighlighting: monaco.languages.IMonarchLanguage = {
tokenizer: {
Expand Down
2 changes: 1 addition & 1 deletion hugo/assets/scripts/sql/ui.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-foundation/bundle";
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-core/bundle";
import { buildWorkerDefinition } from "monaco-editor-workers";
import React from "react";
import { createRoot } from "react-dom/client";
Expand Down
2 changes: 1 addition & 1 deletion hugo/assets/scripts/statemachine/statemachine.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-foundation/bundle";
import { addMonacoStyles, createUserConfig, MonacoEditorReactComp, UserConfig } from "langium-website-core/bundle";
import { buildWorkerDefinition } from "monaco-editor-workers";
import React from "react";
import { createRoot } from "react-dom/client";
Expand Down
3 changes: 2 additions & 1 deletion hugo/content/playground/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Disposable } from "vscode-languageserver";
import { DefaultAstNodeLocator, createServicesForGrammar } from "langium";
import { render } from './Tree';
import { overlay, throttle } from "./utils";
import { addMonacoStyles, createUserConfig, MonacoEditorLanguageClientWrapper } from "langium-website-foundation/bundle";
import { addMonacoStyles, createUserConfig, MonacoEditorLanguageClientWrapper } from "langium-website-core/bundle";
import { DocumentChangeResponse } from "../../assets/scripts/langium-utils/langium-ast";

export { share, overlay } from './utils';
Expand All @@ -34,6 +34,7 @@ let currentGrammarContent = '';
/**
* Current DSL program in the playground
*/

let currentDSLContent = '';

/**
Expand Down
4 changes: 2 additions & 2 deletions hugo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": true,
"scripts": {
"clean:static": "shx rm -rf ./static/showcase ./static/playground ./static/libs",
"copy:libs:prepare": "shx mkdir -p ./static/libs/monaco-editor-workers/workers && shx mkdir -p ./static/libs/langium-website-foundation",
"copy:libs:prepare": "shx mkdir -p ./static/libs/monaco-editor-workers/workers",
"copy:monaco-workers": "npm run copy:libs:prepare && shx cp -f ../node_modules/monaco-editor-workers/dist/index.* ./static/libs/monaco-editor-workers && shx cp -f ../node_modules/monaco-editor-workers/dist/workers/editorWorker-iife.js ./static/libs/monaco-editor-workers/workers",
"build:worker/statemachine": "esbuild ../node_modules/langium-statemachine-dsl/out/language-server/main-browser.js --bundle --format=iife --outfile=./static/showcase/libs/worker/statemachineServerWorker.js",
"build:worker/arithmetics": "esbuild ../node_modules/langium-arithmetics-dsl/out/language-server/main-browser.js --bundle --format=iife --outfile=./static/showcase/libs/worker/arithmeticsServerWorker.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
"langium-minilogo": "^1.2.0",
"langium-sql": "^0.2.3",
"langium-statemachine-dsl": "~1.2.0",
"langium-website-foundation": "~1.0.0",
"langium-website-core": "~1.0.0",
"lz-string": "^1.4.4",
"monaco-editor-workers": "~0.44.0",
"react": "~18.2.0",
Expand Down
48 changes: 36 additions & 12 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"license": "MIT",
"private": true,
"scripts": {
"watch": "npm run build --workspace foundation && concurrently -c gray,blue -k -n hugo,tailwind \"npm run watch --workspace hugo\" \"npm run watch --workspace tailwind\"",
"watch:gitpod": "npm run build --workspace foundation && concurrently -c gray,blue -k -n hugo,tailwind \"npm run watch:gitpod --workspace hugo\" \"npm run watch --workspace tailwind\"",
"build": "npm run clean && npm run build --workspace foundation --workspace=tailwind --workspace=hugo",
"clean": "shx rm -rf public && npm run clean --workspace foundation --workspace=tailwind"
"watch": "npm run build --workspace core && concurrently -c gray,blue -k -n hugo,tailwind \"npm run watch --workspace hugo\" \"npm run watch --workspace tailwind\"",
"watch:gitpod": "npm run build --workspace core && concurrently -c gray,blue -k -n hugo,tailwind \"npm run watch:gitpod --workspace hugo\" \"npm run watch --workspace tailwind\"",
"build": "npm run clean && npm run build --workspace core --workspace=tailwind --workspace=hugo",
"clean": "shx rm -rf public && npm run clean --workspace core --workspace=tailwind"
},
"devDependencies": {
"concurrently": "~8.2.1",
"cross-env": "~7.0.3",
"shx": "~0.3.4"
},
"workspaces": [
"foundation",
"core",
"hugo",
"tailwind"
],
Expand Down

0 comments on commit 3006542

Please sign in to comment.