@adonisjs/inertia 4.1.1 → 4.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 +1 @@
1
- {"commands":[{"commandName":"make:page","description":"Create a new Inertia page component","help":"","namespace":"make","aliases":[],"flags":[{"name":"vue","flagName":"vue","required":false,"type":"boolean","description":"Create a Vue page component"},{"name":"react","flagName":"react","required":false,"type":"boolean","description":"Create a React page component"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the page component","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make_page.js"}],"version":1}
1
+ {"commands":[{"commandName":"make:page","description":"Create a new Inertia page component","help":"","namespace":"make","aliases":[],"flags":[{"name":"vue","flagName":"vue","required":false,"type":"boolean","description":"Create a Vue page component"},{"name":"react","flagName":"react","required":false,"type":"boolean","description":"Create a React page component"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the page component","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make_page.js"}],"version":1}
@@ -8,6 +8,15 @@ export default class MakePage extends BaseCommand {
8
8
  name: string;
9
9
  vue: boolean;
10
10
  react: boolean;
11
+ /**
12
+ * Read the contents from this file (if the flag exists) and use
13
+ * it as the raw contents
14
+ */
15
+ contentsFrom: string;
16
+ /**
17
+ * Forcefully overwrite existing files
18
+ */
19
+ force: boolean;
11
20
  /**
12
21
  * Directory under which the inertia pages are stored
13
22
  */
@@ -34,14 +34,21 @@ var MakePage = class extends BaseCommand {
34
34
  }
35
35
  async run() {
36
36
  const framework = await this.#resolveFramework();
37
- await (await this.createCodemods()).makeUsingStub(stubsRoot, `make/page/${framework}.stub`, {
37
+ const codemods = await this.createCodemods();
38
+ codemods.overwriteExisting = this.force === true;
39
+ await codemods.makeUsingStub(stubsRoot, `make/page/${framework}.stub`, {
38
40
  flags: this.parsed.flags,
39
41
  pagesDir: this.pagesDir,
40
42
  entity: this.app.generators.createEntity(this.name)
41
- });
43
+ }, { contentsFromFile: this.contentsFrom });
42
44
  }
43
45
  };
44
46
  __decorate([args.string({ description: "Name of the page component" })], MakePage.prototype, "name", void 0);
45
47
  __decorate([flags.boolean({ description: "Create a Vue page component" })], MakePage.prototype, "vue", void 0);
46
48
  __decorate([flags.boolean({ description: "Create a React page component" })], MakePage.prototype, "react", void 0);
49
+ __decorate([flags.string({ description: "Use the contents of the given file as the generated output" })], MakePage.prototype, "contentsFrom", void 0);
50
+ __decorate([flags.boolean({
51
+ description: "Forcefully overwrite existing files",
52
+ alias: "f"
53
+ })], MakePage.prototype, "force", void 0);
47
54
  export { MakePage as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/inertia",
3
3
  "description": "Official Inertia.js adapter for AdonisJS",
4
- "version": "4.1.1",
4
+ "version": "4.2.0",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },