syndicate-js/packages/create
Tony Garnock-Jones 576023fb8a Publish
- @syndicate-lang/create@0.11.4
 - @syndicate-lang/html@0.11.10
2022-10-18 21:28:50 +02:00
..
bin @syndicate-lang/create package 2022-04-22 13:54:49 +02:00
src @syndicate-lang/create package 2022-04-22 13:54:49 +02:00
template Avoid crypto.randomUUID because it is only available in "secure" contexts 2022-10-18 21:01:47 +02:00
README.md preserves.dev 2022-05-24 13:53:18 +02:00
package.json Publish 2022-10-18 21:28:50 +02:00
tsconfig.json @syndicate-lang/create package 2022-04-22 13:54:49 +02:00

README.md

@syndicate-lang/create

To create a new program/library using Syndicate/js, use yarn create @syndicate-lang DIRECTORY:

yarn create @syndicate-lang myprogram
cd myprogram
yarn
yarn serve

Then visit http://localhost:8000/. By default, the generated app expects a syndicate-server to be running on port 9001 exposing a dummy capability to a dataspace entity. Suitable configuration can be found in the syndicate-server.config.pr file. Start the server like this:

syndicate-server -c ./syndicate-server.config.pr

If you aren't writing a web app in Syndicate, you can remove the following files from the generated module as well as the serve script from package.json:

  • index.html
  • style.css
  • rollup.config.js
  • syndicate-server.config.pr

In that case, your index.ts can be as simple as

import { Dataspace } from "@syndicate-lang/core";
Dataspace.boot(ds => {
    /* your app goes here */
});

If you don't need to define any Preserves schemas in your application, remove the protocols/ directory as well as the various regenerate scripts and any mention of the src/gen/ directory from package.json.