Skip to content

Commit e2ca86c

Browse files
committed
Initial commit
0 parents  commit e2ca86c

File tree

177 files changed

+22151
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+22151
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.eslintrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extends: standard
2+
rules:
3+
no-labels: off
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Problem encountered
3+
about: Report information that could help fixing a bug in the OScript support
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**What is the version of `oscript-parser` that you use?**
10+
11+
You can print the version number by executing `osparse -V` or `oslint -V` if you use the command-line tools, or by executing `jq .version node_modules/oscript-parser/package.json` if you use the API.
12+
13+
**What does not work or work unexpectedly?**
14+
15+
Explain what does not work as you would expect.
16+
17+
**How do you expect it to work?**
18+
19+
Describe what would be your expectation.
20+
21+
**If you use the command-line tools, what is their output?**
22+
23+
If you add the `-v` command-line parameter, the additional information may help to resolve the problem.
24+
25+
**If you use the API, what was the error thrown or the result returned?**
26+
27+
You can attach it as a file if it is too big.
28+
29+
**What is the input OScript source that you used?**
30+
31+
A minimum source code reproducing the problem will be a great help. You can attach it as a file if it is too big.

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.*'
7+
8+
jobs:
9+
create_release:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.get_version.outputs.version }}
14+
steps:
15+
- name: Version
16+
id: get_version
17+
run: echo "::set-output name=version::$(echo "${{ github.ref }}" | sed 's/[^.0-9]\+//')"
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Describe
21+
run: |
22+
CHANGELOG=$(awk -v ver=${{ steps.get_version.outputs.version }} '/## / { if (p) { exit }; if ($2 == ver) { p=1; next } } p' CHANGELOG.md)
23+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
24+
echo "$CHANGELOG" >> $GITHUB_ENV
25+
echo "EOF" >> $GITHUB_ENV
26+
- name: Release
27+
id: create_release
28+
uses: actions/create-release@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
tag_name: ${{ github.ref }}
33+
release_name: Release ${{ github.ref }}
34+
draft: false
35+
prerelease: false
36+
body: ${{ env.CHANGELOG }}

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node: [ '12', '14' ]
19+
name: Node.js ${{ matrix.node }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node }}
25+
- uses: pnpm/[email protected]
26+
with:
27+
version: '>=5'
28+
run_install: |
29+
- args: [--frozen-lockfile, --no-verify-store-integrity]
30+
- run: |
31+
pnpm test
32+
pnpx codecov --disable=gcov

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
.nyc_output
3+
coverage
4+
dist/bin
5+
dist/*.[jm]*
6+
node_modules
7+
npm-debug.log

.vscode/launch.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "osparse",
9+
"type": "node",
10+
"request": "launch",
11+
"skipFiles": ["<node_internals>/**"],
12+
"program": "${workspaceFolder}/dist/bin/osparse",
13+
"args": ["-S", "script", "test/snippets/test.os"],
14+
"stopOnEntry": true
15+
},
16+
{
17+
"name": "oslint",
18+
"type": "node",
19+
"request": "launch",
20+
"skipFiles": ["<node_internals>/**"],
21+
"program": "${workspaceFolder}/dist/bin/oslint",
22+
"args": ["-S", "script", "test/snippets/test.os"],
23+
"stopOnEntry": true
24+
},
25+
{
26+
"name": "tokenize",
27+
"type": "node",
28+
"request": "launch",
29+
"skipFiles": ["<node_internals>/**"],
30+
"program": "${workspaceFolder}/test/tokenize",
31+
"env": {
32+
// "SNIPPETS": "test"
33+
},
34+
"runtimeArgs": ["-r", "esm"],
35+
"stopOnEntry": true
36+
},
37+
{
38+
"name": "parse",
39+
"type": "node",
40+
"request": "launch",
41+
"skipFiles": ["<node_internals>/**"],
42+
"program": "${workspaceFolder}/test/parse",
43+
"env": {
44+
// "SNIPPETS": "test"
45+
},
46+
"runtimeArgs": ["-r", "esm"],
47+
"stopOnEntry": true
48+
}
49+
]
50+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"files.exclude": {
3+
"**/.git": true,
4+
"**/.DS_Store": true,
5+
"**/.nyc_output": true,
6+
"**/coverage": true,
7+
"**/dist/bin": true,
8+
"**/dist/*.[jm]*": true
9+
}
10+
}

.vscode/tasks.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "npm: watch",
6+
"detail": "rollup -c rollup.config.js -w",
7+
"type": "npm",
8+
"script": "watch",
9+
"group": {
10+
"kind": "build",
11+
"isDefault": true
12+
},
13+
"isBackground": true,
14+
"problemMatcher": [
15+
{
16+
"owner": "rollup",
17+
"source": "rollup",
18+
"fileLocation": [
19+
"relative",
20+
"${workspaceFolder}"
21+
],
22+
"pattern": [
23+
{
24+
"regexp": "^\\[!\\] (Error): (.+)$",
25+
"severity": 1,
26+
"message": 2
27+
},
28+
{
29+
"regexp": "^([^ ]+) \\((\\d+):(\\d+)\\)$",
30+
"file": 1,
31+
"line": 2,
32+
"column": 3
33+
}
34+
],
35+
"background": {
36+
"activeOnStart": true,
37+
"beginsPattern": "^rollup .+$",
38+
"endsPattern": "^\\[[^\\]]+\\] waiting for changes\\.\\.\\.$"
39+
}
40+
}
41+
]
42+
}
43+
]
44+
}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
## 0.0.1
4+
5+
Initial release.
6+
7+
* Command-line tools `osparse` and `oslint`
8+
* Functions `parseText`, `parseTokens`, `tokenize` and `startTokenization`
9+
* Typescript typings

0 commit comments

Comments
 (0)