@ng-annotate/vite-plugin 0.3.7 → 0.3.8
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/dist/store.js +3 -2
- package/package.json +1 -1
package/dist/store.js
CHANGED
|
@@ -4,10 +4,11 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
4
4
|
const EMPTY_STORE = { sessions: {}, annotations: {} };
|
|
5
5
|
// ─── File paths ───────────────────────────────────────────────────────────────
|
|
6
6
|
export const STORE_DIR = '.ng-annotate';
|
|
7
|
-
|
|
7
|
+
const PROJECT_ROOT = process.env.NG_ANNOTATE_PROJECT_ROOT ?? process.cwd();
|
|
8
|
+
export const STORE_PATH = path.join(PROJECT_ROOT, STORE_DIR, 'store.json');
|
|
8
9
|
// ─── Store init ───────────────────────────────────────────────────────────────
|
|
9
10
|
export function ensureStore() {
|
|
10
|
-
const dir = path.join(
|
|
11
|
+
const dir = path.join(PROJECT_ROOT, STORE_DIR);
|
|
11
12
|
if (!fs.existsSync(dir))
|
|
12
13
|
fs.mkdirSync(dir, { recursive: true });
|
|
13
14
|
if (!fs.existsSync(STORE_PATH)) {
|
package/package.json
CHANGED