@pulse-editor/cli 0.1.1-beta.0 → 0.1.1-beta.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.
|
@@ -93,13 +93,17 @@ export default function Create({ cli }) {
|
|
|
93
93
|
}
|
|
94
94
|
// Modify the package.json file to update the name
|
|
95
95
|
setCreateMessage(_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Initializing project..." })] }));
|
|
96
|
+
/* Setup pulse.config.ts */
|
|
97
|
+
const pulseConfigPath = path.join(process.cwd(), name, 'pulse.config.ts');
|
|
98
|
+
let pulseConfig = fs.readFileSync(pulseConfigPath, 'utf8');
|
|
99
|
+
// Modify visibility by matching the block that starts with 'visibility:',
|
|
100
|
+
// and replacing the entire line with the new visibility value.
|
|
101
|
+
pulseConfig = pulseConfig.replace(/visibility:\s*['"`](public|unlisted|private)['"`],?/, `visibility: '${visibility}',`);
|
|
102
|
+
fs.writeFileSync(pulseConfigPath, pulseConfig);
|
|
103
|
+
/* Setup packages.json */
|
|
96
104
|
const packageJsonPath = path.join(process.cwd(), name, 'package.json');
|
|
97
105
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
98
106
|
packageJson.name = name.replaceAll('-', '_');
|
|
99
|
-
// Modify the visibility
|
|
100
|
-
packageJson['pulse-editor-marketplace'] = {
|
|
101
|
-
visibility,
|
|
102
|
-
};
|
|
103
107
|
// Write the modified package.json back to the file
|
|
104
108
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
105
109
|
// Remove the .git directory
|