@plasmicapp/cli 0.1.341 → 0.1.342
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/actions/sync-project-module.d.ts +5 -0
- package/dist/actions/sync-style-tokens-provider.d.ts +5 -0
- package/dist/api.d.ts +12 -0
- package/dist/index.js +1655 -1388
- package/dist/lib.js +1656 -1389
- package/dist/plasmic.schema.json +10 -0
- package/dist/utils/config-utils.d.ts +5 -1
- package/package.json +2 -2
- package/src/__mocks__/api.ts +2 -0
- package/src/actions/export.ts +40 -1
- package/src/actions/sync-project-module.ts +88 -0
- package/src/actions/sync-style-tokens-provider.ts +96 -0
- package/src/actions/sync.ts +20 -0
- package/src/api.ts +16 -0
- package/src/test-common/fixtures.ts +2 -0
- package/src/utils/checksum.ts +37 -0
- package/src/utils/code-utils.ts +73 -6
- package/src/utils/config-utils.ts +11 -1
- package/src/utils/get-context.ts +28 -0
package/src/utils/get-context.ts
CHANGED
|
@@ -101,6 +101,10 @@ function removeMissingFilesFromLock(
|
|
|
101
101
|
return knownProjects[project.projectId].globalContextsFilePath;
|
|
102
102
|
case "splitsProvider":
|
|
103
103
|
return knownProjects[project.projectId].splitsProviderFilePath;
|
|
104
|
+
case "projectModule":
|
|
105
|
+
return knownProjects[project.projectId].projectModuleFilePath;
|
|
106
|
+
case "styleTokensProvider":
|
|
107
|
+
return knownProjects[project.projectId].styleTokensProviderFilePath;
|
|
104
108
|
}
|
|
105
109
|
});
|
|
106
110
|
|
|
@@ -243,6 +247,30 @@ async function resolveMissingFilesInConfig(
|
|
|
243
247
|
baseNameToFiles
|
|
244
248
|
)) || project.splitsProviderFilePath;
|
|
245
249
|
|
|
250
|
+
if (!project.styleTokensProviderFilePath) {
|
|
251
|
+
project.styleTokensProviderFilePath = "";
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Try to find the file, otherwise recreate at either the specified path or default path (if both are falsey)
|
|
255
|
+
project.styleTokensProviderFilePath =
|
|
256
|
+
(await attemptToRestoreFilePath(
|
|
257
|
+
context,
|
|
258
|
+
project.styleTokensProviderFilePath,
|
|
259
|
+
baseNameToFiles
|
|
260
|
+
)) || project.styleTokensProviderFilePath;
|
|
261
|
+
|
|
262
|
+
if (!project.projectModuleFilePath) {
|
|
263
|
+
project.projectModuleFilePath = "";
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Try to find the file, otherwise recreate at either the specified path or default path (if both are falsey)
|
|
267
|
+
project.projectModuleFilePath =
|
|
268
|
+
(await attemptToRestoreFilePath(
|
|
269
|
+
context,
|
|
270
|
+
project.projectModuleFilePath,
|
|
271
|
+
baseNameToFiles
|
|
272
|
+
)) || project.projectModuleFilePath;
|
|
273
|
+
|
|
246
274
|
project.images = await filterFiles(project.images, "filePath");
|
|
247
275
|
project.icons = await filterFiles(project.icons, "moduleFilePath");
|
|
248
276
|
|