Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store should be immutable #194

Open
wants to merge 1 commit into
base: spec
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion spec/STORE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ Pitfalls to watch out for:

### Global store

A global store should be located at `~/.store/<version>` by default.
A global store (a.k.a. machine store) should be located at `~/.store/<version>` by default.

### Dedicated store

A dedicated store should be at `node_modules/.store`. The reason why it doesn't need a subfolder for different versions is because one node_modules can use only one store (see [the storePath field of .modules.yaml](#storepath)).

## Store immutability

A store should be immutable. Execution of modules from the store cannot remove/add/change files in the store. As a consequence:
* lifecycle events should not happen inside the store directory.
* programs shouldn't know about the existense of the store, when using modules. Files from the store should be either copied or linked (a.k.a. hard linked). Symlinking is not an option, because Node.js ignores symlinks when resolving dependencies.

## Store directory structure

Path structure: `<package source>/<package id>`. The path to a package in the store is the package's ID.
Expand Down