@eunjae/dots 1.0.1 → 1.0.2
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/{apply.impl-XFYGPQDM.js → apply.impl-27DRVKZK.js} +1 -1
- package/dist/bin/bash-complete.js +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/chunk-DNQSYMNA.js +1 -0
- package/dist/chunk-GPHKPMNY.js +1 -0
- package/dist/chunk-QIS5QHQM.js +1 -0
- package/dist/config/index.js +1 -1
- package/dist/{init.impl-ETAGQHM4.js → init.impl-ITIVD5YC.js} +1 -1
- package/package.json +6 -2
- package/dist/chunk-AKU46QWV.js +0 -1
- package/dist/chunk-BDBR3STW.js +0 -1
- package/dist/chunk-S7YZCFUI.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p,b as d}from"./chunk-
|
|
1
|
+
import{a as p,b as d}from"./chunk-GPHKPMNY.js";import{exec as v}from"node:child_process";import{promisify as E}from"node:util";import{lstat as g,mkdir as R,readlink as h,rm as P,symlink as S}from"node:fs/promises";import{homedir as C}from"node:os";import{dirname as B,resolve as m}from"node:path";function w(t,e){return t.startsWith("~/")?m(C(),t.slice(2)):t.startsWith("./")||!t.startsWith("/")?m(e,t):t}async function y(t){try{return await g(t),!0}catch{return!1}}async function A(t){try{return(await g(t)).isSymbolicLink()}catch{return!1}}async function I(t,e,r){let n=w(t.src,e),s=w(t.dest,e);if(!await y(n))return{action:"skipped",src:n,dest:s,error:`Source does not exist: ${n}`};if(await y(s)){if(await A(s)&&await h(s)===n)return{action:"exists",src:n,dest:s};if(!t.force)return{action:"skipped",src:n,dest:s,error:"Destination exists and is not the correct symlink. Use force: true to overwrite."};r||await P(s,{recursive:!0})}return r||(await R(B(s),{recursive:!0}),await S(n,s)),{action:"created",src:n,dest:s}}async function u(t,e,r){let n=[];for(let s of t){let o=await I(s,e,r);n.push(o)}return n}var f=E(v);function D(t){return typeof t=="string"?{name:t}:t}async function H(){try{return await f("which brew"),!0}catch{return!1}}async function W(t,e){try{let r=e?`brew list --cask ${t}`:`brew list ${t}`;return await f(r),!0}catch{return!1}}async function F(t,e){let r=e?`brew install --cask ${t}`:`brew install ${t}`;await f(r)}async function L(t){return await H()?!0:t?(console.log("[dry-run] Would install Homebrew"),!1):(console.log("Installing Homebrew..."),await f('/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'),!0)}async function T(t,e,r){let n=D(t),{name:s,cask:o=!1,symlinks:i}=n;if(await W(s,o)){let l={action:"exists",name:s,cask:o};return i&&i.length>0&&(l.symlinkResults=await u(i,e,r)),l}if(!r)try{await F(s,o)}catch(l){return{action:"skipped",name:s,cask:o,error:`Failed to install: ${l instanceof Error?l.message:String(l)}`}}let a={action:"installed",name:s,cask:o};return i&&i.length>0&&(a.symlinkResults=await u(i,e,r)),a}async function k(t,e,r){if(!await L(r)&&!r)throw new Error("Homebrew is not installed and could not be installed");let s=[];for(let o of t){let i=await T(o,e,r);s.push(i)}return s}import{exec as z}from"node:child_process";import{lstat as G,mkdir as N}from"node:fs/promises";import{homedir as U}from"node:os";import{resolve as $}from"node:path";import{promisify as j}from"node:util";var b=j(z);function q(t){return t.startsWith("~/")?$(U(),t.slice(2)):t}async function J(t){try{return await G(t),!0}catch{return!1}}async function K(t){try{return await b(`git -C "${t}" rev-parse --git-dir`),!0}catch{return!1}}async function M(t,e){let r=q(t.dest),{url:n}=t;if(await J(r))return await K(r)?{action:"exists",url:n,dest:r}:{action:"skipped",url:n,dest:r,error:`Destination exists but is not a git repository: ${r}`};if(!e){let s=$(r,"..");await N(s,{recursive:!0});try{await b(`git clone "${n}" "${r}"`)}catch(o){return{action:"skipped",url:n,dest:r,error:`Failed to clone: ${o instanceof Error?o.message:String(o)}`}}}return{action:"cloned",url:n,dest:r}}async function x(t,e){let r=[];for(let n of t){let s=await M(n,e);r.push(s)}return r}async function ft(t){let{process:e}=this,r=t.dry,n=d();r?e.stdout.write(`
|
|
2
2
|
\u{1F50D} Dry run mode - no changes will be made
|
|
3
3
|
|
|
4
4
|
`):e.stdout.write(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as o,b as s}from"../chunk-
|
|
2
|
+
import{a as o,b as s}from"../chunk-QIS5QHQM.js";import"../chunk-DNQSYMNA.js";import{proposeCompletions as r}from"@stricli/core";var t=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&t.push("");await r(o,t,s(process));try{for(let{completion:p}of await r(o,t,s(process)))process.stdout.write(`${p}
|
|
3
3
|
`)}catch{}
|
package/dist/bin/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as r,b as o}from"../chunk-
|
|
2
|
+
import{a as r,b as o}from"../chunk-QIS5QHQM.js";import"../chunk-DNQSYMNA.js";import{run as i}from"@stricli/core";await i(r,process.argv.slice(2),o(process));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s="Declarative dotfiles and Mac setup manager";var i="1.0.2";export{s as a,i as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as r}from"node:fs";import{resolve as s}from"node:path";import{createJiti as e}from"jiti";var f=["dots.config.ts","dots.config.js"];async function a(t){let i=e(import.meta.url);for(let n of f){let o=s(t,n);if(!r(o))continue;return(await i.import(o)).default}return null}function p(){return process.cwd()}export{a,p as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as t}from"./chunk-DNQSYMNA.js";import{buildApplication as i,buildCommand as e,buildRouteMap as n}from"@stricli/core";var a=e({loader:async()=>import("./init.impl-ITIVD5YC.js"),parameters:{positional:{kind:"tuple",parameters:[{brief:"Git URL of the config repository (omit to create new project)",parse:String,placeholder:"repo-url",optional:!0}]},flags:{path:{kind:"parsed",brief:"Path for the dotfiles directory",parse:String,default:"~/.dots"}}},docs:{brief:"Initialize dots (clone existing repo or create new project)"}}),p=e({loader:async()=>import("./apply.impl-27DRVKZK.js"),parameters:{flags:{dry:{kind:"boolean",brief:"Show what would be done without making changes",default:!1}}},docs:{brief:"Apply the configuration from the current directory"}}),s=n({routes:{init:a,apply:p},docs:{brief:o}}),u=i(s,{name:"dots",versionInfo:{currentVersion:t}});import c from"node:fs";import l from"node:os";import m from"node:path";function y(r){return{process:r,os:l,fs:c,path:m}}export{u as a,y as b};
|
package/dist/config/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as n}from"../chunk-
|
|
1
|
+
import{a as o,b as n}from"../chunk-GPHKPMNY.js";function i(e){return e}export{i as defineConfig,n as findConfigDir,o as loadConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as l}from"./chunk-DNQSYMNA.js";import{exec as y}from"node:child_process";import{lstat as h,mkdir as p,readFile as f,writeFile as r}from"node:fs/promises";import{homedir as d}from"node:os";import{resolve as n}from"node:path";import{promisify as b}from"node:util";var c=e=>`{
|
|
2
2
|
"name": "dotfiles",
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "Declarative dotfiles and Mac setup manager",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.2",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"prepublishOnly": "npm run build",
|
|
30
30
|
"postinstall": "npx @stricli/auto-complete@latest install dots --bash __dots_bash_complete",
|
|
31
31
|
"prepare": "husky",
|
|
32
|
+
"test": "bun test",
|
|
33
|
+
"test:watch": "bun test --watch",
|
|
32
34
|
"lint": "biome check src",
|
|
33
35
|
"lint:fix": "biome check --write src",
|
|
34
36
|
"format": "biome format --write src"
|
|
@@ -55,10 +57,12 @@
|
|
|
55
57
|
},
|
|
56
58
|
"dependencies": {
|
|
57
59
|
"@stricli/auto-complete": "^1.2.5",
|
|
58
|
-
"@stricli/core": "^1.2.5"
|
|
60
|
+
"@stricli/core": "^1.2.5",
|
|
61
|
+
"jiti": "^2.6.1"
|
|
59
62
|
},
|
|
60
63
|
"devDependencies": {
|
|
61
64
|
"@biomejs/biome": "^2.3.13",
|
|
65
|
+
"@types/bun": "^1.3.8",
|
|
62
66
|
"@types/node": "22.x",
|
|
63
67
|
"husky": "^9.1.7",
|
|
64
68
|
"lint-staged": "^16.2.7",
|
package/dist/chunk-AKU46QWV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s="@eunjae/dots";var i="Declarative dotfiles and Mac setup manager";var n="1.0.1";export{s as a,i as b,n as c};
|
package/dist/chunk-BDBR3STW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{resolve as r}from"node:path";var i=["dots.config.ts","dots.config.js"];async function e(o){for(let t of i){let n=r(o,t);try{return(await import(n)).default}catch{}}return null}function c(){return process.cwd()}export{e as a,c as b};
|
package/dist/chunk-S7YZCFUI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o,b as t,c as e}from"./chunk-AKU46QWV.js";import{buildApplication as n,buildCommand as r,buildRouteMap as a}from"@stricli/core";var p=r({loader:async()=>import("./init.impl-ETAGQHM4.js"),parameters:{positional:{kind:"tuple",parameters:[{brief:"Git URL of the config repository (omit to create new project)",parse:String,placeholder:"repo-url",optional:!0}]},flags:{path:{kind:"parsed",brief:"Path for the dotfiles directory",parse:String,default:"~/.dots"}}},docs:{brief:"Initialize dots (clone existing repo or create new project)"}}),s=r({loader:async()=>import("./apply.impl-XFYGPQDM.js"),parameters:{flags:{dry:{kind:"boolean",brief:"Show what would be done without making changes",default:!1}}},docs:{brief:"Apply the configuration from the current directory"}}),c=a({routes:{init:p,apply:s},docs:{brief:t}}),C=n(c,{name:o,versionInfo:{currentVersion:e}});import l from"node:fs";import m from"node:os";import d from"node:path";function g(i){return{process:i,os:m,fs:l,path:d}}export{C as a,g as b};
|