@shevky/core 0.0.1
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/LICENSE +21 -0
- package/README.md +28 -0
- package/package.json +59 -0
- package/scripts/analytics.js +86 -0
- package/scripts/build.js +1108 -0
- package/scripts/cli.js +95 -0
- package/scripts/init.js +126 -0
- package/scripts/main.js +48 -0
- package/scripts/social.js +205 -0
- package/shevky.js +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Fatih Tatoğlu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# shevky
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
A minimal, dependency-light static site generator.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
For the quick start you should execute the following commands.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm init -y
|
|
13
|
+
npm install --save-dev shevky
|
|
14
|
+
npm install
|
|
15
|
+
|
|
16
|
+
npx shevky --init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The system provides a simple blog for you. Then you can build with following commands.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm run build
|
|
23
|
+
npm run dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Technical Documentation
|
|
27
|
+
|
|
28
|
+
The tech documentation is preparing for Shevky with Shevky. You will find it under [Shevky Project](https://tatoglu.net/project/shevky) page.
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shevky/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A minimal, dependency-light static site generator.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "shevky.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"shevky": "./shevky.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"shevky.js",
|
|
12
|
+
"scripts/",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/shevky/core.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"static-site-generator",
|
|
22
|
+
"ssg",
|
|
23
|
+
"markdown",
|
|
24
|
+
"mustache",
|
|
25
|
+
"nodejs",
|
|
26
|
+
"minimal"
|
|
27
|
+
],
|
|
28
|
+
"author": "Fatih Tatoğlu <fatih@tatoglu.net>",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/shevky/core/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/shevky/core#readme",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@shevky/base": "^0.0.1",
|
|
36
|
+
"@types/node": "^20.11.30",
|
|
37
|
+
"@types/mustache": "^4.2.6",
|
|
38
|
+
"@types/html-minifier-terser": "^7.0.2",
|
|
39
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
40
|
+
"autoprefixer": "^10.4.21",
|
|
41
|
+
"gray-matter": "^4.0.3",
|
|
42
|
+
"highlight.js": "^11.11.1",
|
|
43
|
+
"html-minifier-terser": "^6.1.0",
|
|
44
|
+
"marked": "^15.0.12",
|
|
45
|
+
"marked-highlight": "^2.2.3",
|
|
46
|
+
"mustache": "^4.2.0",
|
|
47
|
+
"postcss": "^8.5.6",
|
|
48
|
+
"tailwindcss": "^4.1.14",
|
|
49
|
+
"command-line-args": "^6.0.1",
|
|
50
|
+
"command-line-usage": "^7.0.3",
|
|
51
|
+
"degit": "^2.8.4"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18"
|
|
55
|
+
},
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"access": "public"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { config as _cfg } from "@shevky/base";
|
|
2
|
+
|
|
3
|
+
function getAnalyticsConfig() {
|
|
4
|
+
return _cfg.analytics ?? {};
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const PLACEHOLDER_IDS = new Set([
|
|
8
|
+
"GTM-XXXXXXX",
|
|
9
|
+
"G-XXXXXXXXXX",
|
|
10
|
+
"CLARITY-ID",
|
|
11
|
+
"META-PIXEL-ID",
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
/** @param {unknown} value */
|
|
15
|
+
function isValidId(value) {
|
|
16
|
+
if (typeof value !== "string") {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const trimmed = value.trim();
|
|
21
|
+
if (!trimmed) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return !PLACEHOLDER_IDS.has(trimmed);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getSnippets() {
|
|
29
|
+
const { gtmId, gaId, clarityId, metaPixelId } = getAnalyticsConfig();
|
|
30
|
+
const snippets = [];
|
|
31
|
+
|
|
32
|
+
if (isValidId(gtmId)) {
|
|
33
|
+
snippets.push(
|
|
34
|
+
`<script>(function (w, d, s, l, i) { w[l] = w[l] || []; w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" }); var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l !== "dataLayer" ? "&l=" + l : ""; j.async = true; j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl; f.parentNode.insertBefore(j, f); })(window, document, "script", "dataLayer", "${gtmId}");</script>`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (isValidId(gaId)) {
|
|
39
|
+
snippets.push(
|
|
40
|
+
`<script async src="https://www.googletagmanager.com/gtag/js?id=${gaId}"></script>`,
|
|
41
|
+
);
|
|
42
|
+
snippets.push(
|
|
43
|
+
`<script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag("js", new Date()); gtag("config", "${gaId}");</script>`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (isValidId(clarityId)) {
|
|
48
|
+
snippets.push(
|
|
49
|
+
`<script>(function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){ (c[a].q=c[a].q||[]).push(arguments); }; t=l.createElement(r); t.async=1; t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "${clarityId}");</script>`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (isValidId(metaPixelId)) {
|
|
54
|
+
snippets.push(
|
|
55
|
+
`<script>!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version="2.0";n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,"script","https://connect.facebook.net/en_US/fbevents.js");fbq("init","${metaPixelId}");fbq("track","PageView");</script>`,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return snippets;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const API = {
|
|
63
|
+
get snippets() {
|
|
64
|
+
return this.enabled ? getSnippets() : [];
|
|
65
|
+
},
|
|
66
|
+
get enabled() {
|
|
67
|
+
return Boolean(getAnalyticsConfig().enabled);
|
|
68
|
+
},
|
|
69
|
+
get google() {
|
|
70
|
+
const { gaId, gtmId } = getAnalyticsConfig();
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
ga: gaId,
|
|
74
|
+
gtm: gtmId,
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
get microsoft() {
|
|
78
|
+
const { clarityId } = getAnalyticsConfig();
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
clarity: clarityId,
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default API;
|