From 0f5ebc7ff6b87f29b5fb1f03069beea7990ac4e8 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Mon, 11 Sep 2023 23:32:07 -0700 Subject: [PATCH] doc: Add documentation for optional arg to convert. Also removes the useless example.d.ts file from the distribution. Updates the civet compiler to the greatest version that works on this code. Resolves #13. Resolves #14. --- README.md | 6 +++++- package.json5 | 7 ++++--- pnpm-lock.yaml | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 375ad72..f3e61fc 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ npx vrml1to97 < old.wrl > shinynew.wrl Currently this package exports just two functions: - * convert(vrml1: string): string + * convert(vrml1: string, source?: string): string The main function, takes in VRML 1 syntax (note that it does not actually check that its input is VRML 1, so its behavior is undefined @@ -47,6 +47,10 @@ Currently this package exports just two functions: VRML 1 is recognized, and some of the translations may be somewhat approximate. + If the optional second argument `source` is supplied, `convert` adds + a comment indicating that the original vrml1 came from the specified + source, before conversion to VRML97. + * tree97(vrml1: string): Tree Takes the same input as convert, but rather than returning a string, it diff --git a/package.json5 b/package.json5 index d3bc019..2c74980 100644 --- a/package.json5 +++ b/package.json5 @@ -1,6 +1,6 @@ { name: 'vrml1to97', - version: '0.2.0', + version: '0.2.1', description: 'JavaScript converter from VRML 1 to VRML97', scripts: { test: 'echo "Error: no test specified" && exit 1', @@ -13,7 +13,8 @@ // Give Typescript the info it needs: build_deps3: 'cp node_modules/@types/moo/index.d.ts deps/moo.d.ts', // Use the Typescript compiler to create the final .js files: - build_js: 'tsc && mkdir -p dist/deps && cp deps/*.js dist/deps', + build_js1: 'tsc && mkdir -p dist/deps && cp deps/*.js dist/deps', + build_js2: 'rm dist/vrml1to97/example.d.ts', // it's empty anyway // And finally add the executable and construct a package.json build_etc1: 'cp etc/*.js README.md dist', build_etc2: 'node tools/repackage.mjs < package.json5 > dist/package.json', @@ -39,7 +40,7 @@ }, type: 'module', devDependencies: { - '@danielx/civet': '^0.6.30', + '@danielx/civet': '^0.6.35', '@types/moo': '^0.5.6', 'http-server': '^14.1.1', json5: '^2.2.3', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 850cc4c..0f81dc1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,8 +11,8 @@ dependencies: devDependencies: '@danielx/civet': - specifier: ^0.6.30 - version: 0.6.30(typescript@5.2.2) + specifier: ^0.6.35 + version: 0.6.35(typescript@5.2.2) '@types/moo': specifier: ^0.5.6 version: 0.5.6 @@ -35,8 +35,8 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@danielx/civet@0.6.30(typescript@5.2.2): - resolution: {integrity: sha512-/aZjryo8T9TWVBczbeY8eO8Xmi91KkaKZG6YhCS2lCErmPXxP+zOEUATJiaZBp6AcT2bQEbW+poGyrU6BHL9Dg==} + /@danielx/civet@0.6.35(typescript@5.2.2): + resolution: {integrity: sha512-C6Yf7sQBUAnkPWRMirUT0wrQ2BtQtgc/Iz1ymPyyt+Ayo3gWlAi/wotWeCtt6Z2+WEoG8XNmmJI80B4QkCiwAQ==} engines: {node: '>=19 || ^18.6.0 || ^16.17.0'} hasBin: true peerDependencies: