@batijs/cli 0.0.212 → 0.0.214
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/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +114 -0
- package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +24 -0
- package/dist/boilerplates/@batijs/cloudflare/files/wrangler.toml +4 -0
- package/dist/boilerplates/@batijs/hono/files/hono-entry.node.ts +1 -1
- package/dist/boilerplates/@batijs/prettier/files/.prettierignore +3 -0
- package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+Page.vue +1 -1
- package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+data.ts +1 -1
- package/dist/boilerplates/@batijs/vue/files/pages/star-wars/index/+title.ts +1 -1
- package/dist/boilerplates/@batijs/vue/types/pages/star-wars/index/+data.d.ts +3 -1
- package/dist/boilerplates/boilerplates.json +11 -0
- package/dist/index.js +10 -6
- package/package.json +6 -6
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// package.json
|
|
28
|
+
var require_package = __commonJS({
|
|
29
|
+
"package.json"(exports, module) {
|
|
30
|
+
module.exports = {
|
|
31
|
+
name: "@batijs/cloudflare",
|
|
32
|
+
private: true,
|
|
33
|
+
version: "0.0.1",
|
|
34
|
+
description: "",
|
|
35
|
+
type: "module",
|
|
36
|
+
scripts: {
|
|
37
|
+
"check-types": "tsc --noEmit",
|
|
38
|
+
build: "bati-compile-boilerplate"
|
|
39
|
+
},
|
|
40
|
+
keywords: [],
|
|
41
|
+
author: "",
|
|
42
|
+
license: "MIT",
|
|
43
|
+
devDependencies: {
|
|
44
|
+
"@batijs/compile": "workspace:*",
|
|
45
|
+
"@types/node": "^18.19.14",
|
|
46
|
+
"@hattip/adapter-cloudflare-workers": "^0.0.46",
|
|
47
|
+
"npm-run-all2": "^6.2.0",
|
|
48
|
+
"vike-cloudflare": "^0.0.4",
|
|
49
|
+
wrangler: "^3.62.0"
|
|
50
|
+
},
|
|
51
|
+
dependencies: {
|
|
52
|
+
"@batijs/core": "workspace:*"
|
|
53
|
+
},
|
|
54
|
+
files: [
|
|
55
|
+
"dist/"
|
|
56
|
+
],
|
|
57
|
+
bati: {
|
|
58
|
+
if: {
|
|
59
|
+
flag: "cloudflare"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
exports: {
|
|
63
|
+
"./test": {
|
|
64
|
+
types: "./dist/types/test.d.ts"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
typesVersions: {
|
|
68
|
+
"*": {
|
|
69
|
+
test: [
|
|
70
|
+
"./dist/types/test.d.ts"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// files/$package.json.ts
|
|
79
|
+
import { addDependency, loadAsJson, setScripts } from "@batijs/core";
|
|
80
|
+
async function getPackageJson(props) {
|
|
81
|
+
const packageJson = await loadAsJson(props);
|
|
82
|
+
setScripts(packageJson, {
|
|
83
|
+
"preview:wrangler": {
|
|
84
|
+
value: "wrangler pages dev",
|
|
85
|
+
precedence: 20,
|
|
86
|
+
warnIfReplaced: true
|
|
87
|
+
},
|
|
88
|
+
preview: {
|
|
89
|
+
value: "run-s build preview:wrangler",
|
|
90
|
+
precedence: 20,
|
|
91
|
+
warnIfReplaced: true
|
|
92
|
+
},
|
|
93
|
+
"deploy:wrangler": {
|
|
94
|
+
value: "wrangler pages deploy",
|
|
95
|
+
precedence: 20,
|
|
96
|
+
warnIfReplaced: true
|
|
97
|
+
},
|
|
98
|
+
deploy: {
|
|
99
|
+
value: "run-s build deploy:wrangler",
|
|
100
|
+
precedence: 20,
|
|
101
|
+
warnIfReplaced: true
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return addDependency(packageJson, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default), {
|
|
105
|
+
devDependencies: ["wrangler", "npm-run-all2"],
|
|
106
|
+
dependencies: [
|
|
107
|
+
"vike-cloudflare",
|
|
108
|
+
...props.meta.BATI.has("hattip") ? ["@hattip/adapter-cloudflare-workers"] : []
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
getPackageJson as default
|
|
114
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// files/$vite.config.ts.ts
|
|
2
|
+
import { addVitePlugin, loadAsMagicast } from "@batijs/core";
|
|
3
|
+
async function getViteConfig(props) {
|
|
4
|
+
const mod = await loadAsMagicast(props);
|
|
5
|
+
let options = void 0;
|
|
6
|
+
if (props.meta.BATI.has("hattip") || props.meta.BATI.has("hono")) {
|
|
7
|
+
options = {
|
|
8
|
+
server: {
|
|
9
|
+
kind: props.meta.BATI.has("hono") ? "hono" : "hattip",
|
|
10
|
+
entry: props.meta.BATI.has("hono") ? "hono-entry.ts" : "hattip-entry.ts"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
addVitePlugin(mod, {
|
|
15
|
+
from: "vike-cloudflare",
|
|
16
|
+
constructor: "pages",
|
|
17
|
+
imported: "pages",
|
|
18
|
+
options
|
|
19
|
+
});
|
|
20
|
+
return mod.generate().code;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
getViteConfig as default
|
|
24
|
+
};
|
|
@@ -11,7 +11,7 @@ export const data = async () => {
|
|
|
11
11
|
// We remove data we don't need because the data is passed to the client; we should
|
|
12
12
|
// minimize what is sent over the network.
|
|
13
13
|
const movies = minimize(moviesData);
|
|
14
|
-
return movies;
|
|
14
|
+
return { data: movies };
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
function minimize(movies: MovieDetails[]): Movie[] {
|
|
@@ -2,6 +2,6 @@ import type { PageContext } from "vike/types";
|
|
|
2
2
|
import type { Data } from "./+data.js";
|
|
3
3
|
|
|
4
4
|
export function title(pageContext: PageContext<Data>) {
|
|
5
|
-
const movies = pageContext.data;
|
|
5
|
+
const movies = pageContext.data.data;
|
|
6
6
|
return `${movies.length} Star Wars Movies`;
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -1559,13 +1559,13 @@ var import_which_pm_runs = __toESM(require_which_pm_runs(), 1);
|
|
|
1559
1559
|
// package.json
|
|
1560
1560
|
var package_default = {
|
|
1561
1561
|
name: "@batijs/cli",
|
|
1562
|
-
version: "0.0.
|
|
1562
|
+
version: "0.0.214",
|
|
1563
1563
|
type: "module",
|
|
1564
1564
|
scripts: {
|
|
1565
1565
|
"check-types": "tsc --noEmit",
|
|
1566
1566
|
prerelease: "rimraf ./dist",
|
|
1567
|
-
prepublishOnly: "pnpm run build
|
|
1568
|
-
|
|
1567
|
+
prepublishOnly: "pnpm run build",
|
|
1568
|
+
build: "rimraf ./dist && tsup"
|
|
1569
1569
|
},
|
|
1570
1570
|
keywords: [],
|
|
1571
1571
|
description: "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
|
|
@@ -1623,14 +1623,18 @@ var rulesMessages = {
|
|
|
1623
1623
|
)}. Check https://vike.dev/integration#server-side-tools for details and https://batijs.dev for available servers`
|
|
1624
1624
|
),
|
|
1625
1625
|
[RulesMessage.ERROR_COMPILED_R_REACT]: error(
|
|
1626
|
-
`${inverse(bold("React"))} is required when using ${inverse(bold("Compiled"))}
|
|
1626
|
+
`${inverse(bold("React"))} is required when using ${inverse(bold("Compiled"))}`
|
|
1627
1627
|
),
|
|
1628
1628
|
[RulesMessage.INFO_HATTIP]: info(`${inverse(bold("HatTip"))} is an experimental project`),
|
|
1629
1629
|
[RulesMessage.ERROR_DRIZZLE_R_SERVER]: error(
|
|
1630
|
-
`A ${inverse(bold("Server"))} is required when using ${inverse(bold("Drizzle"))}
|
|
1630
|
+
`A ${inverse(bold("Server"))} is required when using ${inverse(bold("Drizzle"))}`
|
|
1631
1631
|
),
|
|
1632
1632
|
[RulesMessage.ERROR_DATA_R_SERVER]: error(
|
|
1633
|
-
`A ${inverse(bold("Server"))} is required when using ${inverse(bold("Data fetching"))}
|
|
1633
|
+
`A ${inverse(bold("Server"))} is required when using ${inverse(bold("Data fetching"))}`
|
|
1634
|
+
),
|
|
1635
|
+
[RulesMessage.ERROR_CLOUDFLARE_R_COMPAT_SERVER]: error(
|
|
1636
|
+
`${inverse(bold("Cloudflare"))} is only compatible with ${inverse(bold("Hono"))} or ${inverse(bold("HatTip"))}.
|
|
1637
|
+
Choose one of them, or simply remove selected Server`
|
|
1634
1638
|
)
|
|
1635
1639
|
};
|
|
1636
1640
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.214",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"typescript": "^5.5.2",
|
|
22
22
|
"vite": "^5.3.2",
|
|
23
23
|
"which-pm-runs": "^1.1.0",
|
|
24
|
-
"@batijs/
|
|
25
|
-
"@batijs/
|
|
24
|
+
"@batijs/compile": "0.0.214",
|
|
25
|
+
"@batijs/build": "0.0.214"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@batijs/core": "0.0.
|
|
29
|
-
"@batijs/features": "0.0.
|
|
28
|
+
"@batijs/core": "0.0.214",
|
|
29
|
+
"@batijs/features": "0.0.214"
|
|
30
30
|
},
|
|
31
31
|
"bin": "./dist/index.js",
|
|
32
32
|
"exports": {
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"scripts": {
|
|
39
39
|
"check-types": "tsc --noEmit",
|
|
40
40
|
"prerelease": "rimraf ./dist",
|
|
41
|
-
"build
|
|
41
|
+
"build": "rimraf ./dist && tsup"
|
|
42
42
|
}
|
|
43
43
|
}
|