npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ryanatkn/gro

v0.147.1

Published

task runner and toolkit extending SvelteKit

Downloads

2,036

Readme

gro

task runner and toolkit extending SvelteKit 🌰 generate, run, optimize

npm i -D @ryanatkn/gro

Windows won't be supported, I chose Bash instead.

Feel free to open issues with anything you'd like to discuss or report.

about

Gro is a task runner and toolkit extending SvelteKit, Vite, and esbuild for making web frontends, servers, and libraries with TypeScript. It includes:

docs

install

depends on node >=20.12

Typical usage installs @ryanatkn/gro as a dev dependency:

npm i -D @ryanatkn/gro
npx gro # note the package is namespaced, don't install `gro`

It's handy to install globally too:

npm i -g @ryanatkn/gro
gro

usage

Gro has a task runner that discovers and runs TypeScript modules with the .task. subextension. Running gro with no args prints the tasks it finds in the current directory along with its builtin tasks:

gro # prints available tasks - defers to any local gro installation
Run a task: gro [name]
View help:  gro [name] --help

19 tasks in gro:

build      build the project
changeset  call changeset with gro patterns
check      check that everything is ready to commit
clean      remove temporary dev and build files, and optionally prune git branches
commit     commit and push to a new branch
deploy     deploy to a branch
dev        start SvelteKit and other dev plugins
format     format source files
gen        run code generation scripts
lint       run eslint
publish    bump version, publish to npm, and git push
reinstall  refreshes package-lock.json with the latest and cleanest deps
release    publish and deploy
resolve    diagnostic that logs resolved filesystem info for the given input paths
run        execute a file with the loader, like `node` but works for TypeScript
sync       run `gro gen`, update `package.json`, and optionally `npm i` to sync up
test       run tests with uvu
typecheck  run tsc on the project without emitting any files
upgrade    upgrade deps

To run tasks, Gro matches your CLI input against its filesystem conventions. It tries to do the right thing, where right is helpful but not surprising, with some magic but not too much:

gro # displays all available tasks matching `src/lib/**/*.task.ts` and Gro's builtins
gro a # tries to run `src/lib/a.task.ts`, then `./a.task.ts`, then Gro's builtin if one exists
gro a --help # displays docs for the "a" task and its args, works for every task
gro some/dir # lists all tasks inside `src/lib/some/dir`
gro some/file # runs `src/lib/some/file.task.ts`
gro some/file.task.ts # same as above

Gro can also run non-task TypeScript files directly with the gro run task or register hook:

gro run foo.ts
node --import @ryanatkn/gro/register.js foo.ts

Or programmatically:

// myfile.js
import {register} from 'node:module';
register('@ryanatkn/gro/loader.js', import.meta.url);
await import('./foo.ts');

Gro has a number of builtin tasks that you can run with the CLI. To learn more see the task docs and the generated task index.

gro dev # start developing in watch mode
gro dev -- vite --port 3003 # forward args by separating sections with --
gro build # build everything for production

Testing with uvu, including shims for SvelteKit modules:

gro test # run all tests for `*.test.ts` files with `uvu`
gro test filepattern1 some.test another.test
gro test -- uvu --forwarded_args 'to uvu'

Check all the things:

gro check # does all of the following:
gro typecheck # typecheck JS/TypeScript and Svelte
gro test # run tests
gro gen --check # ensure generated files are current
gro format --check # ensure everything is formatted
gro lint # eslint

For a usage example see the check.yml CI config.

Formatting with prettier:

gro format # format all of the source files using Prettier
gro format --check # check that all source files are formatted

Codegen with gen:

gro gen # run codegen for all `*.gen.*` files
gro gen --check # error if any generated files are new or different

To deploy: (also see src/docs/deploy.md)

gro deploy # build and push to the `deploy` branch

To publish: (also see src/docs/publish.md)

gro publish # flush changeset to changelog, bump version, publish to npm, and git push

More:

gro clean # delete all build artifacts from the filesystem
gro clean --sveltekit --nodemodules --git # also deletes dirs and prunes git branches
gro upgrade excluded-dep-1 excluded-dep-2 # npm updates to the latest everything
gro --version # print the Gro version

For more see the tasks index, the task feature docs, and the docs index.

develop

npm i
npm run bootstrap # build and link `gro` without itself - needed only once
gro build # same as `npm run bootstrap` when the `gro` CLI is available
gro test # make sure everything looks good - same as `npm test`
gro test some.test another.test

# use your development version of `gro` locally in another project:
gro build # updates the `gro` CLI, same as `npm run bootstrap`
cd ../otherproject
npm link ../gro # from `otherproject/`
gro build # from `../gro` on changes

credits 🐢🐢🐢

Gro builds on TypeScriptSvelteSvelteKitViteesbuilduvumrichokidarzod@ryanatkn/beltESLintPrettiersvelte-check & more

license 🐦

MIT