centy 0.8.3 → 0.8.4
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/lib/init/init.d.ts.map +1 -1
- package/dist/lib/init/init.js +22 -24
- package/dist/lib/init/init.js.map +1 -1
- package/oclif.manifest.json +196 -196
- package/package.json +1 -1
- package/dist/lib/init/gather-decisions.d.ts +0 -14
- package/dist/lib/init/gather-decisions.d.ts.map +0 -1
- package/dist/lib/init/gather-decisions.js +0 -31
- package/dist/lib/init/gather-decisions.js.map +0 -1
- package/dist/lib/init/prompt-for-reset.d.ts +0 -15
- package/dist/lib/init/prompt-for-reset.d.ts.map +0 -1
- package/dist/lib/init/prompt-for-reset.js +0 -38
- package/dist/lib/init/prompt-for-reset.js.map +0 -1
- package/dist/lib/init/prompt-for-restore.d.ts +0 -14
- package/dist/lib/init/prompt-for-restore.d.ts.map +0 -1
- package/dist/lib/init/prompt-for-restore.js +0 -38
- package/dist/lib/init/prompt-for-restore.js.map +0 -1
- package/dist/lib/init/type-converters.d.ts +0 -13
- package/dist/lib/init/type-converters.d.ts.map +0 -1
- package/dist/lib/init/type-converters.js +0 -14
- package/dist/lib/init/type-converters.js.map +0 -1
- package/dist/utils/ask-yes-no-all-none.d.ts +0 -6
- package/dist/utils/ask-yes-no-all-none.d.ts.map +0 -1
- package/dist/utils/ask-yes-no-all-none.js +0 -23
- package/dist/utils/ask-yes-no-all-none.js.map +0 -1
- package/dist/utils/prompt-choice.d.ts +0 -2
- package/dist/utils/prompt-choice.d.ts.map +0 -1
- package/dist/utils/prompt-choice.js +0 -2
- package/dist/utils/prompt-choice.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/lib/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/lib/init/init.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAuB5D;;;GAGG;AACH,wBAAsB,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAgErE"}
|
package/dist/lib/init/init.js
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
|
-
import {
|
|
3
|
-
import { daemonGetReconciliationPlan } from '../../daemon/daemon-get-reconciliation-plan.js';
|
|
2
|
+
import { daemonInit } from '../../daemon/daemon-init.js';
|
|
4
3
|
import { isGitRepo } from '../../utils/is-git-repo.js';
|
|
5
|
-
import { gatherDecisions } from './gather-decisions.js';
|
|
6
4
|
import { outputSummary } from './output-summary.js';
|
|
7
|
-
import { fileInfoToResetFormat, fileInfoToRestoreFormat, } from './type-converters.js';
|
|
8
5
|
const CENTY_FOLDER = '.centy';
|
|
6
|
+
function buildInitConfig(opts) {
|
|
7
|
+
if (opts.priorityLevels === undefined && opts.version === undefined) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
customFields: [],
|
|
12
|
+
defaults: {},
|
|
13
|
+
priorityLevels: opts.priorityLevels !== undefined ? opts.priorityLevels : 0,
|
|
14
|
+
version: opts.version !== undefined ? opts.version : '',
|
|
15
|
+
stateColors: {},
|
|
16
|
+
priorityColors: {},
|
|
17
|
+
customLinkTypes: [],
|
|
18
|
+
defaultEditor: '',
|
|
19
|
+
userValues: {},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
9
22
|
/**
|
|
10
23
|
* Initialize a .centy folder
|
|
11
24
|
* Requires daemon to be running
|
|
@@ -32,24 +45,12 @@ export async function init(options) {
|
|
|
32
45
|
output.write('Warning: Initializing outside a git repository is not recommended.\n');
|
|
33
46
|
}
|
|
34
47
|
try {
|
|
35
|
-
// Get reconciliation plan from daemon
|
|
36
|
-
const plan = await daemonGetReconciliationPlan({ projectPath: cwd });
|
|
37
|
-
output.write('Connected to centy daemon\n');
|
|
38
|
-
// Convert daemon FileInfo to local format for prompts
|
|
39
|
-
const filesToRestore = plan.toRestore.map(fileInfoToRestoreFormat);
|
|
40
|
-
const filesToReset = plan.toReset.map(fileInfoToResetFormat);
|
|
41
|
-
// Gather user decisions locally (prompts stay in CLI)
|
|
42
|
-
const decisions = await gatherDecisions({ toRestore: filesToRestore, toReset: filesToReset }, opts, output);
|
|
43
|
-
// Convert decisions to daemon format
|
|
44
|
-
const daemonDecisions = {
|
|
45
|
-
restore: decisions.restore,
|
|
46
|
-
reset: decisions.reset,
|
|
47
|
-
};
|
|
48
|
-
// Execute reconciliation via daemon
|
|
49
48
|
output.write('Initializing .centy folder...\n');
|
|
50
|
-
const response = await
|
|
49
|
+
const response = await daemonInit({
|
|
51
50
|
projectPath: cwd,
|
|
52
|
-
|
|
51
|
+
force: opts.force === true,
|
|
52
|
+
title: '',
|
|
53
|
+
initConfig: buildInitConfig(opts),
|
|
53
54
|
});
|
|
54
55
|
if (!response.success) {
|
|
55
56
|
output.write(`Error: ${response.error}\n`);
|
|
@@ -59,19 +60,16 @@ export async function init(options) {
|
|
|
59
60
|
result.created = response.created;
|
|
60
61
|
result.restored = response.restored;
|
|
61
62
|
result.reset = response.reset;
|
|
62
|
-
result.skipped =
|
|
63
|
-
result.userFiles = plan.userFiles.map((f) => f.path);
|
|
63
|
+
result.skipped = response.skipped;
|
|
64
64
|
outputSummary(output, result);
|
|
65
65
|
return result;
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
68
68
|
const msg = error instanceof Error ? error.message : String(error);
|
|
69
|
-
// If daemon is unavailable, show error
|
|
70
69
|
if (msg.includes('UNAVAILABLE') || msg.includes('ECONNREFUSED')) {
|
|
71
70
|
output.write('Error: Centy daemon is not running. Please start the daemon first.\n');
|
|
72
71
|
return result;
|
|
73
72
|
}
|
|
74
|
-
// Other errors should be reported
|
|
75
73
|
output.write(`Error: ${msg}\n`);
|
|
76
74
|
return result;
|
|
77
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/lib/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/lib/init/init.ts"],"names":[],"mappings":"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"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1745,6 +1745,69 @@
|
|
|
1745
1745
|
"update.js"
|
|
1746
1746
|
]
|
|
1747
1747
|
},
|
|
1748
|
+
"delete:asset": {
|
|
1749
|
+
"aliases": [],
|
|
1750
|
+
"args": {
|
|
1751
|
+
"filename": {
|
|
1752
|
+
"description": "Asset filename",
|
|
1753
|
+
"name": "filename",
|
|
1754
|
+
"required": true
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
"description": "Delete an asset",
|
|
1758
|
+
"examples": [
|
|
1759
|
+
"<%= config.bin %> delete asset screenshot.png --issue 1",
|
|
1760
|
+
"<%= config.bin %> delete asset logo.svg --shared",
|
|
1761
|
+
"<%= config.bin %> delete asset old-image.png --issue 1 --force",
|
|
1762
|
+
"<%= config.bin %> delete asset screenshot.png --issue 1 --project centy-daemon"
|
|
1763
|
+
],
|
|
1764
|
+
"flags": {
|
|
1765
|
+
"issue": {
|
|
1766
|
+
"char": "i",
|
|
1767
|
+
"description": "Issue ID or display number",
|
|
1768
|
+
"name": "issue",
|
|
1769
|
+
"hasDynamicHelp": false,
|
|
1770
|
+
"multiple": false,
|
|
1771
|
+
"type": "option"
|
|
1772
|
+
},
|
|
1773
|
+
"shared": {
|
|
1774
|
+
"char": "s",
|
|
1775
|
+
"description": "Delete a shared asset",
|
|
1776
|
+
"name": "shared",
|
|
1777
|
+
"allowNo": false,
|
|
1778
|
+
"type": "boolean"
|
|
1779
|
+
},
|
|
1780
|
+
"force": {
|
|
1781
|
+
"char": "f",
|
|
1782
|
+
"description": "Skip confirmation prompt",
|
|
1783
|
+
"name": "force",
|
|
1784
|
+
"allowNo": false,
|
|
1785
|
+
"type": "boolean"
|
|
1786
|
+
},
|
|
1787
|
+
"project": {
|
|
1788
|
+
"description": "Project name or path (defaults to current directory)",
|
|
1789
|
+
"name": "project",
|
|
1790
|
+
"hasDynamicHelp": false,
|
|
1791
|
+
"multiple": false,
|
|
1792
|
+
"type": "option"
|
|
1793
|
+
}
|
|
1794
|
+
},
|
|
1795
|
+
"hasDynamicHelp": false,
|
|
1796
|
+
"hiddenAliases": [],
|
|
1797
|
+
"id": "delete:asset",
|
|
1798
|
+
"pluginAlias": "centy",
|
|
1799
|
+
"pluginName": "centy",
|
|
1800
|
+
"pluginType": "core",
|
|
1801
|
+
"strict": true,
|
|
1802
|
+
"enableJsonFlag": false,
|
|
1803
|
+
"isESM": true,
|
|
1804
|
+
"relativePath": [
|
|
1805
|
+
"dist",
|
|
1806
|
+
"commands",
|
|
1807
|
+
"delete",
|
|
1808
|
+
"asset.js"
|
|
1809
|
+
]
|
|
1810
|
+
},
|
|
1748
1811
|
"daemon:autostart": {
|
|
1749
1812
|
"aliases": [],
|
|
1750
1813
|
"args": {},
|
|
@@ -1822,8 +1885,10 @@
|
|
|
1822
1885
|
"status.js"
|
|
1823
1886
|
]
|
|
1824
1887
|
},
|
|
1825
|
-
"
|
|
1826
|
-
"aliases": [
|
|
1888
|
+
"get:asset": {
|
|
1889
|
+
"aliases": [
|
|
1890
|
+
"show:asset"
|
|
1891
|
+
],
|
|
1827
1892
|
"args": {
|
|
1828
1893
|
"filename": {
|
|
1829
1894
|
"description": "Asset filename",
|
|
@@ -1831,12 +1896,11 @@
|
|
|
1831
1896
|
"required": true
|
|
1832
1897
|
}
|
|
1833
1898
|
},
|
|
1834
|
-
"description": "
|
|
1899
|
+
"description": "Get an asset and save it to a file",
|
|
1835
1900
|
"examples": [
|
|
1836
|
-
"<%= config.bin %>
|
|
1837
|
-
"<%= config.bin %>
|
|
1838
|
-
"<%= config.bin %>
|
|
1839
|
-
"<%= config.bin %> delete asset screenshot.png --issue 1 --project centy-daemon"
|
|
1901
|
+
"<%= config.bin %> get asset screenshot.png --issue 1 --output ./screenshot.png",
|
|
1902
|
+
"<%= config.bin %> get asset logo.svg --shared --output ./logo.svg",
|
|
1903
|
+
"<%= config.bin %> get asset screenshot.png --issue 1 --project centy-daemon"
|
|
1840
1904
|
],
|
|
1841
1905
|
"flags": {
|
|
1842
1906
|
"issue": {
|
|
@@ -1849,17 +1913,18 @@
|
|
|
1849
1913
|
},
|
|
1850
1914
|
"shared": {
|
|
1851
1915
|
"char": "s",
|
|
1852
|
-
"description": "
|
|
1916
|
+
"description": "Get a shared asset",
|
|
1853
1917
|
"name": "shared",
|
|
1854
1918
|
"allowNo": false,
|
|
1855
1919
|
"type": "boolean"
|
|
1856
1920
|
},
|
|
1857
|
-
"
|
|
1858
|
-
"char": "
|
|
1859
|
-
"description": "
|
|
1860
|
-
"name": "
|
|
1861
|
-
"
|
|
1862
|
-
"
|
|
1921
|
+
"output": {
|
|
1922
|
+
"char": "o",
|
|
1923
|
+
"description": "Output file path (defaults to asset filename)",
|
|
1924
|
+
"name": "output",
|
|
1925
|
+
"hasDynamicHelp": false,
|
|
1926
|
+
"multiple": false,
|
|
1927
|
+
"type": "option"
|
|
1863
1928
|
},
|
|
1864
1929
|
"project": {
|
|
1865
1930
|
"description": "Project name or path (defaults to current directory)",
|
|
@@ -1871,7 +1936,7 @@
|
|
|
1871
1936
|
},
|
|
1872
1937
|
"hasDynamicHelp": false,
|
|
1873
1938
|
"hiddenAliases": [],
|
|
1874
|
-
"id": "
|
|
1939
|
+
"id": "get:asset",
|
|
1875
1940
|
"pluginAlias": "centy",
|
|
1876
1941
|
"pluginName": "centy",
|
|
1877
1942
|
"pluginType": "core",
|
|
@@ -1881,47 +1946,117 @@
|
|
|
1881
1946
|
"relativePath": [
|
|
1882
1947
|
"dist",
|
|
1883
1948
|
"commands",
|
|
1884
|
-
"
|
|
1949
|
+
"get",
|
|
1885
1950
|
"asset.js"
|
|
1886
1951
|
]
|
|
1887
1952
|
},
|
|
1888
|
-
"get:
|
|
1953
|
+
"get:project": {
|
|
1889
1954
|
"aliases": [
|
|
1890
|
-
"show:
|
|
1955
|
+
"show:project"
|
|
1891
1956
|
],
|
|
1892
1957
|
"args": {
|
|
1893
|
-
"
|
|
1894
|
-
"description": "
|
|
1895
|
-
"name": "
|
|
1896
|
-
"required":
|
|
1958
|
+
"path": {
|
|
1959
|
+
"description": "Path to the project (defaults to current directory)",
|
|
1960
|
+
"name": "path",
|
|
1961
|
+
"required": false
|
|
1897
1962
|
}
|
|
1898
1963
|
},
|
|
1899
|
-
"description": "Get
|
|
1964
|
+
"description": "Get info about a specific project",
|
|
1900
1965
|
"examples": [
|
|
1901
|
-
"<%= config.bin %> get
|
|
1902
|
-
"<%= config.bin %> get
|
|
1903
|
-
"<%= config.bin %> get
|
|
1966
|
+
"<%= config.bin %> get project",
|
|
1967
|
+
"<%= config.bin %> get project /path/to/project",
|
|
1968
|
+
"<%= config.bin %> get project --json"
|
|
1904
1969
|
],
|
|
1905
1970
|
"flags": {
|
|
1906
|
-
"
|
|
1907
|
-
"
|
|
1908
|
-
"
|
|
1909
|
-
"
|
|
1971
|
+
"json": {
|
|
1972
|
+
"description": "Output as JSON",
|
|
1973
|
+
"name": "json",
|
|
1974
|
+
"allowNo": false,
|
|
1975
|
+
"type": "boolean"
|
|
1976
|
+
}
|
|
1977
|
+
},
|
|
1978
|
+
"hasDynamicHelp": false,
|
|
1979
|
+
"hiddenAliases": [],
|
|
1980
|
+
"id": "get:project",
|
|
1981
|
+
"pluginAlias": "centy",
|
|
1982
|
+
"pluginName": "centy",
|
|
1983
|
+
"pluginType": "core",
|
|
1984
|
+
"strict": true,
|
|
1985
|
+
"enableJsonFlag": false,
|
|
1986
|
+
"isESM": true,
|
|
1987
|
+
"relativePath": [
|
|
1988
|
+
"dist",
|
|
1989
|
+
"commands",
|
|
1990
|
+
"get",
|
|
1991
|
+
"project.js"
|
|
1992
|
+
]
|
|
1993
|
+
},
|
|
1994
|
+
"item-type:create": {
|
|
1995
|
+
"aliases": [],
|
|
1996
|
+
"args": {},
|
|
1997
|
+
"description": "Create a new custom item type",
|
|
1998
|
+
"examples": [
|
|
1999
|
+
"<%= config.bin %> item-type create --name \"Bug\" --plural \"bugs\" --identifier uuid --statuses open,in-progress,closed --default-status open --priority-levels 3 --features display-number,status,priority,move,duplicate",
|
|
2000
|
+
"<%= config.bin %> item-type create --name \"Task\" --plural \"tasks\" --identifier slug --statuses todo,doing,done --default-status todo --features status,priority"
|
|
2001
|
+
],
|
|
2002
|
+
"flags": {
|
|
2003
|
+
"name": {
|
|
2004
|
+
"char": "n",
|
|
2005
|
+
"description": "Singular display name (e.g., \"Bug\", \"Task\", \"Epic\")",
|
|
2006
|
+
"name": "name",
|
|
2007
|
+
"required": true,
|
|
1910
2008
|
"hasDynamicHelp": false,
|
|
1911
2009
|
"multiple": false,
|
|
1912
2010
|
"type": "option"
|
|
1913
2011
|
},
|
|
1914
|
-
"
|
|
1915
|
-
"
|
|
1916
|
-
"
|
|
1917
|
-
"
|
|
1918
|
-
"
|
|
1919
|
-
"
|
|
2012
|
+
"plural": {
|
|
2013
|
+
"description": "Folder/type key, lowercase alphanumeric + hyphens (e.g., \"bugs\")",
|
|
2014
|
+
"name": "plural",
|
|
2015
|
+
"required": true,
|
|
2016
|
+
"hasDynamicHelp": false,
|
|
2017
|
+
"multiple": false,
|
|
2018
|
+
"type": "option"
|
|
1920
2019
|
},
|
|
1921
|
-
"
|
|
1922
|
-
"
|
|
1923
|
-
"
|
|
1924
|
-
"
|
|
2020
|
+
"identifier": {
|
|
2021
|
+
"description": "Identifier type for items",
|
|
2022
|
+
"name": "identifier",
|
|
2023
|
+
"required": true,
|
|
2024
|
+
"hasDynamicHelp": false,
|
|
2025
|
+
"multiple": false,
|
|
2026
|
+
"options": [
|
|
2027
|
+
"uuid",
|
|
2028
|
+
"slug"
|
|
2029
|
+
],
|
|
2030
|
+
"type": "option"
|
|
2031
|
+
},
|
|
2032
|
+
"statuses": {
|
|
2033
|
+
"description": "Comma-separated list of allowed statuses",
|
|
2034
|
+
"name": "statuses",
|
|
2035
|
+
"required": true,
|
|
2036
|
+
"hasDynamicHelp": false,
|
|
2037
|
+
"multiple": false,
|
|
2038
|
+
"type": "option"
|
|
2039
|
+
},
|
|
2040
|
+
"default-status": {
|
|
2041
|
+
"description": "Default status for new items (must be in statuses list)",
|
|
2042
|
+
"name": "default-status",
|
|
2043
|
+
"required": true,
|
|
2044
|
+
"hasDynamicHelp": false,
|
|
2045
|
+
"multiple": false,
|
|
2046
|
+
"type": "option"
|
|
2047
|
+
},
|
|
2048
|
+
"priority-levels": {
|
|
2049
|
+
"description": "Number of priority levels (0 = none)",
|
|
2050
|
+
"name": "priority-levels",
|
|
2051
|
+
"default": 0,
|
|
2052
|
+
"hasDynamicHelp": false,
|
|
2053
|
+
"multiple": false,
|
|
2054
|
+
"type": "option"
|
|
2055
|
+
},
|
|
2056
|
+
"features": {
|
|
2057
|
+
"char": "f",
|
|
2058
|
+
"description": "Comma-separated features (display-number, status, priority, assets, org-sync, move, duplicate, soft-delete)",
|
|
2059
|
+
"name": "features",
|
|
1925
2060
|
"hasDynamicHelp": false,
|
|
1926
2061
|
"multiple": false,
|
|
1927
2062
|
"type": "option"
|
|
@@ -1936,7 +2071,7 @@
|
|
|
1936
2071
|
},
|
|
1937
2072
|
"hasDynamicHelp": false,
|
|
1938
2073
|
"hiddenAliases": [],
|
|
1939
|
-
"id": "
|
|
2074
|
+
"id": "item-type:create",
|
|
1940
2075
|
"pluginAlias": "centy",
|
|
1941
2076
|
"pluginName": "centy",
|
|
1942
2077
|
"pluginType": "core",
|
|
@@ -1946,26 +2081,18 @@
|
|
|
1946
2081
|
"relativePath": [
|
|
1947
2082
|
"dist",
|
|
1948
2083
|
"commands",
|
|
1949
|
-
"
|
|
1950
|
-
"
|
|
2084
|
+
"item-type",
|
|
2085
|
+
"create.js"
|
|
1951
2086
|
]
|
|
1952
2087
|
},
|
|
1953
|
-
"
|
|
1954
|
-
"aliases": [
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
"args": {
|
|
1958
|
-
"path": {
|
|
1959
|
-
"description": "Path to the project (defaults to current directory)",
|
|
1960
|
-
"name": "path",
|
|
1961
|
-
"required": false
|
|
1962
|
-
}
|
|
1963
|
-
},
|
|
1964
|
-
"description": "Get info about a specific project",
|
|
2088
|
+
"item-type:list": {
|
|
2089
|
+
"aliases": [],
|
|
2090
|
+
"args": {},
|
|
2091
|
+
"description": "List all item types for a project",
|
|
1965
2092
|
"examples": [
|
|
1966
|
-
"<%= config.bin %>
|
|
1967
|
-
"<%= config.bin %>
|
|
1968
|
-
"<%= config.bin %>
|
|
2093
|
+
"<%= config.bin %> item-type list",
|
|
2094
|
+
"<%= config.bin %> item-type list --json",
|
|
2095
|
+
"<%= config.bin %> item-type list --project centy-daemon"
|
|
1969
2096
|
],
|
|
1970
2097
|
"flags": {
|
|
1971
2098
|
"json": {
|
|
@@ -1973,11 +2100,18 @@
|
|
|
1973
2100
|
"name": "json",
|
|
1974
2101
|
"allowNo": false,
|
|
1975
2102
|
"type": "boolean"
|
|
2103
|
+
},
|
|
2104
|
+
"project": {
|
|
2105
|
+
"description": "Project name or path (defaults to current directory)",
|
|
2106
|
+
"name": "project",
|
|
2107
|
+
"hasDynamicHelp": false,
|
|
2108
|
+
"multiple": false,
|
|
2109
|
+
"type": "option"
|
|
1976
2110
|
}
|
|
1977
2111
|
},
|
|
1978
2112
|
"hasDynamicHelp": false,
|
|
1979
2113
|
"hiddenAliases": [],
|
|
1980
|
-
"id": "
|
|
2114
|
+
"id": "item-type:list",
|
|
1981
2115
|
"pluginAlias": "centy",
|
|
1982
2116
|
"pluginName": "centy",
|
|
1983
2117
|
"pluginType": "core",
|
|
@@ -1987,8 +2121,8 @@
|
|
|
1987
2121
|
"relativePath": [
|
|
1988
2122
|
"dist",
|
|
1989
2123
|
"commands",
|
|
1990
|
-
"
|
|
1991
|
-
"
|
|
2124
|
+
"item-type",
|
|
2125
|
+
"list.js"
|
|
1992
2126
|
]
|
|
1993
2127
|
},
|
|
1994
2128
|
"list:assets": {
|
|
@@ -2251,140 +2385,6 @@
|
|
|
2251
2385
|
"projects.js"
|
|
2252
2386
|
]
|
|
2253
2387
|
},
|
|
2254
|
-
"item-type:create": {
|
|
2255
|
-
"aliases": [],
|
|
2256
|
-
"args": {},
|
|
2257
|
-
"description": "Create a new custom item type",
|
|
2258
|
-
"examples": [
|
|
2259
|
-
"<%= config.bin %> item-type create --name \"Bug\" --plural \"bugs\" --identifier uuid --statuses open,in-progress,closed --default-status open --priority-levels 3 --features display-number,status,priority,move,duplicate",
|
|
2260
|
-
"<%= config.bin %> item-type create --name \"Task\" --plural \"tasks\" --identifier slug --statuses todo,doing,done --default-status todo --features status,priority"
|
|
2261
|
-
],
|
|
2262
|
-
"flags": {
|
|
2263
|
-
"name": {
|
|
2264
|
-
"char": "n",
|
|
2265
|
-
"description": "Singular display name (e.g., \"Bug\", \"Task\", \"Epic\")",
|
|
2266
|
-
"name": "name",
|
|
2267
|
-
"required": true,
|
|
2268
|
-
"hasDynamicHelp": false,
|
|
2269
|
-
"multiple": false,
|
|
2270
|
-
"type": "option"
|
|
2271
|
-
},
|
|
2272
|
-
"plural": {
|
|
2273
|
-
"description": "Folder/type key, lowercase alphanumeric + hyphens (e.g., \"bugs\")",
|
|
2274
|
-
"name": "plural",
|
|
2275
|
-
"required": true,
|
|
2276
|
-
"hasDynamicHelp": false,
|
|
2277
|
-
"multiple": false,
|
|
2278
|
-
"type": "option"
|
|
2279
|
-
},
|
|
2280
|
-
"identifier": {
|
|
2281
|
-
"description": "Identifier type for items",
|
|
2282
|
-
"name": "identifier",
|
|
2283
|
-
"required": true,
|
|
2284
|
-
"hasDynamicHelp": false,
|
|
2285
|
-
"multiple": false,
|
|
2286
|
-
"options": [
|
|
2287
|
-
"uuid",
|
|
2288
|
-
"slug"
|
|
2289
|
-
],
|
|
2290
|
-
"type": "option"
|
|
2291
|
-
},
|
|
2292
|
-
"statuses": {
|
|
2293
|
-
"description": "Comma-separated list of allowed statuses",
|
|
2294
|
-
"name": "statuses",
|
|
2295
|
-
"required": true,
|
|
2296
|
-
"hasDynamicHelp": false,
|
|
2297
|
-
"multiple": false,
|
|
2298
|
-
"type": "option"
|
|
2299
|
-
},
|
|
2300
|
-
"default-status": {
|
|
2301
|
-
"description": "Default status for new items (must be in statuses list)",
|
|
2302
|
-
"name": "default-status",
|
|
2303
|
-
"required": true,
|
|
2304
|
-
"hasDynamicHelp": false,
|
|
2305
|
-
"multiple": false,
|
|
2306
|
-
"type": "option"
|
|
2307
|
-
},
|
|
2308
|
-
"priority-levels": {
|
|
2309
|
-
"description": "Number of priority levels (0 = none)",
|
|
2310
|
-
"name": "priority-levels",
|
|
2311
|
-
"default": 0,
|
|
2312
|
-
"hasDynamicHelp": false,
|
|
2313
|
-
"multiple": false,
|
|
2314
|
-
"type": "option"
|
|
2315
|
-
},
|
|
2316
|
-
"features": {
|
|
2317
|
-
"char": "f",
|
|
2318
|
-
"description": "Comma-separated features (display-number, status, priority, assets, org-sync, move, duplicate, soft-delete)",
|
|
2319
|
-
"name": "features",
|
|
2320
|
-
"hasDynamicHelp": false,
|
|
2321
|
-
"multiple": false,
|
|
2322
|
-
"type": "option"
|
|
2323
|
-
},
|
|
2324
|
-
"project": {
|
|
2325
|
-
"description": "Project name or path (defaults to current directory)",
|
|
2326
|
-
"name": "project",
|
|
2327
|
-
"hasDynamicHelp": false,
|
|
2328
|
-
"multiple": false,
|
|
2329
|
-
"type": "option"
|
|
2330
|
-
}
|
|
2331
|
-
},
|
|
2332
|
-
"hasDynamicHelp": false,
|
|
2333
|
-
"hiddenAliases": [],
|
|
2334
|
-
"id": "item-type:create",
|
|
2335
|
-
"pluginAlias": "centy",
|
|
2336
|
-
"pluginName": "centy",
|
|
2337
|
-
"pluginType": "core",
|
|
2338
|
-
"strict": true,
|
|
2339
|
-
"enableJsonFlag": false,
|
|
2340
|
-
"isESM": true,
|
|
2341
|
-
"relativePath": [
|
|
2342
|
-
"dist",
|
|
2343
|
-
"commands",
|
|
2344
|
-
"item-type",
|
|
2345
|
-
"create.js"
|
|
2346
|
-
]
|
|
2347
|
-
},
|
|
2348
|
-
"item-type:list": {
|
|
2349
|
-
"aliases": [],
|
|
2350
|
-
"args": {},
|
|
2351
|
-
"description": "List all item types for a project",
|
|
2352
|
-
"examples": [
|
|
2353
|
-
"<%= config.bin %> item-type list",
|
|
2354
|
-
"<%= config.bin %> item-type list --json",
|
|
2355
|
-
"<%= config.bin %> item-type list --project centy-daemon"
|
|
2356
|
-
],
|
|
2357
|
-
"flags": {
|
|
2358
|
-
"json": {
|
|
2359
|
-
"description": "Output as JSON",
|
|
2360
|
-
"name": "json",
|
|
2361
|
-
"allowNo": false,
|
|
2362
|
-
"type": "boolean"
|
|
2363
|
-
},
|
|
2364
|
-
"project": {
|
|
2365
|
-
"description": "Project name or path (defaults to current directory)",
|
|
2366
|
-
"name": "project",
|
|
2367
|
-
"hasDynamicHelp": false,
|
|
2368
|
-
"multiple": false,
|
|
2369
|
-
"type": "option"
|
|
2370
|
-
}
|
|
2371
|
-
},
|
|
2372
|
-
"hasDynamicHelp": false,
|
|
2373
|
-
"hiddenAliases": [],
|
|
2374
|
-
"id": "item-type:list",
|
|
2375
|
-
"pluginAlias": "centy",
|
|
2376
|
-
"pluginName": "centy",
|
|
2377
|
-
"pluginType": "core",
|
|
2378
|
-
"strict": true,
|
|
2379
|
-
"enableJsonFlag": false,
|
|
2380
|
-
"isESM": true,
|
|
2381
|
-
"relativePath": [
|
|
2382
|
-
"dist",
|
|
2383
|
-
"commands",
|
|
2384
|
-
"item-type",
|
|
2385
|
-
"list.js"
|
|
2386
|
-
]
|
|
2387
|
-
},
|
|
2388
2388
|
"org:create": {
|
|
2389
2389
|
"aliases": [],
|
|
2390
2390
|
"args": {
|
|
@@ -3489,5 +3489,5 @@
|
|
|
3489
3489
|
]
|
|
3490
3490
|
}
|
|
3491
3491
|
},
|
|
3492
|
-
"version": "0.8.
|
|
3492
|
+
"version": "0.8.4"
|
|
3493
3493
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { InitOptions } from '../../types/init-options.js';
|
|
2
|
-
import type { FileToRestore, FileToReset } from './type-converters.js';
|
|
3
|
-
interface Plan {
|
|
4
|
-
toRestore: FileToRestore[];
|
|
5
|
-
toReset: FileToReset[];
|
|
6
|
-
}
|
|
7
|
-
export interface Decisions {
|
|
8
|
-
restore: string[];
|
|
9
|
-
reset: string[];
|
|
10
|
-
skip: string[];
|
|
11
|
-
}
|
|
12
|
-
export declare function gatherDecisions(plan: Plan, opts: InitOptions, output: NodeJS.WritableStream): Promise<Decisions>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=gather-decisions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gather-decisions.d.ts","sourceRoot":"","sources":["../../../src/lib/init/gather-decisions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEtE,UAAU,IAAI;IACZ,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,OAAO,EAAE,WAAW,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,MAAM,CAAC,cAAc,GAC5B,OAAO,CAAC,SAAS,CAAC,CA4BpB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { promptForReset } from './prompt-for-reset.js';
|
|
2
|
-
import { promptForRestore } from './prompt-for-restore.js';
|
|
3
|
-
export async function gatherDecisions(plan, opts, output) {
|
|
4
|
-
const decisions = {
|
|
5
|
-
restore: [],
|
|
6
|
-
reset: [],
|
|
7
|
-
skip: [],
|
|
8
|
-
};
|
|
9
|
-
if (plan.toRestore.length > 0) {
|
|
10
|
-
if (opts.force === true) {
|
|
11
|
-
decisions.restore = plan.toRestore.map(f => f.path);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
const restoreResult = await promptForRestore(output, plan.toRestore);
|
|
15
|
-
decisions.restore = restoreResult.restore;
|
|
16
|
-
decisions.skip.push(...restoreResult.skip);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (plan.toReset.length > 0) {
|
|
20
|
-
if (opts.force === true) {
|
|
21
|
-
decisions.skip.push(...plan.toReset.map(f => f.path));
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const resetResult = await promptForReset(output, plan.toReset);
|
|
25
|
-
decisions.reset = resetResult.reset;
|
|
26
|
-
decisions.skip.push(...resetResult.skip);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return decisions;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=gather-decisions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gather-decisions.js","sourceRoot":"","sources":["../../../src/lib/init/gather-decisions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAc1D,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAU,EACV,IAAiB,EACjB,MAA6B;IAE7B,MAAM,SAAS,GAAc;QAC3B,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;KACT,CAAA;IAED,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACrD,CAAC;aAAM,CAAC;YACN,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;YACpE,SAAS,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAA;YACzC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QACvD,CAAC;aAAM,CAAC;YACN,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YAC9D,SAAS,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAA;YACnC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface FileToReset {
|
|
2
|
-
path: string;
|
|
3
|
-
currentHash: string;
|
|
4
|
-
originalHash: string;
|
|
5
|
-
}
|
|
6
|
-
interface ResetDecision {
|
|
7
|
-
reset: string[];
|
|
8
|
-
skip: string[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Prompt user for reset decisions on modified files
|
|
12
|
-
*/
|
|
13
|
-
export declare function promptForReset(output: NodeJS.WritableStream, files: FileToReset[]): Promise<ResetDecision>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=prompt-for-reset.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-for-reset.d.ts","sourceRoot":"","sources":["../../../src/lib/init/prompt-for-reset.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,CAAC,cAAc,EAC7B,KAAK,EAAE,WAAW,EAAE,GACnB,OAAO,CAAC,aAAa,CAAC,CAiCxB"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { askYesNoAllNone } from '../../utils/ask-yes-no-all-none.js';
|
|
2
|
-
/**
|
|
3
|
-
* Prompt user for reset decisions on modified files
|
|
4
|
-
*/
|
|
5
|
-
export async function promptForReset(output, files) {
|
|
6
|
-
const reset = [];
|
|
7
|
-
const skip = [];
|
|
8
|
-
let resetAll = false;
|
|
9
|
-
let skipAll = false;
|
|
10
|
-
for (const file of files) {
|
|
11
|
-
if (skipAll) {
|
|
12
|
-
skip.push(file.path);
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
if (resetAll) {
|
|
16
|
-
reset.push(file.path);
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
output.write(`\n${file.path} has been modified.\n`);
|
|
20
|
-
const choice = await askYesNoAllNone('Reset to default?');
|
|
21
|
-
if (choice === 'yes') {
|
|
22
|
-
reset.push(file.path);
|
|
23
|
-
}
|
|
24
|
-
else if (choice === 'all') {
|
|
25
|
-
resetAll = true;
|
|
26
|
-
reset.push(file.path);
|
|
27
|
-
}
|
|
28
|
-
else if (choice === 'none') {
|
|
29
|
-
skipAll = true;
|
|
30
|
-
skip.push(file.path);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
skip.push(file.path);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return { reset, skip };
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=prompt-for-reset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-for-reset.js","sourceRoot":"","sources":["../../../src/lib/init/prompt-for-reset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAapE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA6B,EAC7B,KAAoB;IAEpB,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,IAAI,GAAa,EAAE,CAAA;IACzB,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,OAAO,GAAG,KAAK,CAAA;IAEnB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACpB,SAAQ;QACV,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACrB,SAAQ;QACV,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,uBAAuB,CAAC,CAAA;QACnD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,mBAAmB,CAAC,CAAA;QAEzD,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACvB,CAAC;aAAM,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YAC5B,QAAQ,GAAG,IAAI,CAAA;YACf,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACvB,CAAC;aAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7B,OAAO,GAAG,IAAI,CAAA;YACd,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACxB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface FileToRestore {
|
|
2
|
-
path: string;
|
|
3
|
-
wasInManifest: boolean;
|
|
4
|
-
}
|
|
5
|
-
interface RestoreDecision {
|
|
6
|
-
restore: string[];
|
|
7
|
-
skip: string[];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Prompt user for restore decisions on deleted files
|
|
11
|
-
*/
|
|
12
|
-
export declare function promptForRestore(output: NodeJS.WritableStream, files: FileToRestore[]): Promise<RestoreDecision>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=prompt-for-restore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-for-restore.d.ts","sourceRoot":"","sources":["../../../src/lib/init/prompt-for-restore.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,CAAC,cAAc,EAC7B,KAAK,EAAE,aAAa,EAAE,GACrB,OAAO,CAAC,eAAe,CAAC,CAiC1B"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { askYesNoAllNone } from '../../utils/ask-yes-no-all-none.js';
|
|
2
|
-
/**
|
|
3
|
-
* Prompt user for restore decisions on deleted files
|
|
4
|
-
*/
|
|
5
|
-
export async function promptForRestore(output, files) {
|
|
6
|
-
const restore = [];
|
|
7
|
-
const skip = [];
|
|
8
|
-
let restoreAll = false;
|
|
9
|
-
let skipAll = false;
|
|
10
|
-
for (const file of files) {
|
|
11
|
-
if (skipAll) {
|
|
12
|
-
skip.push(file.path);
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
if (restoreAll) {
|
|
16
|
-
restore.push(file.path);
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
output.write(`\n${file.path} was deleted.\n`);
|
|
20
|
-
const choice = await askYesNoAllNone('Restore?');
|
|
21
|
-
if (choice === 'yes') {
|
|
22
|
-
restore.push(file.path);
|
|
23
|
-
}
|
|
24
|
-
else if (choice === 'all') {
|
|
25
|
-
restoreAll = true;
|
|
26
|
-
restore.push(file.path);
|
|
27
|
-
}
|
|
28
|
-
else if (choice === 'none') {
|
|
29
|
-
skipAll = true;
|
|
30
|
-
skip.push(file.path);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
skip.push(file.path);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return { restore, skip };
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=prompt-for-restore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-for-restore.js","sourceRoot":"","sources":["../../../src/lib/init/prompt-for-restore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAYpE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAA6B,EAC7B,KAAsB;IAEtB,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,IAAI,GAAa,EAAE,CAAA;IACzB,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,OAAO,GAAG,KAAK,CAAA;IAEnB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACpB,SAAQ;QACV,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACvB,SAAQ;QACV,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,IAAI,iBAAiB,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAA;QAEhD,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACzB,CAAC;aAAM,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YAC5B,UAAU,GAAG,IAAI,CAAA;YACjB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACzB,CAAC;aAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7B,OAAO,GAAG,IAAI,CAAA;YACd,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FileInfo } from '../../daemon/types.js';
|
|
2
|
-
export interface FileToRestore {
|
|
3
|
-
path: string;
|
|
4
|
-
wasInManifest: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface FileToReset {
|
|
7
|
-
path: string;
|
|
8
|
-
currentHash: string;
|
|
9
|
-
originalHash: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function fileInfoToRestoreFormat(info: FileInfo): FileToRestore;
|
|
12
|
-
export declare function fileInfoToResetFormat(info: FileInfo): FileToReset;
|
|
13
|
-
//# sourceMappingURL=type-converters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-converters.d.ts","sourceRoot":"","sources":["../../../src/lib/init/type-converters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,aAAa,CAKrE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,CAMjE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function fileInfoToRestoreFormat(info) {
|
|
2
|
-
return {
|
|
3
|
-
path: info.path,
|
|
4
|
-
wasInManifest: true,
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
export function fileInfoToResetFormat(info) {
|
|
8
|
-
return {
|
|
9
|
-
path: info.path,
|
|
10
|
-
currentHash: info.hash,
|
|
11
|
-
originalHash: '',
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=type-converters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-converters.js","sourceRoot":"","sources":["../../../src/lib/init/type-converters.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,uBAAuB,CAAC,IAAc;IACpD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,aAAa,EAAE,IAAI;KACpB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAc;IAClD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,IAAI;QACtB,YAAY,EAAE,EAAE;KACjB,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask-yes-no-all-none.d.ts","sourceRoot":"","sources":["../../src/utils/ask-yes-no-all-none.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;GAEG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAiB7E"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import prompts from 'prompts';
|
|
2
|
-
/**
|
|
3
|
-
* Ask a yes/no/all/none question
|
|
4
|
-
*/
|
|
5
|
-
export async function askYesNoAllNone(question) {
|
|
6
|
-
const response = await prompts({
|
|
7
|
-
type: 'select',
|
|
8
|
-
name: 'value',
|
|
9
|
-
message: question,
|
|
10
|
-
choices: [
|
|
11
|
-
{ title: 'Yes', value: 'yes' },
|
|
12
|
-
{ title: 'No', value: 'no' },
|
|
13
|
-
{ title: 'All', value: 'all' },
|
|
14
|
-
{ title: 'None', value: 'none' },
|
|
15
|
-
],
|
|
16
|
-
});
|
|
17
|
-
const value = response.value;
|
|
18
|
-
if (value === undefined) {
|
|
19
|
-
return 'no';
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=ask-yes-no-all-none.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ask-yes-no-all-none.js","sourceRoot":"","sources":["../../src/utils/ask-yes-no-all-none.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;QAC7B,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;YAC9B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;YAC5B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;YAC9B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;SACjC;KACF,CAAC,CAAA;IACF,MAAM,KAAK,GAA6B,QAAQ,CAAC,KAAK,CAAA;IACtD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-choice.d.ts","sourceRoot":"","sources":["../../src/utils/prompt-choice.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-choice.js","sourceRoot":"","sources":["../../src/utils/prompt-choice.ts"],"names":[],"mappings":""}
|