storyblok 3.29.0 → 3.29.1
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/cli.mjs +6 -3
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -23,6 +23,8 @@ import fs$1 from 'fs-extra';
|
|
|
23
23
|
import csvReader from 'fast-csv';
|
|
24
24
|
import xmlConverter from 'xml-js';
|
|
25
25
|
import { compile } from 'json-schema-to-typescript';
|
|
26
|
+
import { dirname } from 'node:path';
|
|
27
|
+
import { fileURLToPath } from 'node:url';
|
|
26
28
|
|
|
27
29
|
const getOptions = (subCommand, argv = {}, api = {}) => {
|
|
28
30
|
let email = "";
|
|
@@ -3461,7 +3463,8 @@ const tasks = {
|
|
|
3461
3463
|
generateTypescriptTypedefs
|
|
3462
3464
|
};
|
|
3463
3465
|
|
|
3464
|
-
const
|
|
3466
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
3467
|
+
const rawPkg = fs.readFileSync(path.join(__dirname, "../package.json"));
|
|
3465
3468
|
const pkg = JSON.parse(rawPkg);
|
|
3466
3469
|
const program = new commander.Command();
|
|
3467
3470
|
const allRegionsText = ALL_REGIONS.join(", ");
|
|
@@ -3547,7 +3550,7 @@ program.command("pull-languages").description("Download your space's languages s
|
|
|
3547
3550
|
program.command(COMMANDS.PULL_COMPONENTS).option("--sf, --separate-files [value]", "Argument to create a single file for each component").option("-p, --path <path>", "Path to save the component files").option("-f, --file-name <fileName>", "custom name to be used in file(s) name instead of space id").description("Download your space's components schema as json").action(async (options) => {
|
|
3548
3551
|
console.log(`${chalk.blue("-")} Executing pull-components task`);
|
|
3549
3552
|
const space = program.space;
|
|
3550
|
-
const { separateFiles, path } = options;
|
|
3553
|
+
const { separateFiles, path: path2 } = options;
|
|
3551
3554
|
if (!space) {
|
|
3552
3555
|
console.log(chalk.red("X") + " Please provide the space as argument --space YOUR_SPACE_ID.");
|
|
3553
3556
|
process.exit(0);
|
|
@@ -3558,7 +3561,7 @@ program.command(COMMANDS.PULL_COMPONENTS).option("--sf, --separate-files [value]
|
|
|
3558
3561
|
await api.processLogin();
|
|
3559
3562
|
}
|
|
3560
3563
|
api.setSpaceId(space);
|
|
3561
|
-
await tasks.pullComponents(api, { fileName, separateFiles, path });
|
|
3564
|
+
await tasks.pullComponents(api, { fileName, separateFiles, path: path2 });
|
|
3562
3565
|
} catch (e) {
|
|
3563
3566
|
errorHandler(e, COMMANDS.PULL_COMPONENTS);
|
|
3564
3567
|
}
|