@stim-cli/core 1.0.0-rc.4 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -11
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +6 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
# @stim-cli/core
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[`@stim-cli/metro`](https://www.npmjs.com/package/@stim-cli/metro) and
|
|
5
|
-
[`@stim-cli/expo-build-cache`](https://www.npmjs.com/package/@stim-cli/expo-build-cache)
|
|
6
|
-
must agree on, implemented once: where the stim-cli config dir and the two
|
|
7
|
-
shared caches live (env override > machine config > default), how a build
|
|
8
|
-
cache key is derived, and how a cache registers itself for `stim gc`.
|
|
9
|
-
Metro cache overrides name a parent directory; the sanitized app name is always
|
|
10
|
-
appended beneath it, just as it is beneath the default root.
|
|
3
|
+
Shared internal contracts for Stim and its cache packages.
|
|
11
4
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
The package contains runtime-path resolution, cache-key generation, cache
|
|
6
|
+
registration, and directory locking. It is not a user-facing API.
|
|
7
|
+
|
|
8
|
+
The npm scope remains `@stim-cli` until the `@stim` scope is available.
|
package/dist/index.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ declare function cachePathSetting(key: "buildCache" | "metroCache"): string | nu
|
|
|
16
16
|
declare function cacheNameSegment(name: string | null | undefined): string;
|
|
17
17
|
declare function buildCacheRoot(): string;
|
|
18
18
|
declare function metroCacheRoot(name?: string | null): string;
|
|
19
|
-
declare const STORE_ROOT_TAG = "
|
|
19
|
+
declare const STORE_ROOT_TAG = "stimStoreRoot";
|
|
20
20
|
declare function tagSharedStore<T extends object>(store: T, root: string): T;
|
|
21
21
|
declare function sharedStoreRoot(store: unknown): string | null;
|
|
22
22
|
interface BuildRunOptions {
|
package/dist/index.mjs
CHANGED
|
@@ -36,8 +36,8 @@ function acquireDirLock(lockPath, { staleMs, waitMs, pollMs, ensureParent }) {
|
|
|
36
36
|
continue;
|
|
37
37
|
}
|
|
38
38
|
if (Date.now() >= deadline) {
|
|
39
|
-
const error = /* @__PURE__ */ new Error(`Timed out waiting for the lock at ${lockPath}. Another
|
|
40
|
-
error.code = "
|
|
39
|
+
const error = /* @__PURE__ */ new Error(`Timed out waiting for the lock at ${lockPath}. Another Stim process is holding it; if none is running, remove that directory.`);
|
|
40
|
+
error.code = "STIM_LOCK_TIMEOUT";
|
|
41
41
|
error.lockPath = lockPath;
|
|
42
42
|
throw error;
|
|
43
43
|
}
|
|
@@ -77,7 +77,7 @@ function withDirLock(lockPath, fn, { staleMs = DEFAULT_LOCK_STALE_MS, waitMs = D
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
function configDir() {
|
|
80
|
-
return process.env.
|
|
80
|
+
return process.env.STIM_HOME || path.join(os.homedir(), ".stim");
|
|
81
81
|
}
|
|
82
82
|
function workspaceSlug(projectRoot) {
|
|
83
83
|
return path.basename(path.resolve(projectRoot)).normalize("NFKD").replace(/[^A-Za-z0-9]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase().slice(0, 48) || "workspace";
|
|
@@ -106,13 +106,13 @@ function cacheNameSegment(name) {
|
|
|
106
106
|
return String(name).replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^\.+/, "") || "app";
|
|
107
107
|
}
|
|
108
108
|
function buildCacheRoot() {
|
|
109
|
-
return process.env.
|
|
109
|
+
return process.env.STIM_BUILD_CACHE || cachePathSetting("buildCache") || path.join(configDir(), "build-cache");
|
|
110
110
|
}
|
|
111
111
|
function metroCacheRoot(name) {
|
|
112
|
-
const root = process.env.
|
|
112
|
+
const root = process.env.STIM_METRO_CACHE || cachePathSetting("metroCache") || path.join(configDir(), "metro-cache");
|
|
113
113
|
return name === void 0 || name === null || name === "" ? root : path.join(root, cacheNameSegment(name));
|
|
114
114
|
}
|
|
115
|
-
const STORE_ROOT_TAG = "
|
|
115
|
+
const STORE_ROOT_TAG = "stimStoreRoot";
|
|
116
116
|
function tagSharedStore(store, root) {
|
|
117
117
|
try {
|
|
118
118
|
Object.defineProperty(store, STORE_ROOT_TAG, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stim-cli/core",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
4
|
-
"description": "Shared
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
|
+
"description": "Shared internal cache and runtime primitives for Stim packages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|