Socket
Socket
Sign inDemoInstall

@faststore/cli

Package Overview
Dependencies
143
Maintainers
10
Versions
113
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.91-alpha.0 to 2.0.104-alpha.0

32

dist/utils/generate.js

@@ -77,20 +77,28 @@ "use strict";

function mergeCMSFile(fileName) {
const customFilePath = `${directory_1.userCMSDir}/${fileName}`;
const coreFilePath = `${directory_1.coreCMSDir}/${fileName}`;
const coreFile = (0, fs_extra_1.readFileSync)(coreFilePath, 'utf8');
const output = [...JSON.parse(coreFile)];
// TODO: create a validation when has the cms files but doesn't have a component for then
if ((0, fs_extra_1.existsSync)(directory_1.userCMSDir) && (0, fs_extra_1.readdirSync)(directory_1.userCMSDir).length > 0) {
const coreContentTypes = (0, fs_extra_1.readFileSync)(`${directory_1.coreCMSDir}/${fileName}`, 'utf8');
const customContentTypes = (0, fs_extra_1.readFileSync)(`${directory_1.userCMSDir}/${fileName}`, 'utf8');
const coreContentTypesJSON = JSON.parse(coreContentTypes);
const customContentTypesJSON = JSON.parse(customContentTypes);
const mergeContentTypes = [
...coreContentTypesJSON,
...customContentTypesJSON,
];
if ((0, fs_extra_1.existsSync)(customFilePath)) {
const customFile = (0, fs_extra_1.readFileSync)(customFilePath, 'utf8');
try {
(0, fs_extra_1.writeFileSync)(`${directory_1.tmpCMSDir}/${fileName}`, JSON.stringify(mergeContentTypes));
console.log(`${chalk_1.default.green('success')} - CMS file ${chalk_1.default.dim(fileName)} created`);
output.push(...JSON.parse(customFile));
}
catch (err) {
console.error(`${chalk_1.default.red('error')} - ${err}`);
if (err instanceof SyntaxError) {
console.info(`${chalk_1.default.red('error')} - ${fileName} is a malformed JSON file, ignoring its contents.`);
}
else {
throw err;
}
}
}
try {
(0, fs_extra_1.writeFileSync)(`${directory_1.tmpCMSDir}/${fileName}`, JSON.stringify(output));
console.log(`${chalk_1.default.green('success')} - CMS file ${chalk_1.default.dim(fileName)} created`);
}
catch (err) {
console.error(`${chalk_1.default.red('error')} - ${err}`);
}
}

@@ -97,0 +105,0 @@ function generateStoreConfigFile(content) {

{
"name": "@faststore/cli",
"version": "2.0.91-alpha.0",
"version": "2.0.104-alpha.0",
"description": "FastStore CLI",

@@ -31,4 +31,4 @@ "author": "Emerson Laurentino @emersonlaurentino",

"devDependencies": {
"@faststore/eslint-config": "^2.0.91-alpha.0",
"@faststore/shared": "^2.0.91-alpha.0",
"@faststore/eslint-config": "^2.0.104-alpha.0",
"@faststore/shared": "^2.0.104-alpha.0",
"@types/chai": "^4",

@@ -73,3 +73,3 @@ "@types/fs-extra": "^9.0.13",

"types": "dist/index.d.ts",
"gitHead": "837e0d4445c0366c8f99750eed611091e5d68933"
"gitHead": "0db7f06c36c7c41ecec51f247b21866469977618"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc