@dittowords/cli 3.10.1 → 4.0.0
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 +125 -36
- package/bin/add-project.js +101 -33
- package/bin/add-project.js.map +1 -1
- package/bin/api.js +49 -15
- package/bin/api.js.map +1 -1
- package/bin/component-folders.js +56 -7
- package/bin/component-folders.js.map +1 -1
- package/bin/config.js +206 -170
- package/bin/config.js.map +1 -1
- package/bin/config.test.js +92 -0
- package/bin/config.test.js.map +1 -0
- package/bin/consts.js +64 -18
- package/bin/consts.js.map +1 -1
- package/bin/ditto.js +250 -200
- package/bin/ditto.js.map +1 -1
- package/bin/generate-suggestions.js +155 -78
- package/bin/generate-suggestions.js.map +1 -1
- package/bin/generate-suggestions.test.js +189 -0
- package/bin/generate-suggestions.test.js.map +1 -0
- package/bin/http/fetchComponentFolders.js +60 -8
- package/bin/http/fetchComponentFolders.js.map +1 -1
- package/bin/http/fetchComponents.js +65 -18
- package/bin/http/fetchComponents.js.map +1 -1
- package/bin/http/fetchVariants.js +74 -14
- package/bin/http/fetchVariants.js.map +1 -1
- package/bin/http/importComponents.js +100 -49
- package/bin/http/importComponents.js.map +1 -1
- package/bin/importComponents.js +61 -10
- package/bin/importComponents.js.map +1 -1
- package/bin/init/init.js +120 -44
- package/bin/init/init.js.map +1 -1
- package/bin/init/project.js +160 -83
- package/bin/init/project.js.map +1 -1
- package/bin/init/project.test.js +49 -0
- package/bin/init/project.test.js.map +1 -0
- package/bin/init/token.js +134 -74
- package/bin/init/token.js.map +1 -1
- package/bin/init/token.test.js +69 -0
- package/bin/init/token.test.js.map +1 -0
- package/bin/output.js +72 -30
- package/bin/output.js.map +1 -1
- package/bin/pull.js +424 -213
- package/bin/pull.js.map +1 -1
- package/bin/pull.test.js +410 -0
- package/bin/pull.test.js.map +1 -0
- package/bin/remove-project.js +91 -27
- package/bin/remove-project.js.map +1 -1
- package/bin/replace.js +140 -100
- package/bin/replace.js.map +1 -1
- package/bin/replace.test.js +155 -0
- package/bin/replace.test.js.map +1 -0
- package/bin/sentry-test.js.map +1 -0
- package/bin/types.js +20 -2
- package/bin/types.js.map +1 -1
- package/bin/utils/cleanFileName.js +32 -8
- package/bin/utils/cleanFileName.js.map +1 -1
- package/bin/utils/createSentryContext.js +43 -0
- package/bin/utils/createSentryContext.js.map +1 -0
- package/bin/utils/generateJsDriver.js +114 -51
- package/bin/utils/generateJsDriver.js.map +1 -1
- package/bin/utils/getSelectedProjects.js +58 -52
- package/bin/utils/getSelectedProjects.js.map +1 -1
- package/bin/utils/processMetaOption.js +36 -11
- package/bin/utils/processMetaOption.js.map +1 -1
- package/bin/utils/processMetaOption.test.js +45 -0
- package/bin/utils/processMetaOption.test.js.map +1 -0
- package/bin/utils/projectsToText.js +52 -19
- package/bin/utils/projectsToText.js.map +1 -1
- package/bin/utils/promptForProject.js +89 -36
- package/bin/utils/promptForProject.js.map +1 -1
- package/bin/utils/quit.js +36 -7
- package/bin/utils/quit.js.map +1 -1
- package/bin/utils/sourcesToText.js +51 -19
- package/bin/utils/sourcesToText.js.map +1 -1
- package/etsc.config.js +13 -0
- package/lib/config.ts +27 -8
- package/lib/ditto.ts +6 -0
- package/lib/init/project.ts +3 -3
- package/lib/pull.ts +190 -52
- package/lib/types.ts +24 -7
- package/lib/utils/createSentryContext.ts +20 -0
- package/lib/utils/generateJsDriver.ts +40 -6
- package/lib/utils/quit.ts +2 -3
- package/package.json +10 -6
- package/tsconfig.json +4 -1
- package/bin/lib/add-project.js +0 -36
- package/bin/lib/add-project.js.map +0 -1
- package/bin/lib/api.js +0 -20
- package/bin/lib/api.js.map +0 -1
- package/bin/lib/config.js +0 -202
- package/bin/lib/config.js.map +0 -1
- package/bin/lib/consts.js +0 -21
- package/bin/lib/consts.js.map +0 -1
- package/bin/lib/ditto.js +0 -121
- package/bin/lib/ditto.js.map +0 -1
- package/bin/lib/generate-suggestions.js +0 -71
- package/bin/lib/generate-suggestions.js.map +0 -1
- package/bin/lib/http/fetchComponents.js +0 -13
- package/bin/lib/http/fetchComponents.js.map +0 -1
- package/bin/lib/http/fetchVariants.js +0 -26
- package/bin/lib/http/fetchVariants.js.map +0 -1
- package/bin/lib/init/init.js +0 -50
- package/bin/lib/init/init.js.map +0 -1
- package/bin/lib/init/project.js +0 -108
- package/bin/lib/init/project.js.map +0 -1
- package/bin/lib/init/token.js +0 -91
- package/bin/lib/init/token.js.map +0 -1
- package/bin/lib/output.js +0 -34
- package/bin/lib/output.js.map +0 -1
- package/bin/lib/pull.js +0 -264
- package/bin/lib/pull.js.map +0 -1
- package/bin/lib/remove-project.js +0 -35
- package/bin/lib/remove-project.js.map +0 -1
- package/bin/lib/replace.js +0 -107
- package/bin/lib/replace.js.map +0 -1
- package/bin/lib/types.js +0 -3
- package/bin/lib/types.js.map +0 -1
- package/bin/lib/utils/cleanFileName.js +0 -11
- package/bin/lib/utils/cleanFileName.js.map +0 -1
- package/bin/lib/utils/generateJsDriver.js +0 -56
- package/bin/lib/utils/generateJsDriver.js.map +0 -1
- package/bin/lib/utils/getSelectedProjects.js +0 -61
- package/bin/lib/utils/getSelectedProjects.js.map +0 -1
- package/bin/lib/utils/processMetaOption.js +0 -15
- package/bin/lib/utils/processMetaOption.js.map +0 -1
- package/bin/lib/utils/projectsToText.js +0 -25
- package/bin/lib/utils/projectsToText.js.map +0 -1
- package/bin/lib/utils/promptForProject.js +0 -43
- package/bin/lib/utils/promptForProject.js.map +0 -1
- package/bin/lib/utils/quit.js +0 -10
- package/bin/lib/utils/quit.js.map +0 -1
- package/bin/lib/utils/sourcesToText.js +0 -25
- package/bin/lib/utils/sourcesToText.js.map +0 -1
- package/bin/package.json +0 -76
package/bin/init/init.js
CHANGED
|
@@ -1,50 +1,126 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7913f2b7-8085-5c00-92da-2b8d58b9db60")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var __async = (__this, __arguments, generator) => {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
var fulfilled = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.next(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var rejected = (value) => {
|
|
41
|
+
try {
|
|
42
|
+
step(generator.throw(value));
|
|
43
|
+
} catch (e) {
|
|
44
|
+
reject(e);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
48
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
49
|
+
});
|
|
4
50
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
51
|
+
var init_exports = {};
|
|
52
|
+
__export(init_exports, {
|
|
53
|
+
default: () => init_default,
|
|
54
|
+
init: () => init,
|
|
55
|
+
needsTokenOrSource: () => needsTokenOrSource
|
|
56
|
+
});
|
|
57
|
+
module.exports = __toCommonJS(init_exports);
|
|
58
|
+
var import_boxen = __toESM(require("boxen"));
|
|
59
|
+
var import_chalk = __toESM(require("chalk"));
|
|
60
|
+
var import_project = require("./project");
|
|
61
|
+
var import_token = require("./token");
|
|
62
|
+
var import_config = __toESM(require("../config"));
|
|
63
|
+
var import_output = __toESM(require("../output"));
|
|
64
|
+
var import_sourcesToText = __toESM(require("../utils/sourcesToText"));
|
|
65
|
+
var import_quit = require("../utils/quit");
|
|
66
|
+
const needsTokenOrSource = () => (0, import_token.needsToken)() || (0, import_project.needsSource)();
|
|
19
67
|
function welcome() {
|
|
20
|
-
|
|
68
|
+
const msg = import_chalk.default.white(`${import_chalk.default.bold(
|
|
69
|
+
"Welcome to the",
|
|
70
|
+
import_chalk.default.magentaBright("Ditto CLI")
|
|
71
|
+
)}.
|
|
21
72
|
|
|
22
73
|
We're glad to have you here.`);
|
|
23
|
-
|
|
74
|
+
console.log((0, import_boxen.default)(msg, { padding: 1 }));
|
|
24
75
|
}
|
|
25
|
-
const init =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
const init = () => __async(void 0, null, function* () {
|
|
77
|
+
welcome();
|
|
78
|
+
if ((0, import_token.needsToken)()) {
|
|
79
|
+
yield (0, import_token.collectAndSaveToken)();
|
|
80
|
+
}
|
|
81
|
+
const {
|
|
82
|
+
hasSourceData,
|
|
83
|
+
validProjects,
|
|
84
|
+
shouldFetchComponentLibrary,
|
|
85
|
+
hasTopLevelComponentsField,
|
|
86
|
+
hasTopLevelProjectsField
|
|
87
|
+
} = import_config.default.parseSourceInformation();
|
|
88
|
+
if (hasTopLevelProjectsField) {
|
|
89
|
+
return (0, import_quit.quit)(`${import_output.default.errorText(
|
|
90
|
+
`Support for ${import_output.default.warnText(
|
|
91
|
+
"projects"
|
|
92
|
+
)} as a top-level field has been removed; please configure ${import_output.default.warnText(
|
|
93
|
+
"sources.projects"
|
|
94
|
+
)} instead.`
|
|
95
|
+
)}
|
|
96
|
+
See ${import_output.default.url("https://github.com/dittowords/cli")} for more information.`);
|
|
97
|
+
}
|
|
98
|
+
if (hasTopLevelComponentsField) {
|
|
99
|
+
return (0, import_quit.quit)(
|
|
100
|
+
`${import_output.default.errorText(
|
|
101
|
+
"Support for `components` as a top-level field has been removed; please configure `sources.components` instead."
|
|
102
|
+
)}
|
|
103
|
+
See ${import_output.default.url("https://github.com/dittowords/cli")} for more information.`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
if (!hasSourceData) {
|
|
107
|
+
console.log(
|
|
108
|
+
`Looks like there are no Ditto sources selected for your current directory: ${import_output.default.info(
|
|
109
|
+
process.cwd()
|
|
110
|
+
)}.`
|
|
111
|
+
);
|
|
112
|
+
yield (0, import_project.collectAndSaveSource)({ initialize: true, components: true });
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const message = "You're currently set up to sync text from " + (0, import_sourcesToText.default)(validProjects, shouldFetchComponentLibrary);
|
|
116
|
+
console.log(message);
|
|
117
|
+
});
|
|
118
|
+
var init_default = { init };
|
|
119
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
+
0 && (module.exports = {
|
|
121
|
+
init,
|
|
122
|
+
needsTokenOrSource
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=init.js.map
|
|
125
|
+
|
|
126
|
+
//# debugId=7913f2b7-8085-5c00-92da-2b8d58b9db60
|
package/bin/init/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../lib/init/init.ts"],"sourcesContent":["// Related to initializing a user/environment to ditto.\n// expected to be run once per project.\nimport boxen from \"boxen\";\nimport chalk from \"chalk\";\nimport projectsToText from \"../utils/projectsToText\";\n\nimport { needsSource, collectAndSaveSource } from \"./project\";\nimport { needsToken, collectAndSaveToken } from \"./token\";\n\nimport config from \"../config\";\nimport output from \"../output\";\nimport sourcesToText from \"../utils/sourcesToText\";\nimport { quit } from \"../utils/quit\";\n\nexport const needsTokenOrSource = () => needsToken() || needsSource();\n\nfunction welcome() {\n const msg = chalk.white(`${chalk.bold(\n \"Welcome to the\",\n chalk.magentaBright(\"Ditto CLI\")\n )}.\n\nWe're glad to have you here.`);\n console.log(boxen(msg, { padding: 1 }));\n}\n\nexport const init = async () => {\n welcome();\n\n if (needsToken()) {\n await collectAndSaveToken();\n }\n\n const {\n hasSourceData,\n validProjects,\n shouldFetchComponentLibrary,\n hasTopLevelComponentsField,\n hasTopLevelProjectsField,\n } = config.parseSourceInformation();\n\n if (hasTopLevelProjectsField) {\n return quit(`${output.errorText(\n `Support for ${output.warnText(\n \"projects\"\n )} as a top-level field has been removed; please configure ${output.warnText(\n \"sources.projects\"\n )} instead.`\n )}\nSee ${output.url(\"https://github.com/dittowords/cli\")} for more information.`);\n }\n\n if (hasTopLevelComponentsField) {\n return quit(\n `${output.errorText(\n \"Support for `components` as a top-level field has been removed; please configure `sources.components` instead.\"\n )}\nSee ${output.url(\"https://github.com/dittowords/cli\")} for more information.`\n );\n }\n\n if (!hasSourceData) {\n console.log(\n `Looks like there are no Ditto sources selected for your current directory: ${output.info(\n process.cwd()\n )}.`\n );\n await collectAndSaveSource({ initialize: true, components: true });\n return;\n }\n\n const message =\n \"You're currently set up to sync text from \" +\n sourcesToText(validProjects, shouldFetchComponentLibrary);\n\n console.log(message);\n};\n\nexport default { init };\n"],"names":["chalk","boxen","config","output","sourcesToText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAkB;AAClB,mBAAkB;AAGlB,qBAAkD;AAClD,mBAAgD;AAEhD,oBAAmB;AACnB,oBAAmB;AACnB,2BAA0B;AAC1B,kBAAqB;AAEd,MAAM,qBAAqB,UAAM,yBAAW,SAAK,4BAAY;AAEpE,SAAS,UAAU;AACjB,QAAM,MAAM,aAAAA,QAAM,MAAM,GAAG,aAAAA,QAAM;AAAA,IAC/B;AAAA,IACA,aAAAA,QAAM,cAAc,WAAW;AAAA,EACjC,CAAC;AAAA;AAAA,6BAE0B;AAC3B,UAAQ,QAAI,aAAAC,SAAM,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACxC;AAEO,MAAM,OAAO,MAAY;AAC9B,UAAQ;AAER,UAAI,yBAAW,GAAG;AAChB,cAAM,kCAAoB;AAAA,EAC5B;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,cAAAC,QAAO,uBAAuB;AAElC,MAAI,0BAA0B;AAC5B,eAAO,kBAAK,GAAG,cAAAC,QAAO;AAAA,MACpB,eAAe,cAAAA,QAAO;AAAA,QACpB;AAAA,MACF,CAAC,4DAA4D,cAAAA,QAAO;AAAA,QAClE;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,MACC,cAAAA,QAAO,IAAI,mCAAmC,CAAC,wBAAwB;AAAA,EAC3E;AAEA,MAAI,4BAA4B;AAC9B,eAAO;AAAA,MACL,GAAG,cAAAA,QAAO;AAAA,QACR;AAAA,MACF,CAAC;AAAA,MACD,cAAAA,QAAO,IAAI,mCAAmC,CAAC;AAAA,IACjD;AAAA,EACF;AAEA,MAAI,CAAC,eAAe;AAClB,YAAQ;AAAA,MACN,8EAA8E,cAAAA,QAAO;AAAA,QACnF,QAAQ,IAAI;AAAA,MACd,CAAC;AAAA,IACH;AACA,cAAM,qCAAqB,EAAE,YAAY,MAAM,YAAY,KAAK,CAAC;AACjE;AAAA,EACF;AAEA,QAAM,UACJ,mDACA,qBAAAC,SAAc,eAAe,2BAA2B;AAE1D,UAAQ,IAAI,OAAO;AACrB;AAEA,IAAO,eAAQ,EAAE,KAAK","debug_id":"7913f2b7-8085-5c00-92da-2b8d58b9db60"}
|
package/bin/init/project.js
CHANGED
|
@@ -1,105 +1,182 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fe72409f-ce5c-58cd-8ee2-da472d2578a7")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
13
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
var __async = (__this, __arguments, generator) => {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
var fulfilled = (value) => {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.next(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var rejected = (value) => {
|
|
41
|
+
try {
|
|
42
|
+
step(generator.throw(value));
|
|
43
|
+
} catch (e) {
|
|
44
|
+
reject(e);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
48
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var project_exports = {};
|
|
52
|
+
__export(project_exports, {
|
|
53
|
+
_testing: () => _testing,
|
|
54
|
+
collectAndSaveSource: () => collectAndSaveSource,
|
|
55
|
+
default: () => project_default,
|
|
56
|
+
needsSource: () => needsSource
|
|
57
|
+
});
|
|
58
|
+
module.exports = __toCommonJS(project_exports);
|
|
59
|
+
var import_ora = __toESM(require("ora"));
|
|
60
|
+
var import_api = require("../api");
|
|
61
|
+
var import_config = __toESM(require("../config"));
|
|
62
|
+
var import_consts = __toESM(require("../consts"));
|
|
63
|
+
var import_output = __toESM(require("../output"));
|
|
64
|
+
var import_token = require("./token");
|
|
65
|
+
var import_getSelectedProjects = require("../utils/getSelectedProjects");
|
|
66
|
+
var import_promptForProject = __toESM(require("../utils/promptForProject"));
|
|
67
|
+
var import_quit = require("../utils/quit");
|
|
16
68
|
function saveProject(file, name, id) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
69
|
+
if (id === "components") {
|
|
70
|
+
import_config.default.writeProjectConfigData(file, {
|
|
71
|
+
sources: { components: true }
|
|
72
|
+
});
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const projects = [...(0, import_getSelectedProjects.getSelectedProjects)(file), { name, id }];
|
|
76
|
+
import_config.default.writeProjectConfigData(file, { sources: { projects } });
|
|
25
77
|
}
|
|
26
78
|
const needsSource = () => {
|
|
27
|
-
|
|
79
|
+
return !import_config.default.parseSourceInformation().hasSourceData;
|
|
28
80
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
81
|
+
function askForAnotherToken() {
|
|
82
|
+
return __async(this, null, function* () {
|
|
83
|
+
import_config.default.deleteToken(import_consts.default.CONFIG_FILE, import_consts.default.API_HOST);
|
|
32
84
|
const message = "Looks like the API key you have saved no longer works. Please enter another one.";
|
|
33
|
-
|
|
85
|
+
yield (0, import_token.collectAndSaveToken)(message);
|
|
86
|
+
});
|
|
34
87
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
88
|
+
function listProjects(token, projectsAlreadySelected) {
|
|
89
|
+
return __async(this, null, function* () {
|
|
90
|
+
const api = (0, import_api.createApiClient)();
|
|
91
|
+
const spinner = (0, import_ora.default)("Fetching sources in your workspace...");
|
|
38
92
|
spinner.start();
|
|
39
93
|
let response;
|
|
40
94
|
try {
|
|
41
|
-
|
|
95
|
+
response = yield api.get("/project-names");
|
|
96
|
+
} catch (e) {
|
|
97
|
+
spinner.stop();
|
|
98
|
+
throw e;
|
|
42
99
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
100
|
+
const projectsAlreadySelectedSet = projectsAlreadySelected.reduce(
|
|
101
|
+
(set, project) => set.add(project.id.toString()),
|
|
102
|
+
/* @__PURE__ */ new Set()
|
|
103
|
+
);
|
|
104
|
+
const result = response.data.filter(
|
|
105
|
+
({ id }) => (
|
|
106
|
+
// covers an edge case where v0 of the API includes the component library
|
|
107
|
+
// in the response from the `/project-names` endpoint
|
|
108
|
+
id !== "ditto_component_library" && !projectsAlreadySelectedSet.has(id.toString())
|
|
109
|
+
)
|
|
110
|
+
);
|
|
53
111
|
spinner.stop();
|
|
54
112
|
return result;
|
|
113
|
+
});
|
|
55
114
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
115
|
+
function collectSource(token, includeComponents) {
|
|
116
|
+
return __async(this, null, function* () {
|
|
117
|
+
const projectsAlreadySelected = (0, import_getSelectedProjects.getSelectedProjects)();
|
|
118
|
+
const componentSourceSelected = (0, import_getSelectedProjects.getIsUsingComponents)();
|
|
119
|
+
let sources = yield listProjects(token, projectsAlreadySelected);
|
|
60
120
|
if (includeComponents && !componentSourceSelected) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
121
|
+
sources = [
|
|
122
|
+
{ id: "ditto_component_library", name: "Ditto Component Library" },
|
|
123
|
+
...sources
|
|
124
|
+
];
|
|
65
125
|
}
|
|
66
|
-
if (!sources
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
126
|
+
if (!(sources == null ? void 0 : sources.length)) {
|
|
127
|
+
console.log("You're currently syncing all projects in your workspace.");
|
|
128
|
+
console.log(
|
|
129
|
+
import_output.default.warnText(
|
|
130
|
+
"Not seeing a project that you were expecting? Verify that developer mode is enabled on that project. More info: https://www.dittowords.com/docs/ditto-developer-mode"
|
|
131
|
+
)
|
|
132
|
+
);
|
|
133
|
+
return null;
|
|
70
134
|
}
|
|
71
|
-
return (0,
|
|
72
|
-
|
|
73
|
-
|
|
135
|
+
return (0, import_promptForProject.default)({
|
|
136
|
+
projects: sources,
|
|
137
|
+
message: "Choose the source you'd like to sync text from"
|
|
74
138
|
});
|
|
139
|
+
});
|
|
75
140
|
}
|
|
76
|
-
const collectAndSaveSource =
|
|
77
|
-
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
console.log("\n" +
|
|
87
|
-
`Thanks for adding ${output_1.default.info(project.name)} to your selected sources.\n` +
|
|
88
|
-
`We saved your updated configuration to: ${output_1.default.info(consts_1.default.PROJECT_CONFIG_FILE)}\n`);
|
|
89
|
-
saveProject(consts_1.default.PROJECT_CONFIG_FILE, project.name, project.id);
|
|
141
|
+
const collectAndSaveSource = (..._0) => __async(void 0, [..._0], function* ({ components = false } = {
|
|
142
|
+
components: false
|
|
143
|
+
}) {
|
|
144
|
+
try {
|
|
145
|
+
const token = import_config.default.getToken(import_consts.default.CONFIG_FILE, import_consts.default.API_HOST);
|
|
146
|
+
const project = yield collectSource(token, components);
|
|
147
|
+
if (!project) {
|
|
148
|
+
(0, import_quit.quit)(null, 0);
|
|
149
|
+
return;
|
|
90
150
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
151
|
+
console.log(
|
|
152
|
+
`
|
|
153
|
+
Thanks for adding ${import_output.default.info(
|
|
154
|
+
project.name
|
|
155
|
+
)} to your selected sources.
|
|
156
|
+
We saved your updated configuration to: ${import_output.default.info(
|
|
157
|
+
import_consts.default.PROJECT_CONFIG_FILE
|
|
158
|
+
)}
|
|
159
|
+
`
|
|
160
|
+
);
|
|
161
|
+
saveProject(import_consts.default.PROJECT_CONFIG_FILE, project.name, project.id);
|
|
162
|
+
} catch (e) {
|
|
163
|
+
console.log(e);
|
|
164
|
+
if (e.response && e.response.status === 404) {
|
|
165
|
+
yield askForAnotherToken();
|
|
166
|
+
yield collectAndSaveSource({ components });
|
|
167
|
+
} else {
|
|
168
|
+
(0, import_quit.quit)(null, 2);
|
|
100
169
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const _testing = { saveProject, needsSource };
|
|
173
|
+
var project_default = { needsSource, collectAndSaveSource };
|
|
174
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
175
|
+
0 && (module.exports = {
|
|
176
|
+
_testing,
|
|
177
|
+
collectAndSaveSource,
|
|
178
|
+
needsSource
|
|
179
|
+
});
|
|
180
|
+
//# sourceMappingURL=project.js.map
|
|
181
|
+
|
|
182
|
+
//# debugId=fe72409f-ce5c-58cd-8ee2-da472d2578a7
|
package/bin/init/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../lib/init/project.ts"],"sourcesContent":["import ora from \"ora\";\n\nimport { createApiClient } from \"../api\";\nimport config from \"../config\";\nimport consts from \"../consts\";\nimport output from \"../output\";\nimport { collectAndSaveToken } from \"./token\";\nimport {\n getSelectedProjects,\n getIsUsingComponents,\n} from \"../utils/getSelectedProjects\";\nimport promptForProject from \"../utils/promptForProject\";\nimport { AxiosResponse } from \"axios\";\nimport { Project, Token } from \"../types\";\nimport { quit } from \"../utils/quit\";\n\nfunction saveProject(file: string, name: string, id: string) {\n if (id === \"components\") {\n config.writeProjectConfigData(file, {\n sources: { components: true },\n });\n return;\n }\n\n const projects = [...getSelectedProjects(file), { name, id }];\n config.writeProjectConfigData(file, { sources: { projects } });\n}\n\nexport const needsSource = () => {\n return !config.parseSourceInformation().hasSourceData;\n};\n\nasync function askForAnotherToken() {\n config.deleteToken(consts.CONFIG_FILE, consts.API_HOST);\n const message =\n \"Looks like the API key you have saved no longer works. Please enter another one.\";\n await collectAndSaveToken(message);\n}\n\nasync function listProjects(token: Token, projectsAlreadySelected: Project[]) {\n const api = createApiClient();\n const spinner = ora(\"Fetching sources in your workspace...\");\n spinner.start();\n\n let response: AxiosResponse<{ id: string; name: string }[]>;\n try {\n response = await api.get(\"/project-names\");\n } catch (e) {\n spinner.stop();\n throw e;\n }\n\n const projectsAlreadySelectedSet = projectsAlreadySelected.reduce(\n (set, project) => set.add(project.id.toString()),\n new Set<string>()\n );\n\n const result = response.data.filter(\n ({ id }) =>\n // covers an edge case where v0 of the API includes the component library\n // in the response from the `/project-names` endpoint\n id !== \"ditto_component_library\" &&\n !projectsAlreadySelectedSet.has(id.toString())\n );\n\n spinner.stop();\n\n return result;\n}\n\nasync function collectSource(token: Token, includeComponents: boolean) {\n const projectsAlreadySelected = getSelectedProjects();\n const componentSourceSelected = getIsUsingComponents();\n\n let sources = await listProjects(token, projectsAlreadySelected);\n if (includeComponents && !componentSourceSelected) {\n sources = [\n { id: \"ditto_component_library\", name: \"Ditto Component Library\" },\n ...sources,\n ];\n }\n\n if (!sources?.length) {\n console.log(\"You're currently syncing all projects in your workspace.\");\n console.log(\n output.warnText(\n \"Not seeing a project that you were expecting? Verify that developer mode is enabled on that project. More info: https://www.dittowords.com/docs/ditto-developer-mode\"\n )\n );\n return null;\n }\n\n return promptForProject({\n projects: sources,\n message: \"Choose the source you'd like to sync text from\",\n });\n}\n\nexport const collectAndSaveSource = async (\n { components = false }: { initialize?: boolean; components?: boolean } = {\n components: false,\n }\n) => {\n try {\n const token = config.getToken(consts.CONFIG_FILE, consts.API_HOST);\n const project = await collectSource(token, components);\n if (!project) {\n quit(null, 0);\n return;\n }\n\n console.log(\n \"\\n\" +\n `Thanks for adding ${output.info(\n project.name\n )} to your selected sources.\\n` +\n `We saved your updated configuration to: ${output.info(\n consts.PROJECT_CONFIG_FILE\n )}\\n`\n );\n\n saveProject(consts.PROJECT_CONFIG_FILE, project.name, project.id);\n } catch (e: any) {\n console.log(e);\n if (e.response && e.response.status === 404) {\n await askForAnotherToken();\n await collectAndSaveSource({ components });\n } else {\n quit(null, 2);\n }\n }\n};\n\nexport const _testing = { saveProject, needsSource };\n\nexport default { needsSource, collectAndSaveSource };\n"],"names":["config","consts","ora","output","promptForProject"],"mappings":"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","debug_id":"fe72409f-ce5c-58cd-8ee2-da472d2578a7"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="303bce00-0890-56b5-beeb-9b739774442f")}catch(e){}}();
|
|
3
|
+
|
|
4
|
+
var import_project = require("./project");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const yaml = require("js-yaml");
|
|
8
|
+
const { createFileIfMissing } = require("../config");
|
|
9
|
+
const fakeProjectDir = path.join(__dirname, "../../testing/tmp");
|
|
10
|
+
const badYaml = path.join(__dirname, "../../testing/fixtures/bad-yaml.yml");
|
|
11
|
+
const configEmptyProjects = path.join(
|
|
12
|
+
__dirname,
|
|
13
|
+
"../../testing/fixtures/bad-yaml.yml"
|
|
14
|
+
);
|
|
15
|
+
const configMissingName = path.join(
|
|
16
|
+
__dirname,
|
|
17
|
+
"../../testing/fixtures/project-config-no-name.yml"
|
|
18
|
+
);
|
|
19
|
+
const configMissingId = path.join(
|
|
20
|
+
__dirname,
|
|
21
|
+
"../../testing/fixtures/project-config-no-id.yml"
|
|
22
|
+
);
|
|
23
|
+
const configLegit = path.join(
|
|
24
|
+
__dirname,
|
|
25
|
+
"../../testing/fixtures/project-config-working.yml"
|
|
26
|
+
);
|
|
27
|
+
describe("saveProject", () => {
|
|
28
|
+
const configFile = path.join(fakeProjectDir, "ditto/config.yml");
|
|
29
|
+
const projectName = "My Amazing Project";
|
|
30
|
+
const projectId = "5f284259ce1d451b2eb2e23c";
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
if (!fs.existsSync(fakeProjectDir))
|
|
33
|
+
fs.mkdirSync(fakeProjectDir);
|
|
34
|
+
import_project._testing.saveProject(configFile, projectName, projectId);
|
|
35
|
+
});
|
|
36
|
+
afterEach(() => {
|
|
37
|
+
fs.rmdirSync(fakeProjectDir, { recursive: true });
|
|
38
|
+
});
|
|
39
|
+
it("creates a config file with config data", () => {
|
|
40
|
+
const fileContents = fs.readFileSync(configFile, "utf8");
|
|
41
|
+
const data = yaml.load(fileContents);
|
|
42
|
+
expect(data.sources.projects).toBeDefined();
|
|
43
|
+
expect(data.sources.projects[0].name).toEqual(projectName);
|
|
44
|
+
expect(data.sources.projects[0].id).toEqual(projectId);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=project.test.js.map
|
|
48
|
+
|
|
49
|
+
//# debugId=303bce00-0890-56b5-beeb-9b739774442f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../lib/init/project.test.ts"],"sourcesContent":["const fs = require(\"fs\");\nconst path = require(\"path\");\n\nconst yaml = require(\"js-yaml\");\nconst { createFileIfMissing } = require(\"../config\");\n\nimport { _testing } from \"./project\";\n\nconst fakeProjectDir = path.join(__dirname, \"../../testing/tmp\");\nconst badYaml = path.join(__dirname, \"../../testing/fixtures/bad-yaml.yml\");\nconst configEmptyProjects = path.join(\n __dirname,\n \"../../testing/fixtures/bad-yaml.yml\"\n);\nconst configMissingName = path.join(\n __dirname,\n \"../../testing/fixtures/project-config-no-name.yml\"\n);\nconst configMissingId = path.join(\n __dirname,\n \"../../testing/fixtures/project-config-no-id.yml\"\n);\nconst configLegit = path.join(\n __dirname,\n \"../../testing/fixtures/project-config-working.yml\"\n);\n\ndescribe(\"saveProject\", () => {\n const configFile = path.join(fakeProjectDir, \"ditto/config.yml\");\n const projectName = \"My Amazing Project\";\n const projectId = \"5f284259ce1d451b2eb2e23c\";\n\n beforeEach(() => {\n if (!fs.existsSync(fakeProjectDir)) fs.mkdirSync(fakeProjectDir);\n _testing.saveProject(configFile, projectName, projectId);\n });\n\n afterEach(() => {\n fs.rmdirSync(fakeProjectDir, { recursive: true });\n });\n\n it(\"creates a config file with config data\", () => {\n const fileContents = fs.readFileSync(configFile, \"utf8\");\n const data = yaml.load(fileContents);\n expect(data.sources.projects).toBeDefined();\n expect(data.sources.projects[0].name).toEqual(projectName);\n expect(data.sources.projects[0].id).toEqual(projectId);\n });\n});\n"],"names":[],"mappings":";;;AAMA,qBAAyB;AANzB,MAAM,KAAK,QAAQ,IAAI;AACvB,MAAM,OAAO,QAAQ,MAAM;AAE3B,MAAM,OAAO,QAAQ,SAAS;AAC9B,MAAM,EAAE,oBAAoB,IAAI,QAAQ,WAAW;AAInD,MAAM,iBAAiB,KAAK,KAAK,WAAW,mBAAmB;AAC/D,MAAM,UAAU,KAAK,KAAK,WAAW,qCAAqC;AAC1E,MAAM,sBAAsB,KAAK;AAAA,EAC/B;AAAA,EACA;AACF;AACA,MAAM,oBAAoB,KAAK;AAAA,EAC7B;AAAA,EACA;AACF;AACA,MAAM,kBAAkB,KAAK;AAAA,EAC3B;AAAA,EACA;AACF;AACA,MAAM,cAAc,KAAK;AAAA,EACvB;AAAA,EACA;AACF;AAEA,SAAS,eAAe,MAAM;AAC5B,QAAM,aAAa,KAAK,KAAK,gBAAgB,kBAAkB;AAC/D,QAAM,cAAc;AACpB,QAAM,YAAY;AAElB,aAAW,MAAM;AACf,QAAI,CAAC,GAAG,WAAW,cAAc;AAAG,SAAG,UAAU,cAAc;AAC/D,4BAAS,YAAY,YAAY,aAAa,SAAS;AAAA,EACzD,CAAC;AAED,YAAU,MAAM;AACd,OAAG,UAAU,gBAAgB,EAAE,WAAW,KAAK,CAAC;AAAA,EAClD,CAAC;AAED,KAAG,0CAA0C,MAAM;AACjD,UAAM,eAAe,GAAG,aAAa,YAAY,MAAM;AACvD,UAAM,OAAO,KAAK,KAAK,YAAY;AACnC,WAAO,KAAK,QAAQ,QAAQ,EAAE,YAAY;AAC1C,WAAO,KAAK,QAAQ,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,WAAW;AACzD,WAAO,KAAK,QAAQ,SAAS,CAAC,EAAE,EAAE,EAAE,QAAQ,SAAS;AAAA,EACvD,CAAC;AACH,CAAC","debug_id":"303bce00-0890-56b5-beeb-9b739774442f"}
|