Switch to yarn workspaces
This commit is contained in:
parent
f338373ac5
commit
6bec672087
25
Makefile
25
Makefile
|
@ -1,34 +1,23 @@
|
||||||
|
LERNA=./node_modules/.bin/lerna
|
||||||
|
|
||||||
bootstrap: node_modules/lerna
|
bootstrap: node_modules/lerna
|
||||||
|
|
||||||
node_modules/lerna:
|
node_modules/lerna:
|
||||||
npm i .
|
yarn install
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
+$(MAKE) -j$$(nproc) all
|
+$(MAKE) -j$$(nproc) all
|
||||||
|
|
||||||
PACKAGE_JSONS=$(wildcard packages/*/package.json)
|
|
||||||
PACKAGE_DIRS=$(PACKAGE_JSONS:/package.json=)
|
|
||||||
|
|
||||||
clean.local:
|
clean.local:
|
||||||
rm -f deps.mk
|
|
||||||
|
|
||||||
clean: clean.local
|
clean: clean.local
|
||||||
for d in $(PACKAGE_DIRS); do make -C $$d $@; done
|
$(LERNA) exec 'yarn clean || true'
|
||||||
|
|
||||||
veryclean: clean.local
|
veryclean: clean.local
|
||||||
for d in $(PACKAGE_DIRS); do make -C $$d $@; done
|
$(LERNA) exec 'yarn veryclean || true'
|
||||||
rm -rf node_modules
|
rm -rf node_modules
|
||||||
|
|
||||||
all: $(PACKAGE_DIRS:=/.phony_all)
|
all:
|
||||||
|
$(LERNA) exec yarn prepare
|
||||||
include deps.mk
|
|
||||||
|
|
||||||
deps.mk:
|
|
||||||
for d in $(PACKAGE_DIRS); do \
|
|
||||||
echo $$d/.phony_all: $$(fgrep 'file:' "$$d/package.json" | sed -e 's:.*/\([^/"]*\)",\?:packages/\1/.phony_all:'); \
|
|
||||||
done > $@
|
|
||||||
|
|
||||||
%/.phony_all:
|
|
||||||
+$(MAKE) -C $* all
|
|
||||||
|
|
||||||
watch:
|
watch:
|
||||||
inotifytest make -j$$(nproc) all
|
inotifytest make -j$$(nproc) all
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
all:
|
all:
|
||||||
npm i
|
yarn install
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf lib dist .nyc_output coverage tsconfig.tsbuildinfo
|
rm -rf lib dist .nyc_output coverage tsconfig.tsbuildinfo
|
||||||
|
|
225
README.md
225
README.md
|
@ -1,111 +1,36 @@
|
||||||
# Syndicate/js
|
# Syndicate/js
|
||||||
|
|
||||||
A new, efficient implementation of Syndicate for JavaScript in both
|
A third-generation implementation of Dataspaces and Syndicate for
|
||||||
node.js and the browser. The implementation techniques herein are the
|
TypeScript and JavaScript, in both node.js and the browser. The
|
||||||
subject of a forthcoming paper.
|
implementation techniques herein are the subject of a forthcoming
|
||||||
|
paper.
|
||||||
|
|
||||||
## Quickstart
|
## Building
|
||||||
|
|
||||||
### Option 1. Create a new program/library using Syndicate/js.
|
This project uses [`yarn`](https://yarnpkg.com/), not `npm`.
|
||||||
|
|
||||||
Use `npx @syndicate-lang/create DIRECTORY` or `npm init
|
The repository is a monorepo, using
|
||||||
@syndicate-lang DIRECTORY`:
|
[yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/).
|
||||||
|
[Lerna](https://lerna.js.org/) is used as a thin
|
||||||
|
[veneer atop yarn workspaces](https://medium.com/@jsilvax/a-workflow-guide-for-lerna-with-yarn-workspaces-60f97481149d),
|
||||||
|
providing convenient automation for package version management and
|
||||||
|
publication.
|
||||||
|
|
||||||
npm init @syndicate-lang myprogram
|
After a checkout, run:
|
||||||
cd myprogram
|
|
||||||
npm i .
|
|
||||||
npm run build
|
|
||||||
node lib/index.js
|
|
||||||
|
|
||||||
### Option 2. Add Syndicate/js to an existing program/library.
|
```shell
|
||||||
|
make bootstrap
|
||||||
Install a few packages from the
|
|
||||||
[@syndicate-lang](https://www.npmjs.com/org/syndicate-lang) scope on
|
|
||||||
npmjs.com:
|
|
||||||
|
|
||||||
npm i --save-dev @syndicate-lang/syntax @babel/preset-env
|
|
||||||
npm i --save @syndicate-lang/core
|
|
||||||
|
|
||||||
Then, add the `@syndicate-lang/syntax/plugin` to your `.babelrc`. Use
|
|
||||||
`npx syndicate-babel` in place of `npx babel` to compile your code.
|
|
||||||
|
|
||||||
## Creating a new Syndicate/js project
|
|
||||||
|
|
||||||
Create a skeletal `package.json`:
|
|
||||||
|
|
||||||
{
|
|
||||||
"main": "lib/index.js",
|
|
||||||
"scripts": {
|
|
||||||
"build": "npx syndicate-babel src --out-dir lib",
|
|
||||||
"clean": "rm -rf lib"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
The entry point will be `lib/index.js`; the corresponding *source*
|
|
||||||
file will be `src/index.js`.
|
|
||||||
|
|
||||||
Two `npm run` scripts are defined: one which compiles Syndicate/js
|
|
||||||
source files in `src` to plain JavaScript in `lib`. The compiler uses
|
|
||||||
Babel; we will configure Babel next.
|
|
||||||
|
|
||||||
Create a `.babelrc` file:
|
|
||||||
|
|
||||||
{
|
|
||||||
"presets": [ "@babel/preset-env" ],
|
|
||||||
"plugins": [ "@syndicate-lang/syntax/plugin" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
Now, install the necessary dependencies. Babel and the Syndicate/js
|
|
||||||
extensions are needed at build-time:
|
|
||||||
|
|
||||||
npm i --save-dev @syndicate-lang/syntax @babel/preset-env
|
|
||||||
|
|
||||||
The Syndicate/js runtime and as many drivers as you would like to use
|
|
||||||
are needed at run-time:
|
|
||||||
|
|
||||||
npm i --save @syndicate-lang/core
|
|
||||||
npm i --save @syndicate-lang/driver-timer
|
|
||||||
|
|
||||||
Finally, create the main program file. Create a directory `src`, and
|
|
||||||
then a file `src/index.js`:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const { TimeLaterThan } = activate require("@syndicate-lang/driver-timer");
|
|
||||||
|
|
||||||
spawn named 'ticker' {
|
|
||||||
field this.counter = 0;
|
|
||||||
field this.deadline = +(new Date());
|
|
||||||
|
|
||||||
on start { console.log('ticker starting'); }
|
|
||||||
on stop { console.log('ticker stopping'); }
|
|
||||||
|
|
||||||
on asserted TimeLaterThan(this.deadline) {
|
|
||||||
this.counter++;
|
|
||||||
console.log('tick', new Date(), this.counter);
|
|
||||||
this.deadline += 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
stop on (this.counter == 5);
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, compile the project:
|
Alternatively, running:
|
||||||
|
|
||||||
npm run build
|
```shell
|
||||||
|
yarn install
|
||||||
|
./node_modules/.bin/lerna exec yarn prepare
|
||||||
|
```
|
||||||
|
|
||||||
Finally, run the program:
|
will download and install all dependencies and then build all the
|
||||||
|
packages.
|
||||||
node lib/index.js
|
|
||||||
|
|
||||||
The output should be something like:
|
|
||||||
|
|
||||||
ticker starting
|
|
||||||
tick 2018-11-05T14:23:27.713Z 1
|
|
||||||
tick 2018-11-05T14:23:28.705Z 2
|
|
||||||
tick 2018-11-05T14:23:29.706Z 3
|
|
||||||
tick 2018-11-05T14:23:30.706Z 4
|
|
||||||
tick 2018-11-05T14:23:31.707Z 5
|
|
||||||
ticker stopping
|
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
|
@ -124,3 +49,109 @@ GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ## Quickstart -->
|
||||||
|
|
||||||
|
<!-- ### Option 1. Create a new program/library using Syndicate/js. -->
|
||||||
|
|
||||||
|
<!-- Use `npx @syndicate-lang/create DIRECTORY` or `npm init -->
|
||||||
|
<!-- @syndicate-lang DIRECTORY`: -->
|
||||||
|
|
||||||
|
<!-- npm init @syndicate-lang myprogram -->
|
||||||
|
<!-- cd myprogram -->
|
||||||
|
<!-- npm i . -->
|
||||||
|
<!-- npm run build -->
|
||||||
|
<!-- node lib/index.js -->
|
||||||
|
|
||||||
|
<!-- ### Option 2. Add Syndicate/js to an existing program/library. -->
|
||||||
|
|
||||||
|
<!-- Install a few packages from the -->
|
||||||
|
<!-- [@syndicate-lang](https://www.npmjs.com/org/syndicate-lang) scope on -->
|
||||||
|
<!-- npmjs.com: -->
|
||||||
|
|
||||||
|
<!-- npm i --save-dev @syndicate-lang/syntax @babel/preset-env -->
|
||||||
|
<!-- npm i --save @syndicate-lang/core -->
|
||||||
|
|
||||||
|
<!-- Then, add the `@syndicate-lang/syntax/plugin` to your `.babelrc`. Use -->
|
||||||
|
<!-- `npx syndicate-babel` in place of `npx babel` to compile your code. -->
|
||||||
|
|
||||||
|
<!-- ## Creating a new Syndicate/js project -->
|
||||||
|
|
||||||
|
<!-- Create a skeletal `package.json`: -->
|
||||||
|
|
||||||
|
<!-- { -->
|
||||||
|
<!-- "main": "lib/index.js", -->
|
||||||
|
<!-- "scripts": { -->
|
||||||
|
<!-- "build": "npx syndicate-babel src --out-dir lib", -->
|
||||||
|
<!-- "clean": "rm -rf lib" -->
|
||||||
|
<!-- } -->
|
||||||
|
<!-- } -->
|
||||||
|
|
||||||
|
<!-- The entry point will be `lib/index.js`; the corresponding *source* -->
|
||||||
|
<!-- file will be `src/index.js`. -->
|
||||||
|
|
||||||
|
<!-- Two `npm run` scripts are defined: one which compiles Syndicate/js -->
|
||||||
|
<!-- source files in `src` to plain JavaScript in `lib`. The compiler uses -->
|
||||||
|
<!-- Babel; we will configure Babel next. -->
|
||||||
|
|
||||||
|
<!-- Create a `.babelrc` file: -->
|
||||||
|
|
||||||
|
<!-- { -->
|
||||||
|
<!-- "presets": [ "@babel/preset-env" ], -->
|
||||||
|
<!-- "plugins": [ "@syndicate-lang/syntax/plugin" ] -->
|
||||||
|
<!-- } -->
|
||||||
|
|
||||||
|
<!-- Now, install the necessary dependencies. Babel and the Syndicate/js -->
|
||||||
|
<!-- extensions are needed at build-time: -->
|
||||||
|
|
||||||
|
<!-- npm i --save-dev @syndicate-lang/syntax @babel/preset-env -->
|
||||||
|
|
||||||
|
<!-- The Syndicate/js runtime and as many drivers as you would like to use -->
|
||||||
|
<!-- are needed at run-time: -->
|
||||||
|
|
||||||
|
<!-- npm i --save @syndicate-lang/core -->
|
||||||
|
<!-- npm i --save @syndicate-lang/driver-timer -->
|
||||||
|
|
||||||
|
<!-- Finally, create the main program file. Create a directory `src`, and -->
|
||||||
|
<!-- then a file `src/index.js`: -->
|
||||||
|
|
||||||
|
<!-- ```javascript -->
|
||||||
|
<!-- const { TimeLaterThan } = activate require("@syndicate-lang/driver-timer"); -->
|
||||||
|
|
||||||
|
<!-- spawn named 'ticker' { -->
|
||||||
|
<!-- field this.counter = 0; -->
|
||||||
|
<!-- field this.deadline = +(new Date()); -->
|
||||||
|
|
||||||
|
<!-- on start { console.log('ticker starting'); } -->
|
||||||
|
<!-- on stop { console.log('ticker stopping'); } -->
|
||||||
|
|
||||||
|
<!-- on asserted TimeLaterThan(this.deadline) { -->
|
||||||
|
<!-- this.counter++; -->
|
||||||
|
<!-- console.log('tick', new Date(), this.counter); -->
|
||||||
|
<!-- this.deadline += 1000; -->
|
||||||
|
<!-- } -->
|
||||||
|
|
||||||
|
<!-- stop on (this.counter == 5); -->
|
||||||
|
<!-- } -->
|
||||||
|
<!-- ``` -->
|
||||||
|
|
||||||
|
<!-- Now, compile the project: -->
|
||||||
|
|
||||||
|
<!-- npm run build -->
|
||||||
|
|
||||||
|
<!-- Finally, run the program: -->
|
||||||
|
|
||||||
|
<!-- node lib/index.js -->
|
||||||
|
|
||||||
|
<!-- The output should be something like: -->
|
||||||
|
|
||||||
|
<!-- ticker starting -->
|
||||||
|
<!-- tick 2018-11-05T14:23:27.713Z 1 -->
|
||||||
|
<!-- tick 2018-11-05T14:23:28.705Z 2 -->
|
||||||
|
<!-- tick 2018-11-05T14:23:29.706Z 3 -->
|
||||||
|
<!-- tick 2018-11-05T14:23:30.706Z 4 -->
|
||||||
|
<!-- tick 2018-11-05T14:23:31.707Z 5 -->
|
||||||
|
<!-- ticker stopping -->
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
{
|
{
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*",
|
||||||
|
"packages/*/examples/*/"
|
||||||
],
|
],
|
||||||
"version": "independent"
|
"version": "independent",
|
||||||
|
"npmClient": "yarn",
|
||||||
|
"useWorkspaces": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@syndicate-lang/root",
|
"name": "@syndicate-lang/root",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"workspaces": ["packages/*", "packages/*/examples/*/"],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||||
"@types/jest": "^26.0.19",
|
"@types/jest": "^26.0.19",
|
||||||
|
@ -8,7 +9,6 @@
|
||||||
"esm": "^3.2.25",
|
"esm": "^3.2.25",
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
"lerna": "^3.22.1",
|
"lerna": "^3.22.1",
|
||||||
"nyc": "^14.1.1",
|
|
||||||
"rollup": "^2.36.1",
|
"rollup": "^2.36.1",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
|
@ -16,8 +16,5 @@
|
||||||
"ts-node": "^9.1.1",
|
"ts-node": "^9.1.1",
|
||||||
"ts-node-dev": "^1.1.1",
|
"ts-node-dev": "^1.1.1",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@syndicate-lang/core": "file:packages/core"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
},
|
},
|
||||||
"repository": "github:syndicate-lang/syndicate-js",
|
"repository": "github:syndicate-lang/syndicate-js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "../../node_modules/.bin/tsc",
|
"compile": "../../node_modules/.bin/tsc",
|
||||||
"compile-watch": "../../node_modules/.bin/tsc -w",
|
"compile:watch": "../../node_modules/.bin/tsc -w",
|
||||||
"rollup": "../../node_modules/.bin/rollup -c",
|
"rollup": "../../node_modules/.bin/rollup -c",
|
||||||
"rollup-watch": "../../node_modules/.bin/rollup -c -w"
|
"rollup:watch": "../../node_modules/.bin/rollup -c -w"
|
||||||
},
|
},
|
||||||
"main": "dist/syndicate-compiler.js",
|
"main": "dist/syndicate-compiler.js",
|
||||||
"module": "lib/index.js",
|
"module": "lib/index.js",
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
},
|
},
|
||||||
"repository": "github:syndicate-lang/syndicate-js",
|
"repository": "github:syndicate-lang/syndicate-js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "../../node_modules/.bin/tsc",
|
"compile": "../../node_modules/.bin/tsc",
|
||||||
"compile-watch": "../../node_modules/.bin/tsc -w",
|
"compile:watch": "../../node_modules/.bin/tsc -w",
|
||||||
"rollup": "../../node_modules/.bin/rollup -c",
|
"rollup": "../../node_modules/.bin/rollup -c",
|
||||||
"rollup-watch": "../../node_modules/.bin/rollup -c -w",
|
"rollup:watch": "../../node_modules/.bin/rollup -c -w",
|
||||||
"test": "../../node_modules/.bin/jest",
|
"test": "../../node_modules/.bin/jest",
|
||||||
"cover": "../../node_modules/.bin/nyc --reporter=html ../../node_modules/.bin/jest"
|
"cover": "../../node_modules/.bin/nyc --reporter=html ../../node_modules/.bin/jest"
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=0.67, maximum-scale=0.67, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=0.67, maximum-scale=0.67, user-scalable=no">
|
||||||
<link href="css/style.css" rel="stylesheet" type="text/css">
|
<link href="css/style.css" rel="stylesheet" type="text/css">
|
||||||
<script src="node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
||||||
<script src="node_modules/@syndicate-lang/html/dist/syndicate-html.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/html/dist/syndicate-html.js"></script>
|
||||||
<script src="node_modules/@syndicate-lang/timer/dist/syndicate-timer.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/timer/dist/syndicate-timer.js"></script>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="board-area" class="board">
|
<div id="board-area" class="board">
|
||||||
|
|
|
@ -4,21 +4,21 @@
|
||||||
"description": "HTML UI Flappy Bird Syndicate example",
|
"description": "HTML UI Flappy Bird Syndicate example",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicate-tsc",
|
"compile": "syndicate-tsc",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"clean": "rm -rf lib/ index.js index.js.map"
|
"clean": "rm -rf lib/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"license": "GPL-3.0+",
|
"license": "GPL-3.0+",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../../../core",
|
"@syndicate-lang/core": "^0.5.0",
|
||||||
"@syndicate-lang/html": "file:../..",
|
"@syndicate-lang/html": "^0.0.0",
|
||||||
"@syndicate-lang/timer": "file:../../../timer"
|
"@syndicate-lang/timer": "^0.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/ts-plugin": "file:../../../ts-plugin",
|
"@syndicate-lang/ts-plugin": "^0.1.1",
|
||||||
"@syndicate-lang/tsc": "file:../../../tsc",
|
"@syndicate-lang/tsc": "^0.1.0",
|
||||||
"rollup": "^2.37.0",
|
"rollup": "^2.37.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
<head>
|
<head>
|
||||||
<title>Syndicate: Table Example</title>
|
<title>Syndicate: Table Example</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<script src="node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
||||||
<script src="node_modules/@syndicate-lang/html/dist/syndicate-html.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/html/dist/syndicate-html.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -4,20 +4,20 @@
|
||||||
"description": "Simple HTML UI Syndicate example",
|
"description": "Simple HTML UI Syndicate example",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicate-tsc",
|
"compile": "syndicate-tsc",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"clean": "rm -rf lib/ index.js index.js.map"
|
"clean": "rm -rf lib/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"license": "GPL-3.0+",
|
"license": "GPL-3.0+",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../../../core",
|
"@syndicate-lang/core": "^0.5.0",
|
||||||
"@syndicate-lang/html": "file:../.."
|
"@syndicate-lang/html": "^0.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/ts-plugin": "file:../../../ts-plugin",
|
"@syndicate-lang/ts-plugin": "^0.1.1",
|
||||||
"@syndicate-lang/tsc": "file:../../../tsc",
|
"@syndicate-lang/tsc": "^0.1.0",
|
||||||
"rollup": "^2.37.0",
|
"rollup": "^2.37.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
|
|
|
@ -13,20 +13,20 @@
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicate-tsc",
|
"compile": "syndicate-tsc",
|
||||||
"compile-watch": "npx syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
"compile:watch": "syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"rollup-watch": "npx rollup -c -w",
|
"rollup:watch": "rollup -c -w",
|
||||||
"clean": "rm -rf lib/ dist/ index.js index.js.map"
|
"clean": "rm -rf lib/ dist/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../core"
|
"@syndicate-lang/core": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/syndicatec": "file:../syndicatec",
|
"@syndicate-lang/syndicatec": "^0.1.0",
|
||||||
"@syndicate-lang/ts-plugin": "file:../ts-plugin",
|
"@syndicate-lang/ts-plugin": "^0.1.1",
|
||||||
"@syndicate-lang/tsc": "file:../tsc",
|
"@syndicate-lang/tsc": "^0.1.0",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<html>
|
<html>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<title>Demo</title>
|
<title>Demo</title>
|
||||||
<script src="node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
<h1>Look in the JavaScript console for output.</h1>
|
<h1>Look in the JavaScript console for output.</h1>
|
||||||
<main id="main">
|
<main id="main">
|
||||||
|
|
|
@ -4,18 +4,18 @@
|
||||||
"description": "Simple syndicatec example in JavaScript",
|
"description": "Simple syndicatec example in JavaScript",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicatec -d lib -b src 'src/**/*.js'",
|
"compile": "syndicatec -d lib -b src 'src/**/*.js'",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"clean": "rm -rf lib/ index.js index.js.map"
|
"clean": "rm -rf lib/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"license": "GPL-3.0+",
|
"license": "GPL-3.0+",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../../../core"
|
"@syndicate-lang/core": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/syndicatec": "file:../..",
|
"@syndicate-lang/syndicatec": "^0.1.0",
|
||||||
"rollup": "^2.37.0",
|
"rollup": "^2.37.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3"
|
"rollup-plugin-sourcemaps": "^0.6.3"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<html>
|
<html>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<title>Demo</title>
|
<title>Demo</title>
|
||||||
<script src="node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
<h1>Look in the JavaScript console for output.</h1>
|
<h1>Look in the JavaScript console for output.</h1>
|
||||||
<main id="main">
|
<main id="main">
|
||||||
|
|
|
@ -4,18 +4,18 @@
|
||||||
"description": "Simple syndicatec example in TypeScript",
|
"description": "Simple syndicatec example in TypeScript",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicatec -t -d src.ts -b src 'src/**/*.ts' && npx tsc",
|
"compile": "syndicatec -t -d src.ts -b src 'src/**/*.ts' && tsc",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"clean": "rm -rf lib/ src.ts/ index.js index.js.map"
|
"clean": "rm -rf lib/ src.ts/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"license": "GPL-3.0+",
|
"license": "GPL-3.0+",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../../../core"
|
"@syndicate-lang/core": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/syndicatec": "file:../..",
|
"@syndicate-lang/syndicatec": "^0.1.0",
|
||||||
"rollup": "^2.37.0",
|
"rollup": "^2.37.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
},
|
},
|
||||||
"repository": "github:syndicate-lang/syndicate-js",
|
"repository": "github:syndicate-lang/syndicate-js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile",
|
"prepare": "yarn compile",
|
||||||
"compile": "../../node_modules/.bin/tsc",
|
"compile": "../../node_modules/.bin/tsc",
|
||||||
"compile-watch": "../../node_modules/.bin/tsc -w"
|
"compile:watch": "../../node_modules/.bin/tsc -w"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/compiler": "file:../compiler",
|
"@syndicate-lang/compiler": "^0.1.0",
|
||||||
"@syndicate-lang/core": "file:../core",
|
"@syndicate-lang/core": "^0.5.0",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"yargs": "^16.2.0"
|
"yargs": "^16.2.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,19 +13,19 @@
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicate-tsc",
|
"compile": "syndicate-tsc",
|
||||||
"compile-watch": "npx syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
"compile:watch": "syndicate-tsc -w --verbose --intermediate-directory src.ts",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"rollup-watch": "npx rollup -c -w",
|
"rollup:watch": "rollup -c -w",
|
||||||
"clean": "rm -rf lib/ dist/ index.js index.js.map"
|
"clean": "rm -rf lib/ dist/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../core"
|
"@syndicate-lang/core": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/ts-plugin": "file:../ts-plugin",
|
"@syndicate-lang/ts-plugin": "^0.1.1",
|
||||||
"@syndicate-lang/tsc": "file:../tsc",
|
"@syndicate-lang/tsc": "^0.1.0",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ use `@syndicate-lang/tsc`'s `syndicate-tsc` command instead.
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
then `yarn install` or `npm install`.
|
then `yarn install`.
|
||||||
|
|
||||||
## Enabling the plugin in the TypeScript compiler
|
## Enabling the plugin in the TypeScript compiler
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ It should Just Work.
|
||||||
|
|
||||||
### Visual Studio Code
|
### Visual Studio Code
|
||||||
|
|
||||||
After `yarn install`/`npm install`, you will have a
|
After `yarn install`, you will have a `node_modules/typescript`
|
||||||
`node_modules/typescript` directory.
|
directory.
|
||||||
|
|
||||||
Open VS Code, and select the version of TypeScript contained therein
|
Open VS Code, and select the version of TypeScript contained therein
|
||||||
by following instructions
|
by following instructions
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<html>
|
<html>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<title>Demo</title>
|
<title>Demo</title>
|
||||||
<script src="node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
<h1>Look in the JavaScript console for output.</h1>
|
<h1>Look in the JavaScript console for output.</h1>
|
||||||
<main id="main">
|
<main id="main">
|
||||||
|
|
|
@ -4,20 +4,20 @@
|
||||||
"description": "Simple syndicatec example in TypeScript",
|
"description": "Simple syndicatec example in TypeScript",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicate-tsc",
|
"compile": "syndicate-tsc",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"clean": "rm -rf lib/ index.js index.js.map"
|
"clean": "rm -rf lib/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"license": "GPL-3.0+",
|
"license": "GPL-3.0+",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../../../core"
|
"@syndicate-lang/core": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/syndicatec": "file:../../../syndicatec",
|
"@syndicate-lang/syndicatec": "^0.1.0",
|
||||||
"@syndicate-lang/ts-plugin": "file:../..",
|
"@syndicate-lang/ts-plugin": "^0.1.1",
|
||||||
"@syndicate-lang/tsc": "file:../../../tsc",
|
"@syndicate-lang/tsc": "^0.1.0",
|
||||||
"rollup": "^2.37.0",
|
"rollup": "^2.37.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
|
|
|
@ -9,16 +9,16 @@
|
||||||
},
|
},
|
||||||
"repository": "github:syndicate-lang/syndicate-js",
|
"repository": "github:syndicate-lang/syndicate-js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile",
|
"prepare": "yarn compile",
|
||||||
"compile": "../../node_modules/.bin/tsc",
|
"compile": "../../node_modules/.bin/tsc",
|
||||||
"compile-watch": "../../node_modules/.bin/tsc -w"
|
"compile:watch": "../../node_modules/.bin/tsc -w"
|
||||||
},
|
},
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/compiler": "file:../compiler",
|
"@syndicate-lang/compiler": "^0.1.0",
|
||||||
"@syndicate-lang/core": "file:../core"
|
"@syndicate-lang/core": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<html>
|
<html>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<title>Demo</title>
|
<title>Demo</title>
|
||||||
<script src="node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
<script src="../../../../node_modules/@syndicate-lang/core/dist/syndicate.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
<h1>Look in the JavaScript console for output.</h1>
|
<h1>Look in the JavaScript console for output.</h1>
|
||||||
<main id="main">
|
<main id="main">
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
{
|
{
|
||||||
"name": "@syndicate-lang/syndicatec-typescript-example",
|
"name": "@syndicate-lang/syndicate-tsc-typescript-example",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "Simple syndicatec example in TypeScript",
|
"description": "Simple syndicate-tsc example in TypeScript",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile && npm run rollup",
|
"prepare": "yarn compile && yarn rollup",
|
||||||
"compile": "npx syndicate-tsc",
|
"compile": "syndicate-tsc",
|
||||||
"rollup": "npx rollup -c",
|
"rollup": "rollup -c",
|
||||||
"clean": "rm -rf lib/ index.js index.js.map"
|
"clean": "rm -rf lib/ index.js index.js.map"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"license": "GPL-3.0+",
|
"license": "GPL-3.0+",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "file:../../../core"
|
"@syndicate-lang/core": "^0.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@syndicate-lang/syndicatec": "file:../..",
|
"@syndicate-lang/tsc": "^0.1.0",
|
||||||
"rollup": "^2.37.0",
|
"rollup": "^2.37.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.3"
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
},
|
},
|
||||||
"repository": "github:syndicate-lang/syndicate-js",
|
"repository": "github:syndicate-lang/syndicate-js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run compile",
|
"prepare": "yarn compile",
|
||||||
"compile": "../../node_modules/.bin/tsc",
|
"compile": "../../node_modules/.bin/tsc",
|
||||||
"compile-watch": "../../node_modules/.bin/tsc -w"
|
"compile:watch": "../../node_modules/.bin/tsc -w"
|
||||||
},
|
},
|
||||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/compiler": "file:../compiler",
|
"@syndicate-lang/compiler": "^0.1.0",
|
||||||
"@syndicate-lang/core": "file:../core",
|
"@syndicate-lang/core": "^0.5.0",
|
||||||
"glob": "^7.1.6",
|
"glob": "^7.1.6",
|
||||||
"yargs": "^16.2.0"
|
"yargs": "^16.2.0"
|
||||||
},
|
},
|
||||||
|
|
4
watchall
4
watchall
|
@ -16,12 +16,12 @@ open() {
|
||||||
|
|
||||||
for d in packages/*/tsconfig.json
|
for d in packages/*/tsconfig.json
|
||||||
do
|
do
|
||||||
open "cd $(dirname $d); npm run compile-watch"
|
open "cd $(dirname $d); yarn compile:watch"
|
||||||
done
|
done
|
||||||
|
|
||||||
for d in packages/*/rollup.config.js
|
for d in packages/*/rollup.config.js
|
||||||
do
|
do
|
||||||
open "cd $(dirname $d); npm run rollup-watch"
|
open "cd $(dirname $d); yarn rollup:watch"
|
||||||
done
|
done
|
||||||
|
|
||||||
tmux select-layout even-vertical
|
tmux select-layout even-vertical
|
||||||
|
|
Loading…
Reference in New Issue