Overview of repo:
src/source codesrc/exports/*.ts- the entry points of the packagesrc/docs/docs.mdpagestests- tests of the package in various platforms (bun, browser, ...), very superficialcodegen- code generators executed when runningnpm run codegen
Add env var AT_PAT=<pat> with PAT found at https://developer.audiotool.com/personal-access-tokens.
To create a new test project testing the current package's functionality, best use bun or npm, then:
- in this directory, call
npm/bun link - in your new directory, call
npm/bun link @audiotool/nexus --save
This will create a symlink from your project to this package's dist directory.
If you run npm run build here, your new directory will immediately see the updated
package.
What's finally uploaded to npm can be seen by calling npm run pack, which generates a .tgz file in dist/; this file can then be installed with:
npm/bun install <file>.tgz
You can then check what's part of the package by checking node_modules/@audiotool/nexus or similar.
tsconfig.json: configures the typescript settingstypedoc.config.mjs: configures the docs generatorvite.config.ts: configures vite, which bundles the package, togetherpackage.jsonpackage.json: configures the package as well: imports, exports
The package path aliases like @audiotool/nexus/utils have to be mentioned
in multiple config files. To avoid a mismatch between the exported types, the exported
js files, and the exported documentation, the files were interlinked:
package.json: defines the main package entry points viaexportsfieldvite.config.ts, defines how vite bundles the files during build, which includes:- a list of entry points
entrygenerated frompackage.json(& validated) - a list of path aliases like
@utils, internal to the package, imported fromtsconfig.json
- a list of entry points
typedoc.config.mjsconfigures the docs buildertypedoc(run usingnpm run typedoc). It also derives the package exports frompackage.json