campsitejs 0.0.6 → 0.0.7
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/index.js +27 -4
- package/package.json +1 -1
- package/template/campsite.config.js +9 -1
- package/template/package.json +4 -4
- package/template/src/styles/tailwind.css +23 -3
- package/template/tailwind.config.cjs +0 -37
package/index.js
CHANGED
|
@@ -109,6 +109,11 @@ async function copyBaseTemplate(targetDir) {
|
|
|
109
109
|
async function writeConfig(targetDir, answers) {
|
|
110
110
|
const configPath = join(targetDir, "campsite.config.js");
|
|
111
111
|
const primaryEngine = answers.templateEngines[0] || "nunjucks";
|
|
112
|
+
const photoFormats = answers.photoCompression.length > 0
|
|
113
|
+
? JSON.stringify(answers.photoCompression)
|
|
114
|
+
: "[]";
|
|
115
|
+
const compressPhotos = answers.photoCompression.length > 0;
|
|
116
|
+
|
|
112
117
|
const config = `export default {
|
|
113
118
|
siteName: "${answers.projectName}",
|
|
114
119
|
srcDir: "src",
|
|
@@ -118,6 +123,13 @@ async function writeConfig(targetDir, answers) {
|
|
|
118
123
|
minifyCSS: ${answers.minifyAssets},
|
|
119
124
|
minifyHTML: ${answers.minifyAssets},
|
|
120
125
|
cacheBustAssets: ${answers.cacheBustAssets}, // Add content hashes to JS/CSS filenames
|
|
126
|
+
compressPhotos: ${compressPhotos},
|
|
127
|
+
compressionSettings: {
|
|
128
|
+
quality: 80,
|
|
129
|
+
formats: ${photoFormats},
|
|
130
|
+
inputFormats: [".jpg", ".jpeg", ".png"],
|
|
131
|
+
preserveOriginal: true
|
|
132
|
+
},
|
|
121
133
|
integrations: {
|
|
122
134
|
nunjucks: ${answers.templateEngines.includes("nunjucks")},
|
|
123
135
|
liquid: ${answers.templateEngines.includes("liquid")},
|
|
@@ -167,10 +179,10 @@ async function updatePackageJson(targetDir, answers) {
|
|
|
167
179
|
});
|
|
168
180
|
|
|
169
181
|
if (cssFramework === "tailwind") {
|
|
170
|
-
devDeps["tailwindcss"] = "^
|
|
182
|
+
devDeps["tailwindcss"] = "^4.1.18";
|
|
171
183
|
devDeps["npm-run-all"] = "^4.1.5";
|
|
172
|
-
pkg.scripts["build:css"] = "tailwindcss -
|
|
173
|
-
pkg.scripts["dev:css"] = "tailwindcss -
|
|
184
|
+
pkg.scripts["build:css"] = "tailwindcss -i ./src/styles/tailwind.css -o ./public/style.css --minify";
|
|
185
|
+
pkg.scripts["dev:css"] = "tailwindcss -i ./src/styles/tailwind.css -o ./public/style.css --watch";
|
|
174
186
|
pkg.scripts["dev:site"] = "campsite dev";
|
|
175
187
|
pkg.scripts["dev"] = "npm-run-all -p dev:css dev:site";
|
|
176
188
|
pkg.scripts["prebuild"] = "npm run build:css";
|
|
@@ -296,7 +308,6 @@ async function pruneComponents(targetDir, answers) {
|
|
|
296
308
|
async function pruneCssFramework(targetDir, answers) {
|
|
297
309
|
if (answers.cssFramework === "tailwind") return;
|
|
298
310
|
const tailwindFiles = [
|
|
299
|
-
join(targetDir, "tailwind.config.cjs"),
|
|
300
311
|
join(targetDir, "src", "styles", "tailwind.css")
|
|
301
312
|
];
|
|
302
313
|
await Promise.all(tailwindFiles.map((file) => rm(file).catch(() => {})));
|
|
@@ -404,6 +415,18 @@ async function main() {
|
|
|
404
415
|
active: "yes",
|
|
405
416
|
inactive: "no"
|
|
406
417
|
},
|
|
418
|
+
{
|
|
419
|
+
type: "multiselect",
|
|
420
|
+
name: "photoCompression",
|
|
421
|
+
message: "Photo compression formats",
|
|
422
|
+
hint: "Use space to toggle, enter to confirm",
|
|
423
|
+
instructions: false,
|
|
424
|
+
min: 0,
|
|
425
|
+
choices: [
|
|
426
|
+
{ title: "WebP", value: ".webp", selected: true },
|
|
427
|
+
{ title: "AVIF", value: ".avif", selected: true }
|
|
428
|
+
]
|
|
429
|
+
},
|
|
407
430
|
{
|
|
408
431
|
type: "select",
|
|
409
432
|
name: "packageManager",
|
package/package.json
CHANGED
|
@@ -6,7 +6,15 @@ export default {
|
|
|
6
6
|
markdown: true,
|
|
7
7
|
minifyCSS: false,
|
|
8
8
|
minifyHTML: false,
|
|
9
|
-
cacheBustAssets: false,
|
|
9
|
+
cacheBustAssets: false,
|
|
10
|
+
excludeFiles: ['.pdf'],
|
|
11
|
+
compressPhotos: false,
|
|
12
|
+
compressionSettings: {
|
|
13
|
+
quality: 80,
|
|
14
|
+
formats: [],
|
|
15
|
+
inputFormats: [".jpg", ".jpeg", ".png"],
|
|
16
|
+
preserveOriginal: true
|
|
17
|
+
},
|
|
10
18
|
integrations: {
|
|
11
19
|
nunjucks: true,
|
|
12
20
|
liquid: false,
|
package/template/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build:css": "tailwindcss -
|
|
8
|
-
"dev:css": "tailwindcss -
|
|
7
|
+
"build:css": "tailwindcss -i ./src/styles/tailwind.css -o ./public/style.css --minify",
|
|
8
|
+
"dev:css": "tailwindcss -i ./src/styles/tailwind.css -o ./public/style.css --watch",
|
|
9
9
|
"dev:site": "campsite dev",
|
|
10
10
|
"dev": "npm-run-all -p dev:css dev:site",
|
|
11
11
|
"prebuild": "npm run build:css",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"postinstall": "npm run build:css"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"basecampjs": "^0.0.
|
|
17
|
+
"basecampjs": "^0.0.10"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"npm-run-all": "^4.1.5",
|
|
21
|
-
"tailwindcss": "^
|
|
21
|
+
"tailwindcss": "^4.1.18"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
@
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--color-campfire-50: #fff0e5;
|
|
5
|
+
--color-campfire-100: #ffe1cc;
|
|
6
|
+
--color-campfire-200: #ffc499;
|
|
7
|
+
--color-campfire-300: #ffa666;
|
|
8
|
+
--color-campfire-400: #ff8833;
|
|
9
|
+
--color-campfire-500: #ff6a00;
|
|
10
|
+
--color-campfire-600: #cc5500;
|
|
11
|
+
--color-campfire-700: #994000;
|
|
12
|
+
--color-campfire-800: #662b00;
|
|
13
|
+
--color-campfire-900: #331500;
|
|
14
|
+
--color-campfire-950: #0a0501;
|
|
15
|
+
|
|
16
|
+
--color-grove-ink: #0b0c10;
|
|
17
|
+
--color-grove-foam: #f4ede0;
|
|
18
|
+
--color-grove-glow: #f97316;
|
|
19
|
+
--color-grove-forest: #1f5130;
|
|
20
|
+
|
|
21
|
+
--font-family-sans: "Inter", system-ui, -apple-system, sans-serif;
|
|
22
|
+
--font-family-mono: "JetBrains Mono", Menlo, Consolas, monospace;
|
|
23
|
+
}
|
|
4
24
|
|
|
5
25
|
@layer base {
|
|
6
26
|
code {
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
content: [
|
|
3
|
-
"./src/**/*.{html,md,njk,liquid,js,vue}",
|
|
4
|
-
"./src/**/*.liquid.html",
|
|
5
|
-
"./public/**/*.{html,js}"
|
|
6
|
-
],
|
|
7
|
-
theme: {
|
|
8
|
-
extend: {
|
|
9
|
-
colors: {
|
|
10
|
-
campfire: {
|
|
11
|
-
"50": "#fff0e5",
|
|
12
|
-
"100": "#ffe1cc",
|
|
13
|
-
"200": "#ffc499",
|
|
14
|
-
"300": "#ffa666",
|
|
15
|
-
"400": "#ff8833",
|
|
16
|
-
"500": "#ff6a00",
|
|
17
|
-
"600": "#cc5500",
|
|
18
|
-
"700": "#994000",
|
|
19
|
-
"800": "#662b00",
|
|
20
|
-
"900": "#331500",
|
|
21
|
-
"950": "#0a0501"
|
|
22
|
-
},
|
|
23
|
-
grove: {
|
|
24
|
-
ink: "#0b0c10",
|
|
25
|
-
foam: "#f4ede0",
|
|
26
|
-
glow: "#f97316",
|
|
27
|
-
forest: "#1f5130"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
fontFamily: {
|
|
31
|
-
sans: ["Inter","system-ui","-apple-system","sans-serif"],
|
|
32
|
-
mono: ["JetBrains Mono","Menlo","Consolas","monospace"]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
plugins: []
|
|
37
|
-
};
|