scaleway/scaleway-lib
TypeScript
Captured source
source ↗scaleway/scaleway-lib
Description: scaleway-lib is a set of NPM packages used at Scaleway
Language: TypeScript
License: MIT
Stars: 33
Forks: 14
Open issues: 5
Created: 2021-01-19T12:41:01Z
Pushed: 2026-06-10T15:37:19Z
Default branch: main
Fork: no
Archived: no
README: !scaleway
scaleway-lib
scaleway-lib is a set of NPM packages used at Scaleway.
---
- [Available packages](#available-packages)
- [Development](#development)
- [Locally](#locally)
- [Link against another project (with
yalc) => FAVORED](#link-against-another-project-with-yalc--favored) - [Testing a package in a pnpm workspace](#testing-a-package-in-a-pnpm-workspace)
- [Link against another project (with
pnpm link)](#link-against-another-project-with-pnpm-link) - [Linting](#linting)
- [Unit Test](#unit-test)
- [Notes](#notes)
- [Tools](#tools)
- [On build targets](#on-build-targets)
- [On build outputs](#on-build-outputs)
- [On commits](#on-commits)
- [Contributing Guidelines](#contributing-guidelines)
---
Available packages
- [
@scaleway/changesets-renovate](./packages/changesets-renovate/README.md): A tool to automatically create changeset on renovate branches
- [
@scaleway/fuzzy-search](./packages/fuzzy-search/README.md): fuzzy search utility
- [
@scaleway/oxfmt-config](./packages/oxfmt-config/README.md): An oxfmt opiniated configuration.
- [
@scaleway/oxlint-config](./packages/oxlint-config/README.md): An oxlint opiniated configuration.
- [
@scaleway/random-name](./packages/random-name/README.md): A tiny utility to generate random names.
- [
@scaleway/regex](./packages/regex/README.md): usefull regex named.
- [
@scaleway/use-countdown](./packages/use-countdown/README.md)
- [
@scaleway/use-dataloader](./packages/use-dataloader/README.md):
A tiny react hook to to handle api requests.
- [
@scaleway/use-growthbook](./packages/use-growthbook/README.md):
A tiny hook to handle Growthbook Feature flag and A/B test tool.
- [
@scaleway/use-i18n](./packages/use-i18n/README.md):
A tiny hook to handle i18n.
- [
@scaleway/use-interval](./packages/use-interval/README.md):
- [
@scaleway/react-router](./packages/react-router/README.md):
- [
@scaleway/use-storage](./packages/use-storage/README.md): A React hook to interact with local/session storage in reactive way with the same API as setState
- [
@scaleway/use-visual-persistence](./packages/use-visual-persistence/README.md)
- [
@scaleway/validate-icu-locales](./packages/validate-icu-locales/README.md): A small cli to check ICU locales error
Development
Locally
$ git clone git@github.com:scaleway/scaleway-lib.git $ cd scaleway-lib $ pnpm install $ # ... do your changes ... $ pnpm run lint $ pnpm run test:unit
Link against another project (with yalc) => FAVORED
> `yalc` is a tool aiming to simplify working with local npm packages by providing a different workflow than npm/yarn/pnpm link, hence avoiding most of their issues with module resolving.
$ pnpm install -g yalc # Make sure to have the yalc binary
$ cd scaleway-lib/packages/example_package $ pnpm run build && yalc publish $ # Now it's ready to install in your project $ cd ../../../project-something $ yalc add @scaleway/package-name $ cd ../scaleway-lib/packages/example_package $ # If you do some changes into your package $ pnpm run build && yalc publish --push --sig # --push will automatically update the package on projects where it have been added, --sig updates the signature hash to trigger webpack update
> :warning: since 1.0.0.pre.51 (2021-04-23), yalc publish needs the --sig option to trigger webpack module actual update.
> :warning: yalc create a yalc.lock and updates the package.json in the target project. Make sure to not commit these changes
Testing a package in a pnpm workspace
If you need to test a package that is used in more than one project in a pnpm workspace, it can be tedious to add the package in all projects and you might still have issues with modules resolution.
In order to install your local package in all the projects of the monorepo, you can use the pnpm overrides feature:
- first install the package using yalc (
yalc add @scaleway/package) at the root of the pnpm workspace - then add a pnpm override to use the yalc version in the whole workspace
Example package.json:
"dependencies": {
"@scaleway/package": "file:.yalc/@scaleway/package", // <- added by yalc
}
"pnpm": {
"overrides": {
"@scaleway/package": "$@scaleway/package", // <- tell pnpm to use the version referenced in the dependencies
}
}Link against another project (with pnpm link)
$ cd packages/example_package && pnpm link $ cd - && pnpm run build # rebuild the package $ # Now it's ready to link into your project $ cd ../project-something $ pnpm link @scaleway/example_package
Linting
$ pnpm run lint $ pnpm run lint:fix
Unit Test
$ pnpm run test:unit # Will run all tests $ pnpm run test:unit:coverage # Will generate a coverage report
Notes
Tools
This projects uses
- turbo to manage our monorepo setup
- tsdown to compile and bundle our packages
- oxlint & oxfmt to lint and format files
- vitest to test our packages
On build targets
For platform neutral packages the target is esnext by default. And for Node cli packages target is node@24
On build outputs
We only output ESM modules. Please read this.
On commits
We don't enforce anything on the commit level but your PR title must respect the conventionnal commits convention
Contributing Guidelines
- Ensure tests are still ok and code coverage have not decreased
- Follow linter rules ([tldr](#linting)).
- CI is enforced, you won't be able to merge unless pipeline is successful.