create-manifest 1.1.11 → 1.2.0

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.
@@ -1,4 +1,4 @@
1
- # This is a sample file for a backend.yml manifest backend.
1
+ # This is a sample file for a manifest.yml manifest backend.
2
2
  # Read more about the manifest format here: https:/manifest.build/docs
3
3
 
4
4
  name: My pet app 🐾
@@ -7,6 +7,9 @@ entities:
7
7
  properties:
8
8
  - name
9
9
  - { name: birthdate, type: date }
10
+ policies:
11
+ read:
12
+ - access: public
10
13
 
11
14
  Cat:
12
15
  properties:
@@ -28,7 +28,7 @@ export default class CreateManifest extends Command {
28
28
  };
29
29
  static flags = {
30
30
  backendFile: Flags.string({
31
- summary: 'The remote file to use as a template for the backend.yml file. If not provided, the default file will be used.'
31
+ summary: 'The remote file to use as a template for the manifest.yml file. If not provided, the default file will be used.'
32
32
  }),
33
33
  cursor: Flags.boolean(),
34
34
  copilot: Flags.boolean(),
@@ -82,18 +82,17 @@ export default class CreateManifest extends Command {
82
82
  process.exit(1);
83
83
  }
84
84
  fs.mkdirSync(projectFolderPath);
85
- const manifestFolderName = 'manifest';
86
- const initialFileName = 'backend.yml';
85
+ const manifestFolderName = '.manifest';
86
+ const initialFileName = 'manifest.yml';
87
87
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
88
88
  const assetFolderPath = path.join(__dirname, '..', '..', 'assets');
89
- // * 2. Create a folder with the name `manifest`.
89
+ // * 2. Create a folder with the name `.manifest` for compiled files.
90
90
  // Construct the folder path. This example creates the folder in the current working directory.
91
91
  const manifestFolderPath = path.join(projectFolderPath, manifestFolderName);
92
92
  // Create the folder
93
93
  fs.mkdirSync(manifestFolderPath);
94
- // * 3. Create a file inside the folder with the name `manifest.yml`.
95
- // Path where the new file should be created
96
- const newFilePath = path.join(manifestFolderPath, initialFileName);
94
+ // * 3. Create a file with the name `manifest.yml`.
95
+ const newFilePath = path.join(projectFolderPath, initialFileName);
97
96
  // Get the content of the file either remote or local.
98
97
  const { flags } = await this.parse(CreateManifest);
99
98
  const remoteBackendFile = flags.backendFile;
@@ -101,7 +100,7 @@ export default class CreateManifest extends Command {
101
100
  // Write the content to the new file
102
101
  fs.writeFileSync(newFilePath, content);
103
102
  spinner.succeed();
104
- spinner.start('Update package.json file...');
103
+ spinner.start('Updating package.json file...');
105
104
  // Update package.json file.
106
105
  const packagePath = path.join(projectFolderPath, 'package.json');
107
106
  let packageJson;
@@ -120,12 +119,12 @@ export default class CreateManifest extends Command {
120
119
  manifest: `^${manifestLatestVersion}`
121
120
  },
122
121
  newScripts: {
123
- manifest: 'node node_modules/manifest/scripts/watch/watch.js',
124
- 'manifest:seed': 'node node_modules/manifest/dist/manifest/src/seed/scripts/seed.js'
122
+ start: 'node node_modules/manifest/scripts/watch/watch.js',
123
+ seed: 'node node_modules/manifest/dist/manifest/src/seed/scripts/seed.js'
125
124
  }
126
125
  }));
127
126
  spinner.succeed();
128
- spinner.start('Add settings...');
127
+ spinner.start('Adding settings...');
129
128
  // Update .vscode/extensions.json file.
130
129
  const vscodeDirPath = path.join(projectFolderPath, '.vscode');
131
130
  const extensionsFilePath = path.join(vscodeDirPath, 'extensions.json');
@@ -173,7 +172,7 @@ export default class CreateManifest extends Command {
173
172
  'node_modules',
174
173
  '.env',
175
174
  'public',
176
- 'manifest/backend.db'
175
+ 'manifest/backend.db' // TODO: Adapt to new folder structure.
177
176
  ];
