@dittowords/cli 2.5.1 → 2.6.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/.idea/workspace.xml +124 -0
- package/README.md +23 -10
- package/babel.config.js +2 -8
- package/bin/add-project.js +38 -0
- package/bin/add-project.js.map +1 -0
- package/bin/api.js +20 -0
- package/bin/api.js.map +1 -0
- package/bin/config.js +174 -0
- package/bin/config.js.map +1 -0
- package/bin/consts.js +21 -0
- package/bin/consts.js.map +1 -0
- package/bin/ditto.js +71 -74
- package/bin/ditto.js.map +1 -0
- package/bin/init/init.js +39 -0
- package/bin/init/init.js.map +1 -0
- package/bin/init/project.js +115 -0
- package/bin/init/project.js.map +1 -0
- package/bin/init/token.js +89 -0
- package/bin/init/token.js.map +1 -0
- package/bin/output.js +34 -0
- package/bin/output.js.map +1 -0
- package/bin/pull.js +305 -0
- package/bin/pull.js.map +1 -0
- package/bin/remove-project.js +40 -0
- package/bin/remove-project.js.map +1 -0
- package/bin/types.js +3 -0
- package/bin/types.js.map +1 -0
- package/bin/utils/getSelectedProjects.js +76 -0
- package/bin/utils/getSelectedProjects.js.map +1 -0
- package/bin/utils/processMetaOption.js +15 -0
- package/bin/utils/processMetaOption.js.map +1 -0
- package/bin/utils/projectsToText.js +16 -0
- package/bin/utils/projectsToText.js.map +1 -0
- package/bin/utils/promptForProject.js +44 -0
- package/bin/utils/promptForProject.js.map +1 -0
- package/bin/utils/sourcesToText.js +25 -0
- package/bin/utils/sourcesToText.js.map +1 -0
- package/jest.config.js +1 -1
- package/lib/{add-project.js → add-project.ts} +8 -8
- package/lib/api.ts +15 -0
- package/lib/{config.test.js → config.test.ts} +14 -25
- package/lib/config.ts +214 -0
- package/lib/consts.ts +20 -0
- package/lib/ditto.ts +97 -0
- package/lib/init/{init.js → init.ts} +11 -12
- package/lib/init/project.test.ts +49 -0
- package/lib/init/{project.js → project.ts} +31 -29
- package/lib/init/{token.test.js → token.test.ts} +3 -3
- package/lib/init/{token.js → token.ts} +23 -19
- package/lib/output.ts +21 -0
- package/lib/pull.test.ts +172 -0
- package/lib/{pull.js → pull.ts} +145 -98
- package/lib/{remove-project.js → remove-project.ts} +11 -15
- package/lib/types.ts +23 -0
- package/lib/utils/getSelectedProjects.ts +55 -0
- package/lib/utils/processMetaOption.test.ts +18 -0
- package/lib/utils/processMetaOption.ts +16 -0
- package/lib/utils/{projectsToText.js → projectsToText.ts} +5 -4
- package/lib/utils/{promptForProject.js → promptForProject.ts} +18 -9
- package/lib/utils/{sourcesToText.js → sourcesToText.ts} +6 -5
- package/package.json +20 -15
- package/testing/fixtures/project-config-pull.yml +0 -0
- package/tsconfig.json +12 -0
- package/yarn-error.log +4466 -0
- package/lib/api.js +0 -18
- package/lib/config.js +0 -169
- package/lib/consts.js +0 -14
- package/lib/init/project.test.js +0 -99
- package/lib/output.js +0 -21
- package/lib/pull.test.js +0 -173
- package/lib/utils/getSelectedProjects.js +0 -44
- package/lib/utils/processMetaOption.js +0 -16
- package/lib/utils/processMetaOption.test.js +0 -16
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ChangeListManager">
|
|
4
|
+
<list default="true" id="feed0935-3e92-4ed5-8f31-d50d40a3160d" name="Changes" comment="context -> githubActionRequest" />
|
|
5
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
6
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
7
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
8
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
9
|
+
</component>
|
|
10
|
+
<component name="Git.Settings">
|
|
11
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="GitSEFilterConfiguration">
|
|
14
|
+
<file-type-list>
|
|
15
|
+
<filtered-out-file-type name="LOCAL_BRANCH" />
|
|
16
|
+
<filtered-out-file-type name="REMOTE_BRANCH" />
|
|
17
|
+
<filtered-out-file-type name="TAG" />
|
|
18
|
+
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
|
|
19
|
+
</file-type-list>
|
|
20
|
+
</component>
|
|
21
|
+
<component name="ProjectId" id="22eyXkIpY8uECD7XHWWVJVH2o1w" />
|
|
22
|
+
<component name="ProjectViewState">
|
|
23
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
|
24
|
+
<option name="showLibraryContents" value="true" />
|
|
25
|
+
</component>
|
|
26
|
+
<component name="PropertiesComponent">
|
|
27
|
+
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
|
28
|
+
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
|
29
|
+
<property name="WebServerToolWindowFactoryState" value="false" />
|
|
30
|
+
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
|
31
|
+
<property name="node.js.detected.package.eslint" value="true" />
|
|
32
|
+
<property name="node.js.selected.package.eslint" value="(autodetect)" />
|
|
33
|
+
<property name="nodejs.jest.jest_package" value="$PROJECT_DIR$/node_modules/jest" />
|
|
34
|
+
<property name="nodejs_package_manager_path" value="yarn" />
|
|
35
|
+
<property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" />
|
|
36
|
+
<property name="vue.rearranger.settings.migration" value="true" />
|
|
37
|
+
</component>
|
|
38
|
+
<component name="RunManager">
|
|
39
|
+
<configuration name="processMetaOption tests" type="JavaScriptTestRunnerJest" temporary="true" nameIsGenerated="true">
|
|
40
|
+
<node-interpreter value="project" />
|
|
41
|
+
<node-options value="" />
|
|
42
|
+
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
|
|
43
|
+
<working-dir value="$PROJECT_DIR$" />
|
|
44
|
+
<envs />
|
|
45
|
+
<scope-kind value="SUITE" />
|
|
46
|
+
<test-file value="$PROJECT_DIR$/lib/utils/processMetaOption.test.js" />
|
|
47
|
+
<test-names>
|
|
48
|
+
<test-name value="processMetaOption tests" />
|
|
49
|
+
</test-names>
|
|
50
|
+
<method v="2" />
|
|
51
|
+
</configuration>
|
|
52
|
+
<recent_temporary>
|
|
53
|
+
<list>
|
|
54
|
+
<item itemvalue="Jest.processMetaOption tests" />
|
|
55
|
+
</list>
|
|
56
|
+
</recent_temporary>
|
|
57
|
+
</component>
|
|
58
|
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
59
|
+
<component name="TaskManager">
|
|
60
|
+
<task active="true" id="Default" summary="Default task">
|
|
61
|
+
<changelist id="feed0935-3e92-4ed5-8f31-d50d40a3160d" name="Changes" comment="" />
|
|
62
|
+
<created>1640212388756</created>
|
|
63
|
+
<option name="number" value="Default" />
|
|
64
|
+
<option name="presentableId" value="Default" />
|
|
65
|
+
<updated>1640212388756</updated>
|
|
66
|
+
<workItem from="1640212390396" duration="2754000" />
|
|
67
|
+
<workItem from="1652899005217" duration="17894000" />
|
|
68
|
+
<workItem from="1653328043941" duration="20000" />
|
|
69
|
+
<workItem from="1653329434368" duration="3872000" />
|
|
70
|
+
</task>
|
|
71
|
+
<task id="LOCAL-00001" summary="Review option changing">
|
|
72
|
+
<created>1653329636527</created>
|
|
73
|
+
<option name="number" value="00001" />
|
|
74
|
+
<option name="presentableId" value="LOCAL-00001" />
|
|
75
|
+
<option name="project" value="LOCAL" />
|
|
76
|
+
<updated>1653329636527</updated>
|
|
77
|
+
</task>
|
|
78
|
+
<task id="LOCAL-00002" summary="Saftey check for options">
|
|
79
|
+
<created>1653329947356</created>
|
|
80
|
+
<option name="number" value="00002" />
|
|
81
|
+
<option name="presentableId" value="LOCAL-00002" />
|
|
82
|
+
<option name="project" value="LOCAL" />
|
|
83
|
+
<updated>1653329947356</updated>
|
|
84
|
+
</task>
|
|
85
|
+
<task id="LOCAL-00003" summary="Generic meta passing to endpoints">
|
|
86
|
+
<created>1653331832365</created>
|
|
87
|
+
<option name="number" value="00003" />
|
|
88
|
+
<option name="presentableId" value="LOCAL-00003" />
|
|
89
|
+
<option name="project" value="LOCAL" />
|
|
90
|
+
<updated>1653331832365</updated>
|
|
91
|
+
</task>
|
|
92
|
+
<task id="LOCAL-00004" summary="context -> githubActionRequest">
|
|
93
|
+
<created>1653332089321</created>
|
|
94
|
+
<option name="number" value="00004" />
|
|
95
|
+
<option name="presentableId" value="LOCAL-00004" />
|
|
96
|
+
<option name="project" value="LOCAL" />
|
|
97
|
+
<updated>1653332089321</updated>
|
|
98
|
+
</task>
|
|
99
|
+
<option name="localTasksCounter" value="5" />
|
|
100
|
+
<servers />
|
|
101
|
+
</component>
|
|
102
|
+
<component name="TypeScriptGeneratedFilesManager">
|
|
103
|
+
<option name="version" value="3" />
|
|
104
|
+
</component>
|
|
105
|
+
<component name="Vcs.Log.Tabs.Properties">
|
|
106
|
+
<option name="TAB_STATES">
|
|
107
|
+
<map>
|
|
108
|
+
<entry key="MAIN">
|
|
109
|
+
<value>
|
|
110
|
+
<State />
|
|
111
|
+
</value>
|
|
112
|
+
</entry>
|
|
113
|
+
</map>
|
|
114
|
+
</option>
|
|
115
|
+
<option name="oldMeFiltersMigrated" value="true" />
|
|
116
|
+
</component>
|
|
117
|
+
<component name="VcsManagerConfiguration">
|
|
118
|
+
<MESSAGE value="Review option changing" />
|
|
119
|
+
<MESSAGE value="Saftey check for options" />
|
|
120
|
+
<MESSAGE value="Generic meta passing to endpoints" />
|
|
121
|
+
<MESSAGE value="context -> githubActionRequest" />
|
|
122
|
+
<option name="LAST_COMMIT_MESSAGE" value="context -> githubActionRequest" />
|
|
123
|
+
</component>
|
|
124
|
+
</project>
|
package/README.md
CHANGED
|
@@ -54,9 +54,7 @@ Once you've successfully authenticated and a config file has been created, you
|
|
|
54
54
|
|
|
55
55
|
The CLI will not prompt for an API key if a value is provided in the environment variable `DITTO_API_KEY`.
|
|
56
56
|
|
|
57
|
-
If the `DITTO_API_KEY` environment variable is not set,
|
|
58
|
-
path `~/.config/ditto`. If this file does not exist or does not contain a valid API key, then the CLI will prompt
|
|
59
|
-
for one.
|
|
57
|
+
If the `DITTO_API_KEY` environment variable is not set, the CLI will attempt to parse a token from [your authentication file](#authentication). If this file does not exist or does not contain a valid API key, the CLI will prompt for one.
|
|
60
58
|
|
|
61
59
|
We don't recommend editing the file manually; if you need to remove a saved API key and put another one in its place,
|
|
62
60
|
it's better to fully delete the file and then re-run the CLI so that a new key is prompted for.
|
|
@@ -69,7 +67,7 @@ it's better to fully delete the file and then re-run the CLI so that a new key i
|
|
|
69
67
|
|
|
70
68
|
**Action:** Pulls text data from projects linked in `config.yml` and stores it in the `ditto/` folder.
|
|
71
69
|
|
|
72
|
-
The data will be stored in JSON files according to the `format` property specified in `config.yml`. If no format is specified, the default structured format will be used. Every time text is pulled, the existing text data is removed before new data is generated and stored.
|
|
70
|
+
The data will be stored in JSON, XML, or .strings files according to the `format` property specified in `config.yml`. If no format is specified, the default structured format will be used. Every time text is pulled, the existing text data is removed before new data is generated and stored.
|
|
73
71
|
|
|
74
72
|
For more details on files generated by the `pull` command, see [JSON Files](#json-files).
|
|
75
73
|
|
|
@@ -86,13 +84,14 @@ For more details on files generated by the `pull` command, see [JSON Files](#jso
|
|
|
86
84
|
**Action:** Removes a project from the list of Ditto projects stored in `config.yml`.
|
|
87
85
|
|
|
88
86
|
## Options
|
|
87
|
+
|
|
89
88
|
`-m, --meta <data...>` Optional metadata to send arbitrary data to the backend. Ex: `-m githubActionRequest:true trigger:manual`. Currently, this option should only be utilized when the CLI is ran within a GitHub action (see [Ditto GitHub Action](https://github.com/dittowords/ditto-github-action)) via `githubActionRequest:true`.
|
|
90
89
|
|
|
91
90
|
## Files
|
|
92
91
|
|
|
93
92
|
### `ditto/`
|
|
94
93
|
|
|
95
|
-
This folder houses the configuration file (`ditto/config.yml`) used by the CLI and is also the write destination for any files the CLI generates.
|
|
94
|
+
This folder houses the configuration file (`ditto/config.yml`) used by the CLI and is also the default write destination for any files the CLI generates. See [Output Directory](#output-directory) for details about how to customize the location that files are written to.
|
|
96
95
|
|
|
97
96
|
If you run the CLI in a directory that does not contain a `ditto/` folder, the folder and a `config.yml` file will be automatically created.
|
|
98
97
|
|
|
@@ -106,7 +105,7 @@ If you run the CLI in a directory that does not contain a `ditto/` folder, the f
|
|
|
106
105
|
|
|
107
106
|
##### `projects`
|
|
108
107
|
|
|
109
|
-
A list of project names and ids to pull text from.
|
|
108
|
+
A list of project names and ids to pull text from.
|
|
110
109
|
|
|
111
110
|
Required if `components: true` is not specified.
|
|
112
111
|
|
|
@@ -143,7 +142,7 @@ If you run the CLI in a directory that does not contain a `ditto/` folder, the f
|
|
|
143
142
|
|
|
144
143
|
##### `format`
|
|
145
144
|
|
|
146
|
-
The format the specified projects should be stored in. Acceptable values are `structured`
|
|
145
|
+
The format the specified projects should be stored in. Acceptable values are `structured`, `flat`, `android`, and `ios-strings`.
|
|
147
146
|
|
|
148
147
|
If not specified, the default format containing block and frame data will be used.
|
|
149
148
|
|
|
@@ -166,7 +165,7 @@ If you run the CLI in a directory that does not contain a `ditto/` folder, the f
|
|
|
166
165
|
|
|
167
166
|
- #### JSON Files
|
|
168
167
|
|
|
169
|
-
|
|
168
|
+
For `structured` and `flat` formats the copy pulled from your Ditto projects is saved to JSON files in the `ditto/` folder.
|
|
170
169
|
|
|
171
170
|
The number of files present and the convention with which they're named will vary according to the options specified in `config.yml`:
|
|
172
171
|
|
|
@@ -175,6 +174,12 @@ If you run the CLI in a directory that does not contain a `ditto/` folder, the f
|
|
|
175
174
|
- If the `variants` option is unset and the `format` open is `flat` or `structured`, files will be written on a per-project basis following the pattern `[project-id].json`.
|
|
176
175
|
- If the `variants` option is `true` and the `format` option is `flat` or `structured`, files will be written on a per-project per-variant basis following the pattern `[project-id__variant-api-id].json`. These files will NOT contain the top-level `projects` and `project_xyz` keys.
|
|
177
176
|
|
|
177
|
+
- #### Mobile files (XML and .strings)
|
|
178
|
+
|
|
179
|
+
When `format` is set to `android`, the resulting files will be in XML format. More information about the contents of the XML files can be found [here](https://developer.dittowords.com/api-reference#android).
|
|
180
|
+
|
|
181
|
+
When `format` is set to `ios-strings`, the resulting files will be in .strings format. More information about the contents of the .strings files can be found [here](https://developer.dittowords.com/api-reference#ios-strings).
|
|
182
|
+
|
|
178
183
|
- #### `index.js`
|
|
179
184
|
|
|
180
185
|
An automatically generated driver file that simplifies the process of passing text data to Ditto JavaScript SDKs. This file has a standardized format that is always the same independent of the CLI configuration used to generate it.
|
|
@@ -228,9 +233,17 @@ If you run the CLI in a directory that does not contain a `ditto/` folder, the f
|
|
|
228
233
|
const App = () => <DittoProvider source={source}>...</DittoProvider>;
|
|
229
234
|
```
|
|
230
235
|
|
|
231
|
-
|
|
236
|
+
## Files
|
|
237
|
+
|
|
238
|
+
### Output Directory
|
|
239
|
+
|
|
240
|
+
By default, the CLI writes it's output files to `./ditto` (relative to the current working directory of the running process). The default path can be overwritten by specifying a custom one via the environment variable `DITTO_TEXT_DIR`.
|
|
241
|
+
|
|
242
|
+
### Authentication
|
|
243
|
+
|
|
244
|
+
By default, your API key is saved to `$HOME/.config/ditto`; the default path can be overwritten by specifying a custom one via the environment variable `DITTO_CONFIG_FILE`.
|
|
232
245
|
|
|
233
|
-
|
|
246
|
+
To change your API key, delete this file and you'll be prompted for a new key the next time that the CLI executes.
|
|
234
247
|
|
|
235
248
|
## SDKs
|
|
236
249
|
|
package/babel.config.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const project_1 = require("./init/project");
|
|
7
|
+
const projectsToText_1 = __importDefault(require("./utils/projectsToText"));
|
|
8
|
+
const getSelectedProjects_1 = require("./utils/getSelectedProjects");
|
|
9
|
+
const output_1 = __importDefault(require("./output"));
|
|
10
|
+
function quit(exitCode = 2) {
|
|
11
|
+
console.log("Project selection was not updated.");
|
|
12
|
+
process.exitCode = exitCode;
|
|
13
|
+
process.exit();
|
|
14
|
+
}
|
|
15
|
+
const addProject = async () => {
|
|
16
|
+
const projects = (0, getSelectedProjects_1.getSelectedProjects)();
|
|
17
|
+
const usingComponents = (0, getSelectedProjects_1.getIsUsingComponents)();
|
|
18
|
+
try {
|
|
19
|
+
if (usingComponents) {
|
|
20
|
+
if (projects.length) {
|
|
21
|
+
console.log(`\nYou're currently syncing text from the ${output_1.default.info("Component Library")} and from the following projects: ${(0, projectsToText_1.default)(projects)}`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.log(`\nYou're currently only syncing text from the ${output_1.default.info("Component Library")}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else if (projects.length) {
|
|
28
|
+
console.log(`\nYou're currently set up to sync text from the following projects: ${(0, projectsToText_1.default)(projects)}`);
|
|
29
|
+
}
|
|
30
|
+
await (0, project_1.collectAndSaveProject)(false);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.log(`\nSorry, there was an error adding a project to your workspace: `, error);
|
|
34
|
+
quit();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.default = addProject;
|
|
38
|
+
//# sourceMappingURL=add-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-project.js","sourceRoot":"","sources":["../lib/add-project.ts"],"names":[],"mappings":";;;;;AAAA,4CAAuD;AACvD,4EAAoD;AACpD,qEAGqC;AACrC,sDAA8B;AAE9B,SAAS,IAAI,CAAC,QAAQ,GAAG,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAClD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC5B,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;IAC5B,MAAM,QAAQ,GAAG,IAAA,yCAAmB,GAAE,CAAC;IACvC,MAAM,eAAe,GAAG,IAAA,0CAAoB,GAAE,CAAC;IAE/C,IAAI;QACF,IAAI,eAAe,EAAE;YACnB,IAAI,QAAQ,CAAC,MAAM,EAAE;gBACnB,OAAO,CAAC,GAAG,CACT,4CAA4C,gBAAM,CAAC,IAAI,CACrD,mBAAmB,CACpB,qCAAqC,IAAA,wBAAc,EAAC,QAAQ,CAAC,EAAE,CACjE,CAAC;aACH;iBAAM;gBACL,OAAO,CAAC,GAAG,CACT,iDAAiD,gBAAM,CAAC,IAAI,CAC1D,mBAAmB,CACpB,EAAE,CACJ,CAAC;aACH;SACF;aAAM,IAAI,QAAQ,CAAC,MAAM,EAAE;YAC1B,OAAO,CAAC,GAAG,CACT,uEAAuE,IAAA,wBAAc,EACnF,QAAQ,CACT,EAAE,CACJ,CAAC;SACH;QACD,MAAM,IAAA,+BAAqB,EAAC,KAAK,CAAC,CAAC;KACpC;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CACT,kEAAkE,EAClE,KAAK,CACN,CAAC;QACF,IAAI,EAAE,CAAC;KACR;AACH,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
package/bin/api.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.create = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const config_1 = __importDefault(require("./config"));
|
|
9
|
+
const consts_1 = __importDefault(require("./consts"));
|
|
10
|
+
const create = (token) => {
|
|
11
|
+
return axios_1.default.create({
|
|
12
|
+
baseURL: consts_1.default.API_HOST,
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `token ${token}`,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.create = create;
|
|
19
|
+
exports.default = (0, exports.create)(config_1.default.getToken(consts_1.default.CONFIG_FILE, consts_1.default.API_HOST));
|
|
20
|
+
//# sourceMappingURL=api.js.map
|
package/bin/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../lib/api.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,sDAA8B;AAC9B,sDAA8B;AAEvB,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE;IACvC,OAAO,eAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,gBAAM,CAAC,QAAQ;QACxB,OAAO,EAAE;YACP,aAAa,EAAE,SAAS,KAAK,EAAE;SAChC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAPW,QAAA,MAAM,UAOjB;AAEF,kBAAe,IAAA,cAAM,EAAC,gBAAM,CAAC,QAAQ,CAAC,gBAAM,CAAC,WAAW,EAAE,gBAAM,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
package/bin/config.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const url_1 = __importDefault(require("url"));
|
|
9
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
10
|
+
const consts_1 = __importDefault(require("./consts"));
|
|
11
|
+
function createFileIfMissing(filename) {
|
|
12
|
+
const dir = path_1.default.dirname(filename);
|
|
13
|
+
if (!fs_1.default.existsSync(dir))
|
|
14
|
+
fs_1.default.mkdirSync(dir);
|
|
15
|
+
if (!fs_1.default.existsSync(filename)) {
|
|
16
|
+
fs_1.default.closeSync(fs_1.default.openSync(filename, "w"));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function jsonIsConfigYAML(json) {
|
|
20
|
+
return typeof json === "object";
|
|
21
|
+
}
|
|
22
|
+
function jsonIsGlobalYAML(json) {
|
|
23
|
+
return (!!json &&
|
|
24
|
+
typeof json === "object" &&
|
|
25
|
+
Object.values(json).every((arr) => arr.every((val) => typeof val === "object" && Object.keys(val).includes("token"))));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Read data from a project config file
|
|
29
|
+
* @param {string} file defaults to `PROJECT_CONFIG_FILE` defined in `constants.js`
|
|
30
|
+
* @param {*} defaultData defaults to `{}`
|
|
31
|
+
* @returns { ConfigYAML }
|
|
32
|
+
*/
|
|
33
|
+
function readProjectConfigData(file = consts_1.default.PROJECT_CONFIG_FILE, defaultData = {}) {
|
|
34
|
+
createFileIfMissing(file);
|
|
35
|
+
const fileContents = fs_1.default.readFileSync(file, "utf8");
|
|
36
|
+
const yamlData = js_yaml_1.default.load(fileContents);
|
|
37
|
+
if (jsonIsConfigYAML(yamlData)) {
|
|
38
|
+
return yamlData;
|
|
39
|
+
}
|
|
40
|
+
return defaultData;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Read data from a global config file
|
|
44
|
+
* @param {string} file defaults to `CONFIG_FILE` defined in `constants.js`
|
|
45
|
+
* @param {*} defaultData defaults to `{}`
|
|
46
|
+
* @returns { Record<string, { token: string }[]> }
|
|
47
|
+
*/
|
|
48
|
+
function readGlobalConfigData(file = consts_1.default.CONFIG_FILE, defaultData = {}) {
|
|
49
|
+
createFileIfMissing(file);
|
|
50
|
+
const fileContents = fs_1.default.readFileSync(file, "utf8");
|
|
51
|
+
const yamlData = js_yaml_1.default.load(fileContents);
|
|
52
|
+
if (jsonIsGlobalYAML(yamlData)) {
|
|
53
|
+
return yamlData;
|
|
54
|
+
}
|
|
55
|
+
return defaultData;
|
|
56
|
+
}
|
|
57
|
+
function writeProjectConfigData(file, data) {
|
|
58
|
+
createFileIfMissing(file);
|
|
59
|
+
const existingData = readProjectConfigData(file);
|
|
60
|
+
const yamlStr = js_yaml_1.default.dump({ ...existingData, ...data });
|
|
61
|
+
fs_1.default.writeFileSync(file, yamlStr, "utf8");
|
|
62
|
+
}
|
|
63
|
+
function writeGlobalConfigData(file, data) {
|
|
64
|
+
createFileIfMissing(file);
|
|
65
|
+
const existingData = readGlobalConfigData(file);
|
|
66
|
+
const yamlStr = js_yaml_1.default.dump({ ...existingData, ...data });
|
|
67
|
+
fs_1.default.writeFileSync(file, yamlStr, "utf8");
|
|
68
|
+
}
|
|
69
|
+
function justTheHost(host) {
|
|
70
|
+
if (!host.includes("://"))
|
|
71
|
+
return host;
|
|
72
|
+
return url_1.default.parse(host).hostname || "";
|
|
73
|
+
}
|
|
74
|
+
function deleteToken(file, host) {
|
|
75
|
+
const data = readGlobalConfigData(file);
|
|
76
|
+
const hostParsed = justTheHost(host);
|
|
77
|
+
data[hostParsed] = [];
|
|
78
|
+
data[hostParsed][0] = { token: "" };
|
|
79
|
+
writeGlobalConfigData(file, data);
|
|
80
|
+
}
|
|
81
|
+
function saveToken(file, host, token) {
|
|
82
|
+
const data = readGlobalConfigData(file);
|
|
83
|
+
const hostParsed = justTheHost(host);
|
|
84
|
+
data[hostParsed] = []; // only allow one token per host
|
|
85
|
+
data[hostParsed][0] = { token };
|
|
86
|
+
writeGlobalConfigData(file, data);
|
|
87
|
+
}
|
|
88
|
+
function getTokenFromEnv() {
|
|
89
|
+
return process.env.DITTO_API_KEY;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @param {string} file
|
|
94
|
+
* @param {string} host
|
|
95
|
+
* @returns {Token}
|
|
96
|
+
*/
|
|
97
|
+
function getToken(file, host) {
|
|
98
|
+
const tokenFromEnv = getTokenFromEnv();
|
|
99
|
+
if (tokenFromEnv) {
|
|
100
|
+
return tokenFromEnv;
|
|
101
|
+
}
|
|
102
|
+
const data = readGlobalConfigData(file);
|
|
103
|
+
const hostEntry = data[justTheHost(host)];
|
|
104
|
+
if (!hostEntry)
|
|
105
|
+
return undefined;
|
|
106
|
+
const { length } = hostEntry;
|
|
107
|
+
return hostEntry[length - 1].token;
|
|
108
|
+
}
|
|
109
|
+
const IS_DUPLICATE = /-(\d+$)/;
|
|
110
|
+
function dedupeProjectName(projectNames, projectName) {
|
|
111
|
+
let dedupedName = projectName;
|
|
112
|
+
if (projectNames.has(dedupedName)) {
|
|
113
|
+
while (projectNames.has(dedupedName)) {
|
|
114
|
+
const [_, numberStr] = dedupedName.match(IS_DUPLICATE) || [];
|
|
115
|
+
if (numberStr && !isNaN(parseInt(numberStr))) {
|
|
116
|
+
dedupedName = `${dedupedName.replace(IS_DUPLICATE, "")}-${parseInt(numberStr) + 1}`;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
dedupedName = `${dedupedName}-1`;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return dedupedName;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Reads from the config file, filters out
|
|
127
|
+
* invalid projects, dedupes those remaining, and returns:
|
|
128
|
+
* - whether or not the data required to `pull` is present
|
|
129
|
+
* - whether or not the component library should be fetched
|
|
130
|
+
* - an array of valid, deduped projects
|
|
131
|
+
* - the `variants` and `format` config options
|
|
132
|
+
*/
|
|
133
|
+
function parseSourceInformation() {
|
|
134
|
+
const { projects, components, variants, format } = readProjectConfigData();
|
|
135
|
+
const projectNames = new Set();
|
|
136
|
+
const validProjects = [];
|
|
137
|
+
let componentLibraryInProjects = false;
|
|
138
|
+
(projects || []).forEach((project) => {
|
|
139
|
+
const isValid = project.id && project.name;
|
|
140
|
+
if (!isValid) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (project.id === "ditto_component_library") {
|
|
144
|
+
componentLibraryInProjects = true;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
project.fileName = dedupeProjectName(projectNames, project.name);
|
|
148
|
+
projectNames.add(project.fileName);
|
|
149
|
+
validProjects.push(project);
|
|
150
|
+
});
|
|
151
|
+
const shouldFetchComponentLibrary = !!components || componentLibraryInProjects;
|
|
152
|
+
const hasSourceData = !!validProjects.length || shouldFetchComponentLibrary;
|
|
153
|
+
return {
|
|
154
|
+
hasSourceData,
|
|
155
|
+
validProjects,
|
|
156
|
+
shouldFetchComponentLibrary,
|
|
157
|
+
variants: variants || false,
|
|
158
|
+
format,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
exports.default = {
|
|
162
|
+
createFileIfMissing,
|
|
163
|
+
readProjectConfigData,
|
|
164
|
+
readGlobalConfigData,
|
|
165
|
+
writeGlobalConfigData,
|
|
166
|
+
writeProjectConfigData,
|
|
167
|
+
justTheHost,
|
|
168
|
+
saveToken,
|
|
169
|
+
deleteToken,
|
|
170
|
+
getToken,
|
|
171
|
+
getTokenFromEnv,
|
|
172
|
+
parseSourceInformation,
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../lib/config.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,8CAAsB;AACtB,sDAA2B;AAE3B,sDAA8B;AAG9B,SAAS,mBAAmB,CAAC,QAAgB;IAC3C,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,YAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAE3C,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,YAAE,CAAC,SAAS,CAAC,YAAE,CAAC,Q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B,CAAC;IAE7C,MAAM,aAAa,GAAG,CAAC,CAAC,aAAa,CAAC,MAAM,IAAI,2BAA2B,CAAC;IAE5E,OAAO;QACL,aAAa;QACb,aAAa;QACb,2BAA2B;QAC3B,QAAQ,EAAE,QAAQ,IAAI,KAAK;QAC3B,MAAM;KACP,CAAC;AACJ,CAAC;AAED,kBAAe;IACb,mBAAmB;IACnB,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,WAAW;IACX,SAAS;IACT,WAAW;IACX,QAAQ;IACR,eAAe;IACf,sBAAsB;CACvB,CAAC"}
|
package/bin/consts.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TEXT_FILE = exports.TEXT_DIR = exports.PROJECT_CONFIG_FILE = exports.CONFIG_FILE = exports.API_HOST = void 0;
|
|
7
|
+
const os_1 = require("os");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
exports.API_HOST = process.env.DITTO_API_HOST || "https://api.dittowords.com";
|
|
10
|
+
exports.CONFIG_FILE = process.env.DITTO_CONFIG_FILE || path_1.default.join((0, os_1.homedir)(), ".config", "ditto");
|
|
11
|
+
exports.PROJECT_CONFIG_FILE = path_1.default.normalize(path_1.default.join("ditto", "config.yml"));
|
|
12
|
+
exports.TEXT_DIR = process.env.DITTO_TEXT_DIR || "ditto";
|
|
13
|
+
exports.TEXT_FILE = path_1.default.normalize(path_1.default.join(exports.TEXT_DIR, "text.json"));
|
|
14
|
+
exports.default = {
|
|
15
|
+
API_HOST: exports.API_HOST,
|
|
16
|
+
CONFIG_FILE: exports.CONFIG_FILE,
|
|
17
|
+
PROJECT_CONFIG_FILE: exports.PROJECT_CONFIG_FILE,
|
|
18
|
+
TEXT_DIR: exports.TEXT_DIR,
|
|
19
|
+
TEXT_FILE: exports.TEXT_FILE,
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../lib/consts.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA6B;AAC7B,gDAAwB;AAEX,QAAA,QAAQ,GACnB,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,4BAA4B,CAAC;AAChD,QAAA,WAAW,GACtB,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,cAAI,CAAC,IAAI,CAAC,IAAA,YAAO,GAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC/D,QAAA,mBAAmB,GAAG,cAAI,CAAC,SAAS,CAC/C,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CACjC,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC;AACjD,QAAA,SAAS,GAAG,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,gBAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAE1E,kBAAe;IACb,QAAQ,EAAR,gBAAQ;IACR,WAAW,EAAX,mBAAW;IACX,mBAAmB,EAAnB,2BAAmB;IACnB,QAAQ,EAAR,gBAAQ;IACR,SAAS,EAAT,iBAAS;CACV,CAAC"}
|