@adonisjs/inertia 4.1.0 → 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.
- package/build/commands/commands.json +1 -1
- package/build/commands/make_page.d.ts +9 -0
- package/build/commands/make_page.js +9 -2
- package/build/factories/main.js +1 -1
- package/build/index.js +1 -1
- package/build/{inertia_manager-Ra2dhBKa.js → inertia_manager-BGHA4cDP.js} +9 -1
- package/build/providers/inertia_provider.js +1 -1
- package/build/src/inertia_middleware.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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/build/factories/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ServerRenderer, r as Inertia } from "../inertia_manager-
|
|
1
|
+
import { n as ServerRenderer, r as Inertia } from "../inertia_manager-BGHA4cDP.js";
|
|
2
2
|
import { t as InertiaHeaders } from "../headers-DafWEpBh.js";
|
|
3
3
|
import "../debug-CBMTuPUm.js";
|
|
4
4
|
import { t as defineConfig } from "../define_config-Du2hAFGX.js";
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as symbols_exports, n as ServerRenderer, r as Inertia, t as InertiaManager } from "./inertia_manager-
|
|
1
|
+
import { i as symbols_exports, n as ServerRenderer, r as Inertia, t as InertiaManager } from "./inertia_manager-BGHA4cDP.js";
|
|
2
2
|
import { t as InertiaHeaders } from "./headers-DafWEpBh.js";
|
|
3
3
|
import "./debug-CBMTuPUm.js";
|
|
4
4
|
import { n as indexPages, t as defineConfig } from "./define_config-Du2hAFGX.js";
|
|
@@ -369,6 +369,7 @@ var Inertia = class {
|
|
|
369
369
|
};
|
|
370
370
|
var ServerRenderer = class {
|
|
371
371
|
#runtime;
|
|
372
|
+
#ssrEnvironment;
|
|
372
373
|
#config;
|
|
373
374
|
#vite;
|
|
374
375
|
constructor(config, vite) {
|
|
@@ -377,8 +378,15 @@ var ServerRenderer = class {
|
|
|
377
378
|
}
|
|
378
379
|
async render(pageObject) {
|
|
379
380
|
let render;
|
|
380
|
-
|
|
381
|
+
const devServer = this.#vite.getDevServer();
|
|
382
|
+
if (devServer) {
|
|
381
383
|
debug_default("creating SSR bundle using dev-server");
|
|
384
|
+
const currentSsrEnv = devServer.environments.ssr;
|
|
385
|
+
if (this.#ssrEnvironment !== currentSsrEnv) {
|
|
386
|
+
if (this.#runtime) await this.#runtime.close();
|
|
387
|
+
this.#runtime = void 0;
|
|
388
|
+
this.#ssrEnvironment = currentSsrEnv;
|
|
389
|
+
}
|
|
382
390
|
this.#runtime ??= await this.#vite.createModuleRunner();
|
|
383
391
|
this.#runtime.clearCache();
|
|
384
392
|
render = await this.#runtime.import(this.#config.ssr.entrypoint);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as InertiaManager } from "../inertia_manager-
|
|
1
|
+
import { t as InertiaManager } from "../inertia_manager-BGHA4cDP.js";
|
|
2
2
|
import { t as InertiaHeaders } from "../headers-DafWEpBh.js";
|
|
3
3
|
import { t as debug_default } from "../debug-CBMTuPUm.js";
|
|
4
4
|
const MUTATION_METHODS = [
|