@tinyrack/dotweave 0.42.19 → 0.42.22
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 +21 -6
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +3 -3
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/profile/add.d.ts +4 -0
- package/dist/cli/profile/add.d.ts.map +1 -0
- package/dist/cli/profile/add.js +29 -0
- package/dist/cli/profile/add.js.map +1 -0
- package/dist/cli/profile/index.d.ts.map +1 -1
- package/dist/cli/profile/index.js +5 -1
- package/dist/cli/profile/index.js.map +1 -1
- package/dist/cli/profile/list.d.ts.map +1 -1
- package/dist/cli/profile/list.js +4 -12
- package/dist/cli/profile/list.js.map +1 -1
- package/dist/cli/profile/remove.d.ts +4 -0
- package/dist/cli/profile/remove.d.ts.map +1 -0
- package/dist/cli/profile/remove.js +29 -0
- package/dist/cli/profile/remove.js.map +1 -0
- package/dist/cli/profile/use.js +1 -1
- package/dist/cli/profile/use.js.map +1 -1
- package/dist/cli/shared-flags.d.ts +1 -1
- package/dist/cli/shared-flags.d.ts.map +1 -1
- package/dist/cli/shared-flags.js +1 -1
- package/dist/cli/shared-flags.js.map +1 -1
- package/dist/cli/track.d.ts.map +1 -1
- package/dist/cli/track.js +6 -3
- package/dist/cli/track.js.map +1 -1
- package/dist/config/constants.d.ts +2 -2
- package/dist/config/constants.js +2 -2
- package/dist/config/constants.js.map +1 -1
- package/dist/config/identity-file.d.ts +1 -1
- package/dist/config/identity-file.d.ts.map +1 -1
- package/dist/config/identity-file.js +3 -3
- package/dist/config/identity-file.js.map +1 -1
- package/dist/config/migration.d.ts +6 -0
- package/dist/config/migration.d.ts.map +1 -1
- package/dist/config/migration.js +35 -13
- package/dist/config/migration.js.map +1 -1
- package/dist/config/runtime-env.d.ts +1 -0
- package/dist/config/runtime-env.d.ts.map +1 -1
- package/dist/config/runtime-env.js +16 -6
- package/dist/config/runtime-env.js.map +1 -1
- package/dist/config/sync-queries.d.ts.map +1 -1
- package/dist/config/sync-queries.js +4 -0
- package/dist/config/sync-queries.js.map +1 -1
- package/dist/config/sync-schema.d.ts +5 -2
- package/dist/config/sync-schema.d.ts.map +1 -1
- package/dist/config/sync-schema.js +89 -4
- package/dist/config/sync-schema.js.map +1 -1
- package/dist/config/xdg.d.ts +13 -0
- package/dist/config/xdg.d.ts.map +1 -1
- package/dist/config/xdg.js +22 -0
- package/dist/config/xdg.js.map +1 -1
- package/dist/lib/env.d.ts +4 -0
- package/dist/lib/env.d.ts.map +1 -1
- package/dist/lib/env.js +25 -0
- package/dist/lib/env.js.map +1 -1
- package/dist/lib/path.d.ts.map +1 -1
- package/dist/lib/path.js +8 -2
- package/dist/lib/path.js.map +1 -1
- package/dist/migrations/sync-v8.d.ts +3 -0
- package/dist/migrations/sync-v8.d.ts.map +1 -0
- package/dist/migrations/sync-v8.js +66 -0
- package/dist/migrations/sync-v8.js.map +1 -0
- package/dist/services/config-file.d.ts +2 -1
- package/dist/services/config-file.d.ts.map +1 -1
- package/dist/services/config-file.js +4 -2
- package/dist/services/config-file.js.map +1 -1
- package/dist/services/init.d.ts.map +1 -1
- package/dist/services/init.js +5 -5
- package/dist/services/init.js.map +1 -1
- package/dist/services/profile.d.ts +8 -0
- package/dist/services/profile.d.ts.map +1 -1
- package/dist/services/profile.js +97 -12
- package/dist/services/profile.js.map +1 -1
- package/dist/services/sync-context.d.ts.map +1 -1
- package/dist/services/sync-context.js +13 -4
- package/dist/services/sync-context.js.map +1 -1
- package/dist/services/track.d.ts.map +1 -1
- package/dist/services/track.js +22 -2
- package/dist/services/track.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,12 +27,31 @@ Most dotfiles tools start from the repository and ask you to shape your local sy
|
|
|
27
27
|
- **Platform-specific paths** across Windows, macOS, Linux, and WSL
|
|
28
28
|
- **Dry-run previews** for both push and pull directions
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
### Windows
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
winget install tinyrack.dotweave
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### macOS / Linux
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
brew install tinyrack-net/tap/dotweave
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### npm
|
|
45
|
+
|
|
46
|
+
Use npm on any platform, or as a cross-platform fallback.
|
|
31
47
|
|
|
32
48
|
```bash
|
|
33
|
-
# Install with npm on macOS, Linux, WSL, or as a cross-platform fallback
|
|
34
49
|
npm install -g @tinyrack/dotweave
|
|
50
|
+
```
|
|
35
51
|
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
```bash
|
|
36
55
|
# Initialize
|
|
37
56
|
dotweave init
|
|
38
57
|
|
|
@@ -45,10 +64,6 @@ dotweave track ~/.ssh/config --mode secret
|
|
|
45
64
|
dotweave push
|
|
46
65
|
```
|
|
47
66
|
|
|
48
|
-
On Windows, install dotweave from the Microsoft Store once the listing is live.
|
|
49
|
-
Portable Windows `.exe` files remain attached to GitHub Releases for manual
|
|
50
|
-
use.
|
|
51
|
-
|
|
52
67
|
## Documentation
|
|
53
68
|
|
|
54
69
|
For detailed guides, command reference, and troubleshooting, visit the **[Dotweave documentation site](https://dotweave.tinyrack.net/en/)**.
|
package/dist/cli/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAmCxD,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAmCxD,QAAA,MAAM,WAAW,qDAkGf,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
package/dist/cli/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildCommand } from "@stricli/core";
|
|
2
2
|
import { resolveDefaultIdentityFile } from "#app/config/identity-file.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveDotweaveHomeDirectoryFromEnv } from "#app/config/runtime-env.ts";
|
|
4
4
|
import { pathExists } from "#app/lib/filesystem.ts";
|
|
5
5
|
import { ask } from "#app/lib/prompt.ts";
|
|
6
6
|
import { createMissingRepositoryAgeKeyError, initializeSyncDirectory, } from "#app/services/init.ts";
|
|
@@ -23,12 +23,12 @@ const formatAgeSummary = (result) => {
|
|
|
23
23
|
const initCommand = buildCommand({
|
|
24
24
|
docs: {
|
|
25
25
|
brief: "Initialize the git-backed sync directory",
|
|
26
|
-
fullDescription: "Create or connect the local dotweave repository under your
|
|
26
|
+
fullDescription: "Create or connect the local dotweave repository under your dotweave app-data directory, then store the sync settings used by later pull and push operations. If you omit the repository argument, dotweave initializes a local git repository in the sync directory.",
|
|
27
27
|
},
|
|
28
28
|
async func(flags, repository) {
|
|
29
29
|
const logger = createCliLogger();
|
|
30
30
|
const requestedKey = flags.key?.trim();
|
|
31
|
-
const identityFile = resolveDefaultIdentityFile(
|
|
31
|
+
const identityFile = resolveDefaultIdentityFile(resolveDotweaveHomeDirectoryFromEnv());
|
|
32
32
|
const identityFileExists = await pathExists(identityFile);
|
|
33
33
|
const importingRepository = repository !== undefined && repository.trim() !== "";
|
|
34
34
|
const shouldPrompt = requestedKey === undefined &&
|
package/dist/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,
|
|
1
|
+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
+
import { buildCommand } from "@stricli/core";
|
|
2
|
+
import { addProfile } from "#app/services/profile.ts";
|
|
3
|
+
import { createCliLogger } from "#app/services/terminal/logger.ts";
|
|
4
|
+
const profileAddCommand = buildCommand({
|
|
5
|
+
docs: {
|
|
6
|
+
brief: "Add a sync profile",
|
|
7
|
+
fullDescription: "Register a non-default profile in manifest.jsonc so entries can be assigned to it and it can be selected with profile use.",
|
|
8
|
+
},
|
|
9
|
+
async func(_flags, profile) {
|
|
10
|
+
const logger = createCliLogger();
|
|
11
|
+
const result = await addProfile(profile);
|
|
12
|
+
logger.success(`Added profile ${result.profile}`);
|
|
13
|
+
},
|
|
14
|
+
parameters: {
|
|
15
|
+
flags: {},
|
|
16
|
+
positional: {
|
|
17
|
+
kind: "tuple",
|
|
18
|
+
parameters: [
|
|
19
|
+
{
|
|
20
|
+
brief: "Profile name to add",
|
|
21
|
+
parse: String,
|
|
22
|
+
placeholder: "profile",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export default profileAddCommand;
|
|
29
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/profile/add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,iBAAiB,GAAG,YAAY,CAAwC;IAC5E,IAAI,EAAE;QACJ,KAAK,EAAE,oBAAoB;QAC3B,eAAe,EACb,4HAA4H;KAC/H;IACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO;QACxB,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;QAEzC,MAAM,CAAC,OAAO,CAAC,iBAAiB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,UAAU,EAAE;QACV,KAAK,EAAE,EAAE;QACT,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,UAAU,EAAE;gBACV;oBACE,KAAK,EAAE,qBAAqB;oBAC5B,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,SAAS;iBACvB;aACF;SACF;KACF;CACF,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/profile/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/profile/index.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,YAAY,8EAYhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { buildRouteMap } from "@stricli/core";
|
|
2
|
+
import profileAddCommand from "#app/cli/profile/add.ts";
|
|
2
3
|
import profileListCommand from "#app/cli/profile/list.ts";
|
|
4
|
+
import profileRemoveCommand from "#app/cli/profile/remove.ts";
|
|
3
5
|
import profileUseCommand from "#app/cli/profile/use.ts";
|
|
4
6
|
const profileRoute = buildRouteMap({
|
|
5
7
|
docs: {
|
|
6
8
|
brief: "Manage active and assigned sync profiles",
|
|
7
|
-
fullDescription: "Inspect
|
|
9
|
+
fullDescription: "Inspect, add, remove, or select manifest-registered profiles.",
|
|
8
10
|
},
|
|
9
11
|
routes: {
|
|
12
|
+
add: profileAddCommand,
|
|
10
13
|
list: profileListCommand,
|
|
14
|
+
remove: profileRemoveCommand,
|
|
11
15
|
use: profileUseCommand,
|
|
12
16
|
},
|
|
13
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,MAAM,YAAY,GAAG,aAAa,CAAC;IACjC,IAAI,EAAE;QACJ,KAAK,EAAE,0CAA0C;QACjD,eAAe,EACb
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,oBAAoB,MAAM,4BAA4B,CAAC;AAC9D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,MAAM,YAAY,GAAG,aAAa,CAAC;IACjC,IAAI,EAAE;QACJ,KAAK,EAAE,0CAA0C;QACjD,eAAe,EACb,+DAA+D;KAClE;IACD,MAAM,EAAE;QACN,GAAG,EAAE,iBAAiB;QACtB,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,oBAAoB;QAC5B,GAAG,EAAE,iBAAiB;KACvB;CACF,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMxD,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/cli/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMxD,QAAA,MAAM,kBAAkB,qDA4BtB,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
package/dist/cli/profile/list.js
CHANGED
|
@@ -4,24 +4,16 @@ import { createCliLogger } from "#app/services/terminal/logger.ts";
|
|
|
4
4
|
const profileListCommand = buildCommand({
|
|
5
5
|
docs: {
|
|
6
6
|
brief: "Show configured and active sync profiles",
|
|
7
|
-
fullDescription: "List the
|
|
7
|
+
fullDescription: "List the implicit default profile and manifest-registered profiles, and show which profile is active through ~/.config/dotweave/settings.jsonc.",
|
|
8
8
|
},
|
|
9
9
|
async func() {
|
|
10
10
|
const logger = createCliLogger();
|
|
11
11
|
const result = await listProfiles();
|
|
12
12
|
logger.info("Profiles");
|
|
13
13
|
const profiles = [...result.availableProfiles];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
else {
|
|
18
|
-
logger.list(profiles.map((name) => name === result.activeProfile ? `${name} (active)` : name), { highlightLast: false });
|
|
19
|
-
}
|
|
20
|
-
if (result.assignments.length > 0) {
|
|
21
|
-
logger.log(` ${result.assignments.length} restricted entries`);
|
|
22
|
-
if (result.activeProfile === undefined) {
|
|
23
|
-
logger.warn("restricted entries are skipped until a profile is active");
|
|
24
|
-
}
|
|
14
|
+
logger.list(profiles.map((name) => name === result.activeProfile ? `${name} (active)` : name), { highlightLast: false });
|
|
15
|
+
if (result.activeProfileWarning !== undefined) {
|
|
16
|
+
logger.warn(result.activeProfileWarning);
|
|
25
17
|
}
|
|
26
18
|
},
|
|
27
19
|
parameters: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/cli/profile/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,kBAAkB,GAAG,YAAY,CAAkC;IACvE,IAAI,EAAE;QACJ,KAAK,EAAE,0CAA0C;QACjD,eAAe,EACb,iJAAiJ;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E,EAAE;KACV;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/cli/profile/remove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMxD,QAAA,MAAM,oBAAoB,qDA6BxB,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { buildCommand } from "@stricli/core";
|
|
2
|
+
import { removeProfile } from "#app/services/profile.ts";
|
|
3
|
+
import { createCliLogger } from "#app/services/terminal/logger.ts";
|
|
4
|
+
const profileRemoveCommand = buildCommand({
|
|
5
|
+
docs: {
|
|
6
|
+
brief: "Remove a sync profile",
|
|
7
|
+
fullDescription: "Unregister an unused non-default profile from manifest.jsonc. Reassign or clear tracked entry assignments before removing a referenced profile.",
|
|
8
|
+
},
|
|
9
|
+
async func(_flags, profile) {
|
|
10
|
+
const logger = createCliLogger();
|
|
11
|
+
const result = await removeProfile(profile);
|
|
12
|
+
logger.success(`Removed profile ${result.profile}`);
|
|
13
|
+
},
|
|
14
|
+
parameters: {
|
|
15
|
+
flags: {},
|
|
16
|
+
positional: {
|
|
17
|
+
kind: "tuple",
|
|
18
|
+
parameters: [
|
|
19
|
+
{
|
|
20
|
+
brief: "Profile name to remove",
|
|
21
|
+
parse: String,
|
|
22
|
+
placeholder: "profile",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export default profileRemoveCommand;
|
|
29
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/cli/profile/remove.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,oBAAoB,GAAG,YAAY,CAIvC;IACA,IAAI,EAAE;QACJ,KAAK,EAAE,uBAAuB;QAC9B,eAAe,EACb,iJAAiJ;KACpJ;IACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO;QACxB,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;QAE5C,MAAM,CAAC,OAAO,CAAC,mBAAmB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,UAAU,EAAE;QACV,KAAK,EAAE,EAAE;QACT,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,UAAU,EAAE;gBACV;oBACE,KAAK,EAAE,wBAAwB;oBAC/B,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,SAAS;iBACvB;aACF;SACF;KACF;CACF,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
package/dist/cli/profile/use.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createCliLogger } from "#app/services/terminal/logger.ts";
|
|
|
4
4
|
const profileUseCommand = buildCommand({
|
|
5
5
|
docs: {
|
|
6
6
|
brief: "Set or clear the active sync profile",
|
|
7
|
-
fullDescription: "Write ~/.config/dotweave/settings.jsonc so plain push, pull, status, and doctor commands use the selected profile
|
|
7
|
+
fullDescription: "Write ~/.config/dotweave/settings.jsonc so plain push, pull, status, and doctor commands use the selected registered profile by default. Omit the profile name to clear the active profile.",
|
|
8
8
|
},
|
|
9
9
|
async func(_flags, profile) {
|
|
10
10
|
const logger = createCliLogger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/cli/profile/use.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe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EAAE,OAAO;YACb,UAAU,EAAE;gBACV;oBACE,KAAK,EAAE,0CAA0C;oBACjD,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,SAAS;iBACvB;aACF;SACF;KACF;CACF,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type NoFlags = Record<never, never>;
|
|
2
2
|
export declare const profileFlag: {
|
|
3
|
-
readonly brief: "Use a
|
|
3
|
+
readonly brief: "Use a registered profile layer for this command (add non-default profiles with 'dotweave profile add')";
|
|
4
4
|
readonly kind: "parsed";
|
|
5
5
|
readonly optional: true;
|
|
6
6
|
readonly parse: StringConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-flags.d.ts","sourceRoot":"","sources":["../../src/cli/shared-flags.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE3C,eAAO,MAAM,WAAW;;;;;;
|
|
1
|
+
{"version":3,"file":"shared-flags.d.ts","sourceRoot":"","sources":["../../src/cli/shared-flags.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE3C,eAAO,MAAM,WAAW;;;;;;CAOd,CAAC"}
|
package/dist/cli/shared-flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-flags.js","sourceRoot":"","sources":["../../src/cli/shared-flags.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,
|
|
1
|
+
{"version":3,"file":"shared-flags.js","sourceRoot":"","sources":["../../src/cli/shared-flags.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EACH,wGAAwG;IAC1G,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,SAAS;CACd,CAAC"}
|
package/dist/cli/track.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../src/cli/track.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../src/cli/track.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAmBxD,QAAA,MAAM,YAAY,qDAmIhB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
package/dist/cli/track.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildCommand } from "@stricli/core";
|
|
2
2
|
import { AppConstants } from "#app/config/constants.ts";
|
|
3
3
|
import { DotweaveError } from "#app/lib/error.ts";
|
|
4
|
-
import { assignProfiles } from "#app/services/profile.ts";
|
|
4
|
+
import { assignProfiles, validateProfilesExist, } from "#app/services/profile.ts";
|
|
5
5
|
import { setTargetMode } from "#app/services/sync-mode.ts";
|
|
6
6
|
import { createCliLogger } from "#app/services/terminal/logger.ts";
|
|
7
7
|
import { proposePathCompletions } from "#app/services/terminal/path-completion.ts";
|
|
@@ -53,9 +53,12 @@ const trackCommand = buildCommand({
|
|
|
53
53
|
if (flags.repoPath === undefined &&
|
|
54
54
|
error instanceof DotweaveError &&
|
|
55
55
|
error.code === "TARGET_NOT_FOUND") {
|
|
56
|
+
const isProfileClear = profiles.length === 1 && profiles[0] === "";
|
|
57
|
+
if (profiles.length > 0 && !isProfileClear) {
|
|
58
|
+
await validateProfilesExist(profiles);
|
|
59
|
+
}
|
|
56
60
|
const setResult = await setTargetMode({ mode: flags.mode, target }, cwd);
|
|
57
61
|
if (profiles.length > 0) {
|
|
58
|
-
const isProfileClear = profiles.length === 1 && profiles[0] === "";
|
|
59
62
|
await assignProfiles({ profiles: isProfileClear ? [] : profiles, target }, cwd);
|
|
60
63
|
}
|
|
61
64
|
if (setResult.action === "unchanged") {
|
|
@@ -83,7 +86,7 @@ const trackCommand = buildCommand({
|
|
|
83
86
|
values: AppConstants.SYNC.MODES,
|
|
84
87
|
},
|
|
85
88
|
profile: {
|
|
86
|
-
brief: "Restrict syncing to
|
|
89
|
+
brief: "Restrict syncing to registered profiles (add non-default profiles with 'dotweave profile add')",
|
|
87
90
|
kind: "parsed",
|
|
88
91
|
optional: true,
|
|
89
92
|
parse: String,
|
package/dist/cli/track.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../src/cli/track.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../src/cli/track.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,cAAc,EACd,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQrD,MAAM,YAAY,GAAG,YAAY,CAA2C;IAC1E,IAAI,EAAE;QACJ,KAAK,EAAE,8CAA8C;QACrD,eAAe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,EAAE,CAAC;YACV,SAAS,EAAE;gBACT,KAAK,EACH,4IAA4I;gBAC9I,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE,QAAQ;gBACrB,kBAAkB,EAAE,sBAAsB;aAC3C;SACF;KACF;CACF,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -12,12 +12,12 @@ export declare const AppConstants: {
|
|
|
12
12
|
readonly FILE_NAME: "settings.jsonc";
|
|
13
13
|
};
|
|
14
14
|
readonly INIT: {
|
|
15
|
-
readonly
|
|
15
|
+
readonly DEFAULT_IDENTITY_FILE_NAME: "keys.txt";
|
|
16
16
|
readonly LEGACY_IDENTITY_FILE: "~/.config/dotweave/age/keys.txt";
|
|
17
17
|
};
|
|
18
18
|
readonly SYNC: {
|
|
19
19
|
readonly CONFIG_FILE_NAME: "manifest.jsonc";
|
|
20
|
-
readonly CONFIG_VERSION:
|
|
20
|
+
readonly CONFIG_VERSION: 8;
|
|
21
21
|
readonly DEFAULT_CONCURRENCY: 20;
|
|
22
22
|
readonly DEFAULT_PROFILE: "default";
|
|
23
23
|
readonly MODES: readonly ["normal", "secret", "ignore"];
|
package/dist/config/constants.js
CHANGED
|
@@ -14,12 +14,12 @@ export const AppConstants = {
|
|
|
14
14
|
FILE_NAME: "settings.jsonc",
|
|
15
15
|
},
|
|
16
16
|
INIT: {
|
|
17
|
-
|
|
17
|
+
DEFAULT_IDENTITY_FILE_NAME: "keys.txt",
|
|
18
18
|
LEGACY_IDENTITY_FILE: `~/.config/${APP_NAME}/age/keys.txt`,
|
|
19
19
|
},
|
|
20
20
|
SYNC: {
|
|
21
21
|
CONFIG_FILE_NAME: "manifest.jsonc",
|
|
22
|
-
CONFIG_VERSION:
|
|
22
|
+
CONFIG_VERSION: 8,
|
|
23
23
|
DEFAULT_CONCURRENCY: 20,
|
|
24
24
|
DEFAULT_PROFILE: "default",
|
|
25
25
|
MODES: ["normal", "secret", "ignore"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,gCAAgC,GAAG,YAAY,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE;QACH,IAAI,EAAE,QAAQ;KACf;IACD,YAAY,EAAE;QACZ,gBAAgB,EAAE,QAAQ;QAC1B,OAAO,EAAE,GAAG,QAAQ,IAAI,gCAAgC,EAAE;QAC1D,mBAAmB,EAAE,gCAAgC;KACtD;IACD,aAAa,EAAE;QACb,eAAe,EAAE,CAAC;QAClB,SAAS,EAAE,gBAAgB;KAC5B;IACD,IAAI,EAAE;QACJ,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,gCAAgC,GAAG,YAAY,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE;QACH,IAAI,EAAE,QAAQ;KACf;IACD,YAAY,EAAE;QACZ,gBAAgB,EAAE,QAAQ;QAC1B,OAAO,EAAE,GAAG,QAAQ,IAAI,gCAAgC,EAAE;QAC1D,mBAAmB,EAAE,gCAAgC;KACtD;IACD,aAAa,EAAE;QACb,eAAe,EAAE,CAAC;QAClB,SAAS,EAAE,gBAAgB;KAC5B;IACD,IAAI,EAAE;QACJ,0BAA0B,EAAE,UAAU;QACtC,oBAAoB,EAAE,aAAa,QAAQ,eAAe;KAC3D;IACD,IAAI,EAAE;QACJ,gBAAgB,EAAE,gBAAgB;QAClC,cAAc,EAAE,CAAC;QACjB,mBAAmB,EAAE,EAAE;QACvB,eAAe,EAAE,SAAS;QAC1B,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC;QACrC,sBAAsB,EAAE,kBAAkB;KAC3C;IACD,GAAG,EAAE;QACH,kBAAkB,EAAE,QAAQ;QAC5B,mBAAmB,EAAE,YAAY;KAClC;CACO,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const resolveDefaultIdentityFile: (
|
|
1
|
+
export declare const resolveDefaultIdentityFile: (dotweaveHomeDirectory: string) => string;
|
|
2
2
|
//# sourceMappingURL=identity-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-file.d.ts","sourceRoot":"","sources":["../../src/config/identity-file.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"identity-file.d.ts","sourceRoot":"","sources":["../../src/config/identity-file.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,0BAA0B,GAAI,uBAAuB,MAAM,WAKvE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
1
2
|
import { AppConstants } from "#app/config/constants.ts";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return resolveConfiguredAbsolutePath(AppConstants.INIT.DEFAULT_IDENTITY_FILE, home, xdgConfigHome);
|
|
3
|
+
export const resolveDefaultIdentityFile = (dotweaveHomeDirectory) => {
|
|
4
|
+
return resolve(dotweaveHomeDirectory, AppConstants.INIT.DEFAULT_IDENTITY_FILE_NAME);
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=identity-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-file.js","sourceRoot":"","sources":["../../src/config/identity-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"identity-file.js","sourceRoot":"","sources":["../../src/config/identity-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,qBAA6B,EAAE,EAAE;IAC1E,OAAO,OAAO,CACZ,qBAAqB,EACrB,YAAY,CAAC,IAAI,CAAC,0BAA0B,CAC7C,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export type ConfigMigrationFn = (config: Record<string, unknown>) => Record<string, unknown>;
|
|
2
2
|
export type ConfigMigrationRegistry = ReadonlyMap<number, ConfigMigrationFn>;
|
|
3
|
+
export type ConfigMigrationResult = Readonly<{
|
|
4
|
+
config: unknown;
|
|
5
|
+
migrated: boolean;
|
|
6
|
+
originalVersion?: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const applyConfigMigrations: (rawConfig: unknown, registry: ConfigMigrationRegistry, targetVersion: number, filePath: string) => ConfigMigrationResult;
|
|
3
9
|
/**
|
|
4
10
|
* Applies sequential config migrations from the detected version up to targetVersion.
|
|
5
11
|
* Creates a backup file before the first migration step, then saves the result.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/config/migration.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG,CAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7B,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,OAAO,EAClB,UAAU,uBAAuB,EACjC,eAAe,MAAM,EACrB,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/config/migration.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG,CAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7B,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE7E,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC,CAAC;AAkBH,eAAO,MAAM,qBAAqB,GAChC,WAAW,OAAO,EAClB,UAAU,uBAAuB,EACjC,eAAe,MAAM,EACrB,UAAU,MAAM,KACf,qBAsEF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,OAAO,EAClB,UAAU,uBAAuB,EACjC,eAAe,MAAM,EACrB,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CA4BjB,CAAC"}
|
package/dist/config/migration.js
CHANGED
|
@@ -3,25 +3,31 @@ import { basename, dirname, join } from "node:path";
|
|
|
3
3
|
import { DotweaveError } from "#app/lib/error.ts";
|
|
4
4
|
import { writeTextFileAtomically } from "#app/lib/filesystem.ts";
|
|
5
5
|
import { ensureTrailingNewline } from "#app/lib/string.ts";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const withMigrationContext = (error, filePath, fromVersion) => {
|
|
7
|
+
return new DotweaveError(error.message, {
|
|
8
|
+
code: error.code,
|
|
9
|
+
details: [
|
|
10
|
+
...error.details,
|
|
11
|
+
`Config file: ${filePath}`,
|
|
12
|
+
`Migration: ${fromVersion} → ${fromVersion + 1}`,
|
|
13
|
+
],
|
|
14
|
+
hint: error.hint,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export const applyConfigMigrations = (rawConfig, registry, targetVersion, filePath) => {
|
|
12
18
|
if (typeof rawConfig !== "object" ||
|
|
13
19
|
rawConfig === null ||
|
|
14
20
|
Array.isArray(rawConfig)) {
|
|
15
|
-
return rawConfig;
|
|
21
|
+
return { config: rawConfig, migrated: false };
|
|
16
22
|
}
|
|
17
23
|
const configObject = rawConfig;
|
|
18
24
|
// biome-ignore lint/complexity/useLiteralKeys: noPropertyAccessFromIndexSignature requires bracket notation
|
|
19
25
|
const version = configObject["version"];
|
|
20
26
|
if (typeof version !== "number") {
|
|
21
|
-
return rawConfig;
|
|
27
|
+
return { config: rawConfig, migrated: false };
|
|
22
28
|
}
|
|
23
29
|
if (version === targetVersion) {
|
|
24
|
-
return rawConfig;
|
|
30
|
+
return { config: rawConfig, migrated: false, originalVersion: version };
|
|
25
31
|
}
|
|
26
32
|
if (version > targetVersion) {
|
|
27
33
|
throw new DotweaveError(`Config file version ${version} is newer than this CLI supports (max: ${targetVersion}).`, {
|
|
@@ -30,8 +36,6 @@ export const runConfigMigrations = async (rawConfig, registry, targetVersion, fi
|
|
|
30
36
|
hint: "Upgrade dotweave to the latest version.",
|
|
31
37
|
});
|
|
32
38
|
}
|
|
33
|
-
const backupPath = join(dirname(filePath), `${basename(filePath)}.v${version}.bak`);
|
|
34
|
-
await writeFile(backupPath, ensureTrailingNewline(JSON.stringify(configObject, null, 2)), "utf8");
|
|
35
39
|
let current = configObject;
|
|
36
40
|
for (let v = version; v < targetVersion; v++) {
|
|
37
41
|
const migrateFn = registry.get(v);
|
|
@@ -46,16 +50,34 @@ export const runConfigMigrations = async (rawConfig, registry, targetVersion, fi
|
|
|
46
50
|
current = migrateFn(current);
|
|
47
51
|
}
|
|
48
52
|
catch (error) {
|
|
53
|
+
if (error instanceof DotweaveError) {
|
|
54
|
+
throw withMigrationContext(error, filePath, v);
|
|
55
|
+
}
|
|
49
56
|
throw new DotweaveError(`Failed to migrate config from version ${v} to ${v + 1}.`, {
|
|
50
57
|
code: "CONFIG_MIGRATION_FAILED",
|
|
51
58
|
details: [
|
|
52
59
|
`Config file: ${filePath}`,
|
|
60
|
+
`Migration: ${v} → ${v + 1}`,
|
|
53
61
|
...(error instanceof Error ? [error.message] : []),
|
|
54
62
|
],
|
|
55
63
|
});
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
return { config: current, migrated: true, originalVersion: version };
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Applies sequential config migrations from the detected version up to targetVersion.
|
|
70
|
+
* Creates a backup file before the first migration step, then saves the result.
|
|
71
|
+
* Returns the migrated config (or the original if no migration was needed).
|
|
72
|
+
*/
|
|
73
|
+
export const runConfigMigrations = async (rawConfig, registry, targetVersion, filePath) => {
|
|
74
|
+
const { config, migrated, originalVersion } = applyConfigMigrations(rawConfig, registry, targetVersion, filePath);
|
|
75
|
+
if (!migrated || originalVersion === undefined) {
|
|
76
|
+
return config;
|
|
77
|
+
}
|
|
78
|
+
const backupPath = join(dirname(filePath), `${basename(filePath)}.v${originalVersion}.bak`);
|
|
79
|
+
await writeFile(backupPath, ensureTrailingNewline(JSON.stringify(rawConfig, null, 2)), "utf8");
|
|
80
|
+
await writeTextFileAtomically(filePath, ensureTrailingNewline(JSON.stringify(config, null, 2)));
|
|
81
|
+
return config;
|
|
60
82
|
};
|
|
61
83
|
//# sourceMappingURL=migration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/config/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../src/config/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAA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K,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;iBACnD;aACF,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC;AACvE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,SAAkB,EAClB,QAAiC,EACjC,aAAqB,EACrB,QAAgB,EACE,EAAE;IACpB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,qBAAqB,CACjE,SAAS,EACT,QAAQ,EACR,aAAa,EACb,QAAQ,CACT,CAAC;IAEF,IAAI,CAAC,QAAQ,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CACrB,OAAO,CAAC,QAAQ,CAAC,EACjB,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,eAAe,MAAM,CAChD,CAAC;IACF,MAAM,SAAS,CACb,UAAU,EACV,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EACzD,MAAM,CACP,CAAC;IAEF,MAAM,uBAAuB,CAC3B,QAAQ,EACR,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CACvD,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const readEnvValue: (name: string) => string | undefined;
|
|
2
2
|
export declare const resolveHomeDirectoryFromEnv: () => string;
|
|
3
3
|
export declare const resolveXdgConfigHomeFromEnv: () => string;
|
|
4
|
+
export declare const resolveDotweaveHomeDirectoryFromEnv: () => string;
|
|
4
5
|
export declare const resolveDotweaveGlobalConfigFilePathFromEnv: () => string;
|
|
5
6
|
export declare const resolveDotweaveSyncDirectoryFromEnv: () => string;
|
|
6
7
|
export declare const resolveCurrentPlatformKey: () => import("#app/config/platform.ts").PlatformKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-env.d.ts","sourceRoot":"","sources":["../../src/config/runtime-env.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,uBAExC,CAAC;AAEF,eAAO,MAAM,2BAA2B,cAEvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,cAKvC,CAAC;AAEF,eAAO,MAAM,0CAA0C,
|
|
1
|
+
{"version":3,"file":"runtime-env.d.ts","sourceRoot":"","sources":["../../src/config/runtime-env.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,uBAExC,CAAC;AAEF,eAAO,MAAM,2BAA2B,cAEvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,cAKvC,CAAC;AAEF,eAAO,MAAM,mCAAmC,cAW/C,CAAC;AAEF,eAAO,MAAM,0CAA0C,cAItD,CAAC;AAEF,eAAO,MAAM,mCAAmC,cAE/C,CAAC;AAEF,eAAO,MAAM,yBAAyB,qDAOrC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { platform, release } from "node:os";
|
|
1
|
+
import { homedir, platform, release } from "node:os";
|
|
2
2
|
import { detectCurrentPlatformKey } from "#app/config/platform.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveDotweaveGlobalConfigFilePath, resolveDotweaveHomeDirectory, resolveDotweaveSyncDirectory, resolveHomeDirectory, resolveXdgConfigHome, } from "#app/config/xdg.ts";
|
|
4
4
|
import { ENV } from "#app/lib/env.ts";
|
|
5
5
|
import { normalizeConfiguredValue } from "#app/lib/string.ts";
|
|
6
6
|
export const readEnvValue = (name) => {
|
|
@@ -12,13 +12,23 @@ export const resolveHomeDirectoryFromEnv = () => {
|
|
|
12
12
|
export const resolveXdgConfigHomeFromEnv = () => {
|
|
13
13
|
return resolveXdgConfigHome(readEnvValue("HOME"), readEnvValue("XDG_CONFIG_HOME"));
|
|
14
14
|
};
|
|
15
|
+
export const resolveDotweaveHomeDirectoryFromEnv = () => {
|
|
16
|
+
return resolveDotweaveHomeDirectory({
|
|
17
|
+
appData: readEnvValue("APPDATA"),
|
|
18
|
+
dotweaveHome: readEnvValue("DOTWEAVE_HOME"),
|
|
19
|
+
home: readEnvValue("HOME"),
|
|
20
|
+
localAppData: readEnvValue("LOCALAPPDATA"),
|
|
21
|
+
osHomeDirectory: homedir(),
|
|
22
|
+
platform: platform(),
|
|
23
|
+
userProfile: readEnvValue("USERPROFILE"),
|
|
24
|
+
xdgConfigHome: readEnvValue("XDG_CONFIG_HOME"),
|
|
25
|
+
});
|
|
26
|
+
};
|
|
15
27
|
export const resolveDotweaveGlobalConfigFilePathFromEnv = () => {
|
|
16
|
-
|
|
17
|
-
return resolveDotweaveGlobalConfigFilePath(configDirectory);
|
|
28
|
+
return resolveDotweaveGlobalConfigFilePath(resolveDotweaveHomeDirectoryFromEnv());
|
|
18
29
|
};
|
|
19
30
|
export const resolveDotweaveSyncDirectoryFromEnv = () => {
|
|
20
|
-
|
|
21
|
-
return resolveDotweaveSyncDirectory(configDirectory);
|
|
31
|
+
return resolveDotweaveSyncDirectory(resolveDotweaveHomeDirectoryFromEnv());
|
|
22
32
|
};
|
|
23
33
|
export const resolveCurrentPlatformKey = () => {
|
|
24
34
|
return detectCurrentPlatformKey(platform(), release(), readEnvValue("WSL_DISTRO_NAME"), readEnvValue("WSL_INTEROP"));
|