178
177
  newGitignoreLines.forEach((line) => {
179
178
  if (!gitignoreContent.includes(line)) {
@@ -190,7 +189,7 @@ export default class CreateManifest extends Command {
190
189
  // * 10. Add optional files based on flags
191
190
  // Add rules for IDEs.
192
191
  if (flags.cursor) {
193
- spinner.start('Add rules for Cursor IDE...');
192
+ spinner.start('Adding rules for Cursor IDE...');
194
193
  const cursorFolderPath = path.join(projectFolderPath, '.cursor', 'rules');
195
194
  const cursorFileName = 'manifest.mdc';
196
195
  fs.mkdirSync(cursorFolderPath, { recursive: true });
@@ -211,7 +210,7 @@ export default class CreateManifest extends Command {
211
210
  spinner.succeed();
212
211
  }
213
212
  if (flags.copilot) {
214
- spinner.start('Add rules for Copilot IDE...');
213
+ spinner.start('Adding rules for Copilot IDE...');
215
214
  const copilotFolderPath = path.join(projectFolderPath, '.github');
216
215
  const copilotFileName = 'copilot-instructions.md';
217
216
  fs.mkdirSync(copilotFolderPath, { recursive: true });
@@ -232,7 +231,7 @@ export default class CreateManifest extends Command {
232
231
  spinner.succeed();
233
232
  }
234
233
  if (flags.windsurf) {
235
- spinner.start('Add rules for WindSurf IDE...');
234
+ spinner.start('Adding rules for WindSurf IDE...');
236
235
  const windsurfFolderPath = path.join(projectFolderPath, '.windsurf', 'rules');
237
236
  const windsurfFileName = 'manifest.md';
238
237
  fs.mkdirSync(windsurfFolderPath, { recursive: true });
@@ -253,7 +252,7 @@ export default class CreateManifest extends Command {
253
252
  spinner.succeed();
254
253
  }
255
254
  // * 9. Install the new packages.
256
- spinner.start('Install dependencies...');
255
+ spinner.start('Installing dependencies...');
257
256
  // Install deps.
258
257
  try {
259
258
  await exec(`cd ${projectName} && npm install --silent`);
@@ -263,7 +262,7 @@ export default class CreateManifest extends Command {
263
262
  }
264
263
  // Serve the new app.
265
264
  spinner.succeed();
266
- spinner.start('Add environment variables...');
265
+ spinner.start('Adding environment variables...');
267
266
  // Add environment variables to .env file
268
267
  const envFilePath = path.join(projectFolderPath, '.env');
269
268
  const envJWTSecret = `TOKEN_SECRET_KEY=${crypto
@@ -279,7 +278,7 @@ export default class CreateManifest extends Command {
279
278
  }
280
279
  fs.writeFileSync(envFilePath, envContent);
281
280
  spinner.succeed();
282
- spinner.start('Build the database...');
281
+ spinner.start('Building the database...');
283
282
  let serveTask = null;
284
283
  try {
285
284
  // We run the manifest script to build the database.
@@ -290,7 +289,7 @@ export default class CreateManifest extends Command {
290
289
  catch (error) {
291
290
  spinner.fail(`Execution error: ${error}`);
292
291
  }
293
- spinner.start('Seed initial data...');
292
+ spinner.start('Seeding initial data...');
294
293
  try {
295
294
  await exec(`cd ${projectName} && npm run manifest:seed`);
296
295
  }
@@ -12,7 +12,7 @@
12
12
  "flags": {
13
13
  "backendFile": {
14
14
  "name": "backendFile",
15
- "summary": "The remote file to use as a template for the backend.yml file. If not provided, the default file will be used.",
15
+ "summary": "The remote file to use as a template for the manifest.yml file. If not provided, the default file will be used.",
16
16
  "hasDynamicHelp": false,
17
17
  "multiple": false,
18
18
  "type": "option"
@@ -43,5 +43,5 @@
43
43
  "enableJsonFlag": false
44
44
  }
45
45
  },
46
- "version": "1.1.11"
46
+ "version": "1.2.0"
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-manifest",
3
- "version": "1.1.11",
3
+ "version": "1.2.0",
4
4
  "author": "Manifest",
5
5
  "description": "Create a new Manifest backend",
6
6
  "homepage": "https://manifest.build",