-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add slangroom grammar package (#196)
* initial package structure * change example to slangroom * fix: scenario statement * update makefile * add first simple tests * fix: add License * fix: given have statement * fix: send can be optional * fix: ethereum actions * fix: Helpers send * update keywords list * update Given name statement * fix: add the possibility of having more than one scenario * update test list * add some others test from didroom * add grammar test to github actions * fix(grammar): add missing syntax.grammar.d.ts file * chore(grammar): remove package-lock since using pnpm * chore: add grammar to workspace * chore(grammar): remove capital letter from package name * chore: add test:grammar command to test grammar * ci: update grammar test * refactor(grammar): remove unused Makefile * chore: add missing license headers * chore: add grammar package acknowledgement in the readme * chore: Give to Cesar what is to Cesar * feat(grammar): publish npm package on main merge * pnpm-lock ❗ --------- Co-authored-by: FilippoTrotter <[email protected]> Co-authored-by: puria <[email protected]>
- Loading branch information
1 parent
c23c584
commit 3142f3b
Showing
21 changed files
with
2,883 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
name: 🪶 Grammar publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: [ "grammar" ] | ||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
id-token: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build_and_test | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: 🛠️ Prepare pnpm workspace | ||
uses: dyne/pnpm@main | ||
- name: 📦 Releases | ||
working-directory: ./grammar | ||
run: npx semantic-release | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
/src | ||
/test | ||
/node_modules | ||
rollup.config.js | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright 2017-2018 Dyne.org foundation | ||
# SPDX-FileCopyrightText: 2017-2021 Dyne.org foundation | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
{ | ||
"extends": ["semantic-release-commit-filter"] | ||
"repositoryUrl": "[email protected]:dyne/slangroom.git", | ||
"dryRun": false, | ||
"plugins": [ | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "angular", | ||
"releaseRules": [ | ||
{ "type": "build", "scope": "deps", "release": "patch" }, | ||
{ "type": "build", "scope": "deps-dev", "release": "patch" } | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"npmPublish": true | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"grammar/CHANGELOG.md", | ||
"grammar/pnpm-lock.yaml", | ||
"grammar/package.json" | ||
], | ||
"message": "chore(grammar release): 🚀 ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
], | ||
"branches": [ | ||
"main" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "codemirror-lang-slangroom", | ||
"version": "0.1.0", | ||
"description": "Slangroom language support for CodeMirror", | ||
"scripts": { | ||
"test": "mocha test/test.js", | ||
"prepare": "rollup -c" | ||
}, | ||
"author": { | ||
"name": "Filippo Trotter" | ||
}, | ||
"contributors": [ | ||
{ "name": "Matteo Cristino" } | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"type": "module", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"exports": { | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"types": "dist/index.d.ts", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@codemirror/language": "^6.0.0", | ||
"@lezer/highlight": "^1.0.0", | ||
"@lezer/lr": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@lezer/generator": "^1.0.0", | ||
"@semantic-release/changelog": "^6.0.3", | ||
"@semantic-release/commit-analyzer": "^13.0.0", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/npm": "^12.0.1", | ||
"@semantic-release/release-notes-generator": "^14.0.1", | ||
"mocha": "^9.0.1", | ||
"rollup": "^2.60.2", | ||
"rollup-plugin-dts": "^4.0.1", | ||
"rollup-plugin-ts": "^3.0.2", | ||
"semantic-release-commit-filter": "^1.0.2", | ||
"typescript": "^4.3.4" | ||
}, | ||
"license": "AGPL-3.0-or-later" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import typescript from "rollup-plugin-ts" | ||
import {lezer} from "@lezer/generator/rollup" | ||
|
||
export default { | ||
input: "src/index.ts", | ||
external: id => id != "tslib" && !/^(\.?\/|\w:)/.test(id), | ||
output: [ | ||
{file: "dist/index.cjs", format: "cjs"}, | ||
{dir: "./dist", format: "es"} | ||
], | ||
plugins: [lezer(), typescript()] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
import {parser} from "./syntax.grammar" | ||
import {LRLanguage, LanguageSupport, indentNodeProp, foldNodeProp, foldInside, delimitedIndent} from "@codemirror/language" | ||
import {styleTags, tags as t} from "@lezer/highlight" | ||
|
||
export const SlangroomLanguage = LRLanguage.define({ | ||
parser: parser.configure({ | ||
props: [ | ||
indentNodeProp.add({ | ||
Application: delimitedIndent({closing: ")", align: false}) | ||
}), | ||
foldNodeProp.add({ | ||
Application: foldInside | ||
}), | ||
styleTags({ | ||
Identifier: t.variableName, | ||
Boolean: t.bool, | ||
String: t.string, | ||
LineComment: t.lineComment, | ||
"( )": t.paren | ||
}) | ||
] | ||
}), | ||
languageData: { | ||
commentTokens: {line: ";"} | ||
} | ||
}) | ||
|
||
export function Slangroom() { | ||
return new LanguageSupport(SlangroomLanguage) | ||
} |
Oops, something went wrong.