@r_masseater/tako 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { Console, Effect, FileSystem, Path, Schema } from "effect";
3
3
  import { runMain } from "@r_masseater/masseater-utils/node-main";
4
4
  import { Argument, Command, Flag } from "effect/cli";
5
5
  // package.json
6
- var version = "0.3.1";
6
+ var version = "0.3.2";
7
7
  var description = "Draws infographics from a few lines of Typst: parts for the six kinds of element, flows, a hero number and bars, laid out automatically in light and dark.";
8
8
  // src/entities/figure/model/request.ts
9
9
  const THEMES = ["light", "dark"];
@@ -42,4 +42,4 @@ const runCli = () => {
42
42
  };
43
43
  export { runCli };
44
44
 
45
- //# sourceMappingURL=cli-908uDZvm.mjs.map
45
+ //# sourceMappingURL=cli-CFmCQQWV.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-908uDZvm.mjs","names":["manifest.description","manifest.version"],"sources":["../package.json","../src/entities/figure/model/request.ts","../src/app/cli.ts"],"sourcesContent":["","import { Schema } from \"effect\";\n\nexport const THEMES = [\"light\", \"dark\"] as const;\n\nexport const FORMATS = [\"svg\", \"pdf\"] as const;\n\nconst ThemeSchema = Schema.Literals(THEMES);\n\nconst FormatSchema = Schema.Literals(FORMATS);\n\nexport type Theme = typeof ThemeSchema.Type;\n\nexport type Format = typeof FormatSchema.Type;\n\nexport type Rendered = Uint8Array;\n\nexport interface RenderRequest {\n readonly file: string;\n readonly theme: Theme;\n readonly format: Format;\n}\n","import { runMain } from \"@r_masseater/masseater-utils/node-main\";\nimport manifest from \"@r_masseater/tako/package.json\" with { type: \"json\" };\nimport { Console, Effect, FileSystem, Path } from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\n\nimport { FORMATS, THEMES } from \"#/entities/figure/index.ts\";\nimport type { Format } from \"#/entities/figure/index.ts\";\nimport { failWith } from \"#/shared/lib/errors.ts\";\n\nimport { renderFigure } from \"./render.ts\";\n\nconst DEFAULT_FORMAT: Format = \"svg\";\nconst SEQUENTIAL = { concurrency: 1 } as const;\n\nconst writeFigures = Effect.fn(\"tako.render\")(function* writeFigures(input: {\n readonly file: string;\n readonly format: Format;\n}) {\n const path = yield* Path.Path;\n const fileSystem = yield* FileSystem.FileSystem;\n const { file, format } = input;\n const stem = path.join(path.dirname(file), path.basename(file, path.extname(file)));\n yield* Effect.forEach(\n THEMES,\n (theme) =>\n Effect.gen(function* writeFigure() {\n const output = yield* Effect.tryPromise({\n try: () => renderFigure({ file, theme, format }),\n catch: failWith,\n });\n const target = `${stem}.${theme}.${format}`;\n yield* fileSystem.writeFile(target, output);\n yield* Console.log(target);\n }),\n SEQUENTIAL,\n );\n});\n\nconst render = Command.make(\n \"render\",\n {\n file: Argument.String(\"file\").pipe(Argument.withDescription(\"The .typ file to draw\")),\n format: Flag.Literals(\"format\", FORMATS).pipe(\n Flag.withDescription(\"The file format to write\"),\n Flag.withDefault(DEFAULT_FORMAT),\n ),\n },\n writeFigures,\n).pipe(Command.withDescription(\"Draws the figure next to the file, once for each theme\"));\n\nconst tako = Command.make(\"tako\").pipe(\n Command.withDescription(manifest.description),\n Command.withSubcommands([render]),\n);\n\nexport const runCli = (): void => {\n runMain(\"tako\")(Command.run(tako, { version: manifest.version }));\n};\n"],"mappings":";;;;;;;;ACEA,MAAa,SAAS,CAAC,SAAS,MAAM;AAEtC,MAAa,UAAU,CAAC,OAAO,KAAK;AAEhB,OAAO,SAAS,MAAM;AAErB,OAAO,SAAS,OAAO;;ACG5C,MAAM,iBAAyB;AAC/B,MAAM,aAAa,EAAE,aAAa,EAAE;AAEpC,MAAM,eAAe,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,aAAa,OAGlE;CACD,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,aAAa,OAAO,WAAW;CACrC,MAAM,EAAE,MAAM,WAAW;CACzB,MAAM,OAAO,KAAK,KAAK,KAAK,QAAQ,IAAI,GAAG,KAAK,SAAS,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC;CAClF,OAAO,OAAO,QACZ,SACC,UACC,OAAO,IAAI,UAAU,cAAc;EACjC,MAAM,SAAS,OAAO,OAAO,WAAW;GACtC,WAAW,aAAa;IAAE;IAAM;IAAO;GAAO,CAAC;GAC/C,OAAO;EACT,CAAC;EACD,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG;EACnC,OAAO,WAAW,UAAU,QAAQ,MAAM;EAC1C,OAAO,QAAQ,IAAI,MAAM;CAC3B,CAAC,GACH,UACF;AACF,CAAC;AAED,MAAM,SAAS,QAAQ,KACrB,UACA;CACE,MAAM,SAAS,OAAO,MAAM,CAAC,CAAC,KAAK,SAAS,gBAAgB,uBAAuB,CAAC;CACpF,QAAQ,KAAK,SAAS,UAAU,OAAO,CAAC,CAAC,KACvC,KAAK,gBAAgB,0BAA0B,GAC/C,KAAK,YAAY,cAAc,CACjC;AACF,GACA,YACF,CAAC,CAAC,KAAK,QAAQ,gBAAgB,wDAAwD,CAAC;AAExF,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC,CAAC,KAChC,QAAQ,gBAAgBA,WAAoB,GAC5C,QAAQ,gBAAgB,CAAC,MAAM,CAAC,CAClC;AAEA,MAAa,eAAqB;CAChC,QAAQ,MAAM,CAAC,CAAC,QAAQ,IAAI,MAAM,EAAWC,QAAiB,CAAC,CAAC;AAClE"}
1
+ {"version":3,"file":"cli-CFmCQQWV.mjs","names":["manifest.description","manifest.version"],"sources":["../package.json","../src/entities/figure/model/request.ts","../src/app/cli.ts"],"sourcesContent":["","import { Schema } from \"effect\";\n\nexport const THEMES = [\"light\", \"dark\"] as const;\n\nexport const FORMATS = [\"svg\", \"pdf\"] as const;\n\nconst ThemeSchema = Schema.Literals(THEMES);\n\nconst FormatSchema = Schema.Literals(FORMATS);\n\nexport type Theme = typeof ThemeSchema.Type;\n\nexport type Format = typeof FormatSchema.Type;\n\nexport type Rendered = Uint8Array;\n\nexport interface RenderRequest {\n readonly file: string;\n readonly theme: Theme;\n readonly format: Format;\n}\n","import { runMain } from \"@r_masseater/masseater-utils/node-main\";\nimport manifest from \"@r_masseater/tako/package.json\" with { type: \"json\" };\nimport { Console, Effect, FileSystem, Path } from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\n\nimport { FORMATS, THEMES } from \"#/entities/figure/index.ts\";\nimport type { Format } from \"#/entities/figure/index.ts\";\nimport { failWith } from \"#/shared/lib/errors.ts\";\n\nimport { renderFigure } from \"./render.ts\";\n\nconst DEFAULT_FORMAT: Format = \"svg\";\nconst SEQUENTIAL = { concurrency: 1 } as const;\n\nconst writeFigures = Effect.fn(\"tako.render\")(function* writeFigures(input: {\n readonly file: string;\n readonly format: Format;\n}) {\n const path = yield* Path.Path;\n const fileSystem = yield* FileSystem.FileSystem;\n const { file, format } = input;\n const stem = path.join(path.dirname(file), path.basename(file, path.extname(file)));\n yield* Effect.forEach(\n THEMES,\n (theme) =>\n Effect.gen(function* writeFigure() {\n const output = yield* Effect.tryPromise({\n try: () => renderFigure({ file, theme, format }),\n catch: failWith,\n });\n const target = `${stem}.${theme}.${format}`;\n yield* fileSystem.writeFile(target, output);\n yield* Console.log(target);\n }),\n SEQUENTIAL,\n );\n});\n\nconst render = Command.make(\n \"render\",\n {\n file: Argument.String(\"file\").pipe(Argument.withDescription(\"The .typ file to draw\")),\n format: Flag.Literals(\"format\", FORMATS).pipe(\n Flag.withDescription(\"The file format to write\"),\n Flag.withDefault(DEFAULT_FORMAT),\n ),\n },\n writeFigures,\n).pipe(Command.withDescription(\"Draws the figure next to the file, once for each theme\"));\n\nconst tako = Command.make(\"tako\").pipe(\n Command.withDescription(manifest.description),\n Command.withSubcommands([render]),\n);\n\nexport const runCli = (): void => {\n runMain(\"tako\")(Command.run(tako, { version: manifest.version }));\n};\n"],"mappings":";;;;;;;;ACEA,MAAa,SAAS,CAAC,SAAS,MAAM;AAEtC,MAAa,UAAU,CAAC,OAAO,KAAK;AAEhB,OAAO,SA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3
3
  // bin/tako.ts
4
4
  enableCompileCache();
5
- const { runCli } = await import("./cli-908uDZvm.mjs");
5
+ const { runCli } = await import("./cli-CFmCQQWV.mjs");
6
6
  runCli();
7
7
  export {};
8
8
 
9
- //# sourceMappingURL=cli.mjs.map
9
+ //# sourceMappingURL=tako.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tako.mjs","names":[],"sources":["../bin/tako.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { enableCompileCache } from \"node:module\";\n\nenableCompileCache();\n\nconst { runCli } = await import(\"#/app/cli.ts\");\n\nrunCli();\n"],"mappings":";;;AAGA,mBAAmB;AAEnB,MAAM,EAAE,WAAW,MAAM,OAAO;AAEhC,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r_masseater/tako",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Draws infographics from a few lines of Typst: parts for the six kinds of element, flows, a hero number and bars, laid out automatically in light and dark.",
5
5
  "keywords": [
6
6
  "diagram",
@@ -19,7 +19,7 @@
19
19
  "directory": "libs/tako"
20
20
  },
21
21
  "bin": {
22
- "tako": "./dist/cli.mjs"
22
+ "tako": "./dist/tako.mjs"
23
23
  },
24
24
  "files": [
25
25
  "LICENSE",
@@ -33,10 +33,7 @@
33
33
  "#/*": "./src/*"
34
34
  },
35
35
  "exports": {
36
- ".": {
37
- "types": "./dist/index.d.mts",
38
- "default": "./dist/index.mjs"
39
- },
36
+ ".": "./dist/index.mjs",
40
37
  "./package.json": "./package.json",
41
38
  "./typ/*": "./typ/*"
42
39
  },
@@ -47,7 +44,7 @@
47
44
  "dependencies": {
48
45
  "@material-symbols/svg-400": "^0.49.0",
49
46
  "@myriaddreamin/typst-ts-node-compiler": "^0.7.0",
50
- "@r_masseater/masseater-utils": "^0.2.0"
47
+ "@r_masseater/masseater-utils": "^0.2.1"
51
48
  },
52
49
  "devDependencies": {
53
50
  "@effect/platform-node": "4.2.0",
package/dist/cli.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.mjs","names":[],"sources":["../bin/tako.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { enableCompileCache } from \"node:module\";\n\nenableCompileCache();\n\nconst { runCli } = await import(\"#/app/cli.ts\");\n\nrunCli();\n"],"mappings":";;;AAGA,mBAAmB;AAEnB,MAAM,EAAE,WAAW,MAAM,OAAO;AAEhC,OAAO"}
File without changes