Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
- run: npm ci
- run: npm test
- run: npm run build

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
File renamed without changes.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules/
build/wenyan-linux
build/wenyan-macos
build/wenyan-win.exe
temp
temp
dist
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ More sophisticated examples, such as the Sieve of Eratosthenes, Quicksort, Mande

### The Compiler

Clone the repo, (OR simply download `./build/wenyan.js` and set its executable bit using the terminal command `chmod +x wenyan.js`). Then run `./build/wenyan.js` to compile your wenyan souce code to target language. Calling the compiler without arguments prints the help message, reproduced below:
```bash
npm install -g wenyan-lang
```

Calling the compiler without arguments prints the help message, reproduced below:

```
Usage: wenyan [options] [input files]
Expand All @@ -76,21 +80,13 @@ Options:
--output -o <string> : Output file (default: `/dev/stdout')
--roman -r <boolean> : Romanize identifiers (default: `true')
```

Try building the included examples first, e.g.:

```
./build/wenyan.js examples/helloworld.wy -o helloworld.js
wenyan examples/helloworld.wy -o helloworld.js
```

#### Building platform-specific binaries

- Clone the repo
- `npm install`
- `npm run make_cmdline`

The macOS, Windows and Linux binaries will be in the `./build` folder.


### [The online IDE](http://wenyan-lang.lingdong.works/ide.html)

![](screenshots/screenshot02.png)
Expand Down
22 changes: 20 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
{
"name": "wenyan-lang",
"version": "0.0.1",
"author": "LingDong<lingdong0618@hotmail.com>",
"repository": {
"type": "git",
"url": "https://github.com/LingDong-/wenyan-lang.git"
},
"license": "MIT",
"bin": {
"wenyan": "./dist/cli.js"
},
"main": "./dist/core.js",
"files": [
"dist"
],
"scripts": {
"build": "npm run clear && webpack --mode production && chmod -x ./dist/cli.js",
"dev": "npm run clear && webpack --mode development --watch",
"clear": "rimraf ./dist",
"release": "bump --commit --tag && git push --follow-tags",
"make_cmdline": "node ./tools/make_cmdline.js && pkg ./build/wenyan.js --out-path ./build",
"make_ide": "node ./tools/make_ide.js",
"make_site": "node ./tools/make_site.js",
Expand All @@ -26,7 +40,6 @@
"git add"
]
},
"license": "MIT",
"devDependencies": {
"chai": "^4.2.0",
"enzyme": "^3.10.0",
Expand All @@ -40,6 +53,11 @@
"mocha": "^6.2.2",
"mocha-snapshots": "^4.2.0",
"pkg": "^4.4.2",
"prettier": "^1.19.1"
"prettier": "^1.19.1",
"rimraf": "^3.0.0",
"version-bump-prompt": "^5.0.6",
"webpack": "^4.41.4",
"webpack-cli": "^3.3.10",
"webpack-shell-plugin": "^0.5.0"
}
}
Loading