The project requires pnpm 8
and Node.js 16
(or above). Run pnpm install
to install dependencies of all workspace packages.
There are 3 parts to this repo:
- packages/publint - The
publint
npm package - site - The website
- analysis - The analysis automation that lints popular npm packages for displaying their results on the website
The packages/publint
workspace has the lib
, src
, and tests
directories.
src
contains most of publint
's source code, and lib
contains entrypoints that uses APIs from src
(to provide default environment-specific information). You can check the exports
field of packages/publint/package.json
to see how they're linked.
tests
contains unit tests that runs the test projects under tests/fixtures
.
The site
workspace is a Vite & Svelte multiple page application. It powers https://publint.dev.
It has a packfix
command (pnpm packfix
) which packages up fixtures from packages/publint/tests/fixtures. Once packed, when running the dev server, you can search for the fixture name, e.g. publint-test-1
, and it'll load the package locally. This can be used for quick testing.
The analysis
workspace contains a simple index.js
script that runs publint
on popular npm packages. Run pnpm start
to run the script to compute the results. The downloaded package tarballs and results are cached in the cache
directory, so subsequent runs are faster. Even so, the script will fetch npm to check the latest package versions, if you want to bypass this on subsequent runs as well, use the --cache
flag. The final results are written to cache/_results.json
and also loaded by the site locally.
The pnpm gist
command uploads and stores the results to a GitHub gist. It is then proxied and served by https://publint.dev/analysis.json. This is automated to run on CI and by me (@bluwy) only.
There's also an additional pnpm bench
command that solely benchmarks the time it takes to lint the poplar packages. This can be used to test performance improvements. The caching mechanism is the same as pnpm start
, and also supports the --cache
flag.
You can run the unit tests with pnpm test
in the root or packages/publint
directory.
Pull request titles should preferably use the format of <Verb> <something>
. First word is capitalized and singular. Examples:
- Fix docs styles
- Support JSX
- Update core options
Don't worry if it's not perfect! I'll tweak it before merging.
For commit messages, feel free to use your own convention and commit as much as you want. The pull request will be squashed merged into a single commit based on the pull request title.
If a change should result in a new release of a package (e.g. packages/publint
), you can run pnpm changeset
at the root of the project to create a changeset. See .changeset/README.md for more information. Changeset description should also follow the same format as pull request titles and can be more descriptive if needed.