@pulse-editor/cli 0.1.0-beta.8 → 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
@@ -87,8 +87,8 @@ export default function Publish({ cli }) {
87
87
  formData.append('visibility', visibility);
88
88
  // Send the file to the server
89
89
  const res = await fetch(cli.flags.dev
90
- ? 'https://localhost:8080/api/extension/publish'
91
- : 'https://pulse-editor.com/api/extension/publish', {
90
+ ? 'https://localhost:8080/api/app/publish'
91
+ : 'https://pulse-editor.com/api/app/publish', {
92
92
  method: 'POST',
93
93
  headers: {
94
94
  Authorization: `Bearer ${getToken(cli.flags.dev)}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulse-editor/cli",
3
- "version": "0.1.0-beta.8",
3
+ "version": "0.1.1-beta.1",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "pulse": "dist/cli.js"