
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
fabrique
is a cli to create and build libraries,
letting the user focus on the functionalities of its library, instead of the build process.
With fabrique
you'll be able to:
fabrique
is not intended to provide ci scripts and pipelines to automate the processes.
Instead, it gives a uniform and simple entry point for everyone, to publish rapidly our own libraries,
on which we may add automation, scripts, and complexity.
fabrique
is the French word for "made/factory"
When we develop javascript/typescript libraries, we frequently create new repositories,
and maintains the scripts to build, test, and debug them.
This tends to become rapidly cumbersome, especially when their number grows.
We may choose to opt in for a monorepo, and I'll tell you: yes, in many cases, this is the optimal solution.
However, in many other cases, one library per-repo makes sense, and this is where fabrique
comes in.
Another goal is to focus on simplicity: for new incomers in javascript,
learning all the tools and build processes is complicated.
You want to write your library, but you have to learn vite
, jest
, how to build and publish a lib,
install prettier
, etc. With fabrique
all comes in pre-configured.
The library requires Node.js 22+
and yarn 4+
.
We recommend to use npx:
npx fabrique [CMD]
But, you may prefer to install globally fabrique
:
npm install -g fabrique
And run a command with:
fabrique [CMD]
npx fabrique upgrade lib [name]
npx fabrique create @my-company/my-library
This command creates a new library with the name [name]
inside the folder ./[name]
(in our example: ./@my-company/my-library
).
You'll be prompted for a description, author and git url.
INFO: run the command where you want to create your project.
[name]
: the library namenpx fabrique upgrade
This command updates an existing fabrique
project: it updates the build files, the scripts, etc.
It tries to be non-destructive.
INFO: run the command inside the
fabrique
project.
--force
: forces an upgrade even if the lib is not a fabrique
project or if the version is identical. Use with caution.npx fabrique refactor [from] [to]
npx fabrique refactor my-component my-new-component
Refactors all files and directories containing
my-component
as name intomy-new-component
(recursively). And all text contentmy-component
(or derived cases) intomy-new-component
(keeping the same case).
If we run it with the following files:
We get:
And with this file content:
class MyComponent {}
// my-component
const MY_COMPONENT = null;
function my_component(myComponent: MyComponent) {}
We get:
class MyNewComponent {}
// my-new-component
const MY_NEW_COMPONENT = null;
function my_new_component(myNewComponent: MyNewComponent) {}
This command refactors files and directories recursively from the cwd
(by default, the current directory in which the script is executed).
It preserves the case of the names (ex: dash-case
, or cameCase
).
INFO: run the command inside the folder that you want to refactor.
[from]
: the "source" text to refactor. Must be dash-case
.[to]
: the "destination" text to refactor. Must be dash-case
.--dry
(default: false): runs without modifying the files. This is useful to check if your refactoring is safe or not.--cwd
(default: current folder): specifies the directory to start from.npx fabrique verdaccio
Installs and lauches verdaccio. This is useful to debug interdependent libraries.
Let's say we have:
my-lib-a
my-lib-b
with my-lib-a
as dependency
If we're working on my-lib-a
, and want to test if it works on my-lib-b
, we'll publish a dev
version of my-lib-a
on a local verdaccio
.
And consume this dev version on my-lib-b
.
We choose verdaccio instead of
npm link
because versions and dev packages are unique with a package registry.Thus, we may have
my-lib-b
consumingmy-lib-a-dev.0
andmy-lib-c
consumingmy-lib-a-dev.1
, which is not possible withnpm link
.
npx fabrique --version
# or
npx fabrique -v
Returns the current fabrique
version.
npx fabrique --help
# or
npx fabrique -h
You may get help on individual commands:
npx fabrique create -h
FAQs
CLI to build a library
The npm package fabrique receives a total of 0 weekly downloads. As such, fabrique popularity was classified as not popular.
We found that fabrique demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.