@stordata/grammars 1.0.20230421155415

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "@stordata",
3
+ "parserOptions": {
4
+ "sourceType": "module",
5
+ "ecmaVersion": 2022
6
+ },
7
+ "rules": {
8
+ "import/extensions": "off",
9
+ "import/order": ["error", {
10
+ "newlines-between": "always"
11
+ }]
12
+ }
13
+ }
package/.gitlab-ci.yml ADDED
@@ -0,0 +1,49 @@
1
+ image: docker.stordata.fr/stordata/docker-node:18
2
+
3
+ stages:
4
+ - antlr
5
+ - build
6
+ - release
7
+
8
+ antlr:
9
+ stage: antlr
10
+ image: docker.stordata.fr/stordata/docker-antlr
11
+ tags:
12
+ - docker
13
+ script:
14
+ - antlr4 -Dlanguage=JavaScript -o generated src/grammars/CustomMetric.g4
15
+ artifacts:
16
+ expire_in: 1h
17
+ paths:
18
+ - generated/
19
+
20
+ build:
21
+ stage: build
22
+ tags:
23
+ - docker
24
+ dependencies:
25
+ - antlr
26
+ script:
27
+ - npm ci
28
+ - npm run lint
29
+ - npm test
30
+ - npm run build
31
+ artifacts:
32
+ expire_in: 1h
33
+ paths:
34
+ - dist/
35
+
36
+ release:
37
+ stage: release
38
+ tags:
39
+ - docker
40
+ dependencies:
41
+ - antlr
42
+ - build
43
+ script:
44
+ - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
45
+ - sed -i "s/\"version\":\s\"\(.*\..*\)\.\(.*\)\"/\"version\":\"\1.$(date +%Y%m%d%H%M%S)\"/" package.json
46
+ - npm publish
47
+ - git checkout .
48
+ rules:
49
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
package/.nvmrc ADDED
@@ -0,0 +1,2 @@
1
+ 18.12.1
2
+
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @stordata/grammars
2
+
3
+ A collection of ANTLR grammars used at Stordata.
4
+ This project exists so that we can package the grammars (and various utilities) as a CommonJS module.
5
+ The `antlr4` Javascript runtime is only available as an ES module at the time of writing.
6
+
7
+ ## Pre-requisites
8
+
9
+ Install `antlr4-tools` Python package using `pip` with something like
10
+
11
+ ```
12
+ pip install antlr4-tools
13
+ ```
14
+
15
+ And verify that the `antlr4` command works. You might need to double-check that the command is in your path, pip installs
16
+ it in the `~/.local/bin` folder that is supposedly already handled by your Shell, but you know...
17
+
18
+ ## Building
19
+
20
+ Available NPM scripts are
21
+
22
+ ```
23
+ npm test
24
+ npm run lint
25
+ npm run build
26
+ ```