@stackbit/sdk
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -11,2 +11,4 @@ import Joi from 'joi'; | ||
contentFile: string; | ||
uploadAssets?: boolean; | ||
assetsDirectory?: string; | ||
spaceIdEnvVar?: string; | ||
@@ -13,0 +15,0 @@ accessTokenEnvVar?: string; |
@@ -80,5 +80,7 @@ "use strict"; | ||
contentFile: joi_1.default.string().required(), | ||
uploadAssets: joi_1.default.boolean(), | ||
assetsDirectory: joi_1.default.string(), | ||
spaceIdEnvVar: joi_1.default.string(), | ||
accessTokenEnvVar: joi_1.default.string() | ||
}); | ||
}).and('uploadAssets', 'assetsDirectory'); | ||
const sanityImportSchema = joi_1.default.object({ | ||
@@ -85,0 +87,0 @@ type: joi_1.default.string().valid('sanity').required(), |
@@ -11,6 +11,10 @@ "use strict"; | ||
const lodash_1 = __importDefault(require("lodash")); | ||
const packageJson = require('../../package.json'); | ||
async function writeConfig({ dirPath, config }) { | ||
const yamlConfig = convertToYamlConfig({ config }); | ||
const filePath = path_1.default.join(dirPath, 'stackbit.yaml'); | ||
await fs_extra_1.default.outputFile(filePath, js_yaml_1.default.dump(yamlConfig)); | ||
const yamlString = js_yaml_1.default.dump(yamlConfig); | ||
const info = `# This file was generated by @stackbit/sdk v${packageJson.version}\n# To learn more about stackbit.yaml please visit https://www.stackbit.com/docs/stackbit-yaml/\n`; | ||
const data = info + yamlString; | ||
await fs_extra_1.default.outputFile(filePath, data); | ||
} | ||
@@ -17,0 +21,0 @@ exports.writeConfig = writeConfig; |
{ | ||
"name": "@stackbit/sdk", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "Stackbit SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -90,2 +90,4 @@ import Joi from 'joi'; | ||
contentFile: string; | ||
uploadAssets?: boolean; | ||
assetsDirectory?: string; | ||
spaceIdEnvVar?: string; | ||
@@ -98,5 +100,7 @@ accessTokenEnvVar?: string; | ||
contentFile: Joi.string().required(), | ||
uploadAssets: Joi.boolean(), | ||
assetsDirectory: Joi.string(), | ||
spaceIdEnvVar: Joi.string(), | ||
accessTokenEnvVar: Joi.string() | ||
}); | ||
}).and('uploadAssets', 'assetsDirectory'); | ||
@@ -103,0 +107,0 @@ export interface SanityImport { |
@@ -8,2 +8,3 @@ import path from 'path'; | ||
import { YamlConfig, YamlModel, YamlModels } from './config-schema'; | ||
const packageJson = require('../../package.json'); | ||
@@ -18,3 +19,6 @@ export interface WriteConfigOptions { | ||
const filePath = path.join(dirPath, 'stackbit.yaml'); | ||
await fse.outputFile(filePath, yaml.dump(yamlConfig)); | ||
const yamlString = yaml.dump(yamlConfig); | ||
const info = `# This file was generated by @stackbit/sdk v${packageJson.version}\n# To learn more about stackbit.yaml please visit https://www.stackbit.com/docs/stackbit-yaml/\n`; | ||
const data = info + yamlString; | ||
await fse.outputFile(filePath, data); | ||
} | ||
@@ -21,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
429220
7778