From 1e4d508dbdfedfbc3e0a557a85764fc66c35b0de Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Wed, 1 Nov 2023 12:22:32 +0800 Subject: [PATCH 1/2] dev: move templates --- docs/cookery/get-started.typ | 10 +++++----- package.json | 2 +- .../node.js-compiler-next/README.md | 0 .../node.js-compiler-next/package.json | 0 .../src/cached-font-middleware.ts | 0 .../node.js-compiler-next/src/main.package.ts | 0 .../node.js-compiler-next/src/main.snippet.ts | 0 .../node.js-compiler-next/src/main.ts | 0 .../node.js-compiler-next/tsconfig.json | 0 .../templates => templates}/node.js-next/README.md | 0 .../templates => templates}/node.js-next/package.json | 0 .../templates => templates}/node.js-next/src/main.ts | 0 .../templates => templates}/node.js-next/tsconfig.json | 0 {packages/templates => templates}/node.js/README.md | 0 {packages/templates => templates}/node.js/package.json | 0 {packages/templates => templates}/node.js/src/main.ts | 0 .../templates => templates}/node.js/tsconfig.json | 0 .../templates => templates}/ts-node-next/README.md | 0 .../templates => templates}/ts-node-next/package.json | 0 .../templates => templates}/ts-node-next/src/main.ts | 0 .../templates => templates}/ts-node-next/tsconfig.json | 0 {packages/templates => templates}/ts-node/README.md | 0 {packages/templates => templates}/ts-node/package.json | 0 {packages/templates => templates}/ts-node/src/main.ts | 0 .../templates => templates}/ts-node/tsconfig.json | 0 25 files changed, 6 insertions(+), 6 deletions(-) rename {packages/templates => templates}/node.js-compiler-next/README.md (100%) rename {packages/templates => templates}/node.js-compiler-next/package.json (100%) rename {packages/templates => templates}/node.js-compiler-next/src/cached-font-middleware.ts (100%) rename {packages/templates => templates}/node.js-compiler-next/src/main.package.ts (100%) rename {packages/templates => templates}/node.js-compiler-next/src/main.snippet.ts (100%) rename {packages/templates => templates}/node.js-compiler-next/src/main.ts (100%) rename {packages/templates => templates}/node.js-compiler-next/tsconfig.json (100%) rename {packages/templates => templates}/node.js-next/README.md (100%) rename {packages/templates => templates}/node.js-next/package.json (100%) rename {packages/templates => templates}/node.js-next/src/main.ts (100%) rename {packages/templates => templates}/node.js-next/tsconfig.json (100%) rename {packages/templates => templates}/node.js/README.md (100%) rename {packages/templates => templates}/node.js/package.json (100%) rename {packages/templates => templates}/node.js/src/main.ts (100%) rename {packages/templates => templates}/node.js/tsconfig.json (100%) rename {packages/templates => templates}/ts-node-next/README.md (100%) rename {packages/templates => templates}/ts-node-next/package.json (100%) rename {packages/templates => templates}/ts-node-next/src/main.ts (100%) rename {packages/templates => templates}/ts-node-next/tsconfig.json (100%) rename {packages/templates => templates}/ts-node/README.md (100%) rename {packages/templates => templates}/ts-node/package.json (100%) rename {packages/templates => templates}/ts-node/src/main.ts (100%) rename {packages/templates => templates}/ts-node/tsconfig.json (100%) diff --git a/docs/cookery/get-started.typ b/docs/cookery/get-started.typ index 74bd756b..0b357b05 100644 --- a/docs/cookery/get-started.typ +++ b/docs/cookery/get-started.typ @@ -100,19 +100,19 @@ renderer.init({}).then(...); There are several templates for developing typst.ts with Node.js: -- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/packages/templates/node.js")[Use renderer, with typescript configured with:] +- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/templates/node.js")[Use renderer, with typescript configured with:] ```json { "moduleResolution": "Node" }``` or #linebreak() ```json { "moduleResolution": "Node10" }``` -- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/packages/templates/node.js-next")[Use renderer, with typescript configured with:] +- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/templates/node.js-next")[Use renderer, with typescript configured with:] ```json { "moduleResolution": "Node16" }``` or #linebreak() ```json { "moduleResolution": "NodeNext" }``` -- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/packages/templates/ts-node")[Use ts-node, with typescript configured with:] +- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/templates/ts-node")[Use ts-node, with typescript configured with:] ```json { "moduleResolution": "Node" }``` or #linebreak() ```json { "moduleResolution": "Node10" }``` -- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/packages/templates/ts-node-next")[Use ts-node, with and typescript configured with:] +- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/templates/ts-node-next")[Use ts-node, with and typescript configured with:] ```json { "moduleResolution": "Node16" }``` or #linebreak() ```json { "moduleResolution": "NodeNext" }``` -- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/packages/templates/node.js-compiler-next")[Use compiler, with typescript configured with:] +- #link("https://github.com/Myriad-Dreamin/typst.ts/tree/main/templates/node.js-compiler-next")[Use compiler, with typescript configured with:] ```json { "moduleResolution": "Node16" }``` or #linebreak() ```json { "moduleResolution": "NodeNext" }``` diff --git a/package.json b/package.json index 070fa18f..ab154d2e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "packages/typst.react", "packages/typst.vue3", "packages/typst.angular", - "packages/templates/*", + "templates/*", "projects/**/*" ], "scripts": { diff --git a/packages/templates/node.js-compiler-next/README.md b/templates/node.js-compiler-next/README.md similarity index 100% rename from packages/templates/node.js-compiler-next/README.md rename to templates/node.js-compiler-next/README.md diff --git a/packages/templates/node.js-compiler-next/package.json b/templates/node.js-compiler-next/package.json similarity index 100% rename from packages/templates/node.js-compiler-next/package.json rename to templates/node.js-compiler-next/package.json diff --git a/packages/templates/node.js-compiler-next/src/cached-font-middleware.ts b/templates/node.js-compiler-next/src/cached-font-middleware.ts similarity index 100% rename from packages/templates/node.js-compiler-next/src/cached-font-middleware.ts rename to templates/node.js-compiler-next/src/cached-font-middleware.ts diff --git a/packages/templates/node.js-compiler-next/src/main.package.ts b/templates/node.js-compiler-next/src/main.package.ts similarity index 100% rename from packages/templates/node.js-compiler-next/src/main.package.ts rename to templates/node.js-compiler-next/src/main.package.ts diff --git a/packages/templates/node.js-compiler-next/src/main.snippet.ts b/templates/node.js-compiler-next/src/main.snippet.ts similarity index 100% rename from packages/templates/node.js-compiler-next/src/main.snippet.ts rename to templates/node.js-compiler-next/src/main.snippet.ts diff --git a/packages/templates/node.js-compiler-next/src/main.ts b/templates/node.js-compiler-next/src/main.ts similarity index 100% rename from packages/templates/node.js-compiler-next/src/main.ts rename to templates/node.js-compiler-next/src/main.ts diff --git a/packages/templates/node.js-compiler-next/tsconfig.json b/templates/node.js-compiler-next/tsconfig.json similarity index 100% rename from packages/templates/node.js-compiler-next/tsconfig.json rename to templates/node.js-compiler-next/tsconfig.json diff --git a/packages/templates/node.js-next/README.md b/templates/node.js-next/README.md similarity index 100% rename from packages/templates/node.js-next/README.md rename to templates/node.js-next/README.md diff --git a/packages/templates/node.js-next/package.json b/templates/node.js-next/package.json similarity index 100% rename from packages/templates/node.js-next/package.json rename to templates/node.js-next/package.json diff --git a/packages/templates/node.js-next/src/main.ts b/templates/node.js-next/src/main.ts similarity index 100% rename from packages/templates/node.js-next/src/main.ts rename to templates/node.js-next/src/main.ts diff --git a/packages/templates/node.js-next/tsconfig.json b/templates/node.js-next/tsconfig.json similarity index 100% rename from packages/templates/node.js-next/tsconfig.json rename to templates/node.js-next/tsconfig.json diff --git a/packages/templates/node.js/README.md b/templates/node.js/README.md similarity index 100% rename from packages/templates/node.js/README.md rename to templates/node.js/README.md diff --git a/packages/templates/node.js/package.json b/templates/node.js/package.json similarity index 100% rename from packages/templates/node.js/package.json rename to templates/node.js/package.json diff --git a/packages/templates/node.js/src/main.ts b/templates/node.js/src/main.ts similarity index 100% rename from packages/templates/node.js/src/main.ts rename to templates/node.js/src/main.ts diff --git a/packages/templates/node.js/tsconfig.json b/templates/node.js/tsconfig.json similarity index 100% rename from packages/templates/node.js/tsconfig.json rename to templates/node.js/tsconfig.json diff --git a/packages/templates/ts-node-next/README.md b/templates/ts-node-next/README.md similarity index 100% rename from packages/templates/ts-node-next/README.md rename to templates/ts-node-next/README.md diff --git a/packages/templates/ts-node-next/package.json b/templates/ts-node-next/package.json similarity index 100% rename from packages/templates/ts-node-next/package.json rename to templates/ts-node-next/package.json diff --git a/packages/templates/ts-node-next/src/main.ts b/templates/ts-node-next/src/main.ts similarity index 100% rename from packages/templates/ts-node-next/src/main.ts rename to templates/ts-node-next/src/main.ts diff --git a/packages/templates/ts-node-next/tsconfig.json b/templates/ts-node-next/tsconfig.json similarity index 100% rename from packages/templates/ts-node-next/tsconfig.json rename to templates/ts-node-next/tsconfig.json diff --git a/packages/templates/ts-node/README.md b/templates/ts-node/README.md similarity index 100% rename from packages/templates/ts-node/README.md rename to templates/ts-node/README.md diff --git a/packages/templates/ts-node/package.json b/templates/ts-node/package.json similarity index 100% rename from packages/templates/ts-node/package.json rename to templates/ts-node/package.json diff --git a/packages/templates/ts-node/src/main.ts b/templates/ts-node/src/main.ts similarity index 100% rename from packages/templates/ts-node/src/main.ts rename to templates/ts-node/src/main.ts diff --git a/packages/templates/ts-node/tsconfig.json b/templates/ts-node/tsconfig.json similarity index 100% rename from packages/templates/ts-node/tsconfig.json rename to templates/ts-node/tsconfig.json From 87d3e76ee19d388f5e777eafdc480755bc8e9949 Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Wed, 1 Nov 2023 12:25:48 +0800 Subject: [PATCH 2/2] docs: mention templates --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 619a040f..51e1417c 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,10 @@ it has the git dependency on [typst](https://github.com/typst/typst). See [Documentation](https://myriad-dreamin.github.io/typst.ts/cookery). +### Templates + +Please check [Templates](./templates) and usage in [Get Started](https://myriad-dreamin.github.io/typst.ts/cookery/get-started.html). + ### Develop projects along with a local built typst.ts You can put your owned projects under the `projects` folder, and that yarn workspace will