poops 1.0.18 → 1.0.20
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/README.md +71 -2
- package/lib/copy.js +121 -0
- package/lib/markups.js +226 -143
- package/lib/styles.js +65 -24
- package/lib/utils/helpers.js +197 -3
- package/package.json +8 -3
- package/poops.js +12 -1
- package/.eslintrc.yml +0 -10
- package/.github/dependabot.yml +0 -9
- package/.github/workflows/npm_publish.yml +0 -17
- package/.nojekyll +0 -1
- package/changelog/blog-functionality.html +0 -58
- package/changelog/feed.rss +0 -31
- package/changelog/front-matter.html +0 -61
- package/changelog/index.html +0 -74
- package/changelog/markdown-support.html +0 -56
- package/example/dist/css/styles.css +0 -7172
- package/example/dist/css/styles.css.map +0 -1
- package/example/dist/css/styles.min.css +0 -2
- package/example/dist/js/scripts.js +0 -35
- package/example/dist/js/scripts.js.map +0 -7
- package/example/dist/js/scripts.min.js +0 -2
- package/example/src/js/main.ts +0 -28
- package/example/src/js/scripts/utils.ts +0 -16
- package/example/src/markup/_data/features.yaml +0 -9
- package/example/src/markup/_data/links.json +0 -10
- package/example/src/markup/_data/poops.yaml +0 -7
- package/example/src/markup/_layouts/blog.html +0 -35
- package/example/src/markup/_layouts/default.html +0 -93
- package/example/src/markup/_partials/heading.html +0 -10
- package/example/src/markup/_partials/site-header.html +0 -17
- package/example/src/markup/changelog/blog-functionality.md +0 -9
- package/example/src/markup/changelog/feed.rss +0 -23
- package/example/src/markup/changelog/front-matter.md +0 -12
- package/example/src/markup/changelog/index.html +0 -30
- package/example/src/markup/changelog/markdown-support.md +0 -7
- package/example/src/markup/index.html +0 -33
- package/example/src/scss/_config.scss +0 -22
- package/example/src/scss/index.scss +0 -4
- package/example/src/scss/style/index.scss +0 -13
- package/example/src/scss/style/test.css +0 -3
- package/index.html +0 -166
- package/poop.png +0 -0
- package/script/build +0 -3
- package/script/publish +0 -138
- package/script/server +0 -3
- package/test.html +0 -96
- package/tsconfig.json +0 -16
- package//360/237/222/251.json +0 -55
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: blog
|
|
3
|
-
title: Added Front Matter support!
|
|
4
|
-
date: 2023-09-19
|
|
5
|
-
description: Front matter is an awesome idea! Since the static site generator functionality of Poops is inspired by Jekyll and the genius of peeps that came up with the idea of front matter, I decided to add it to Poops as well. Made things super simple! And that's what Poops is all about. Making things simple.
|
|
6
|
-
published: true
|
|
7
|
-
---
|
|
8
|
-
# {{ page.title }}
|
|
9
|
-
|
|
10
|
-
> {{ page.description }}
|
|
11
|
-
|
|
12
|
-
Adding Front Matter was a breeze. Seriously.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: blog
|
|
3
|
-
title: Changelog
|
|
4
|
-
description: Follow the latest changes of Poops.
|
|
5
|
-
paginate: 10
|
|
6
|
-
collection: true
|
|
7
|
-
sort: date
|
|
8
|
-
---
|
|
9
|
-
<div class="text-center">
|
|
10
|
-
<h1>Changelog</h1>
|
|
11
|
-
</div>
|
|
12
|
-
{% for post in changelog.pageItems %}
|
|
13
|
-
<div class="post">
|
|
14
|
-
<h2><a href="{{ relativePathPrefix }}{{ post.url }}">{{ post.title }}</a></h2>
|
|
15
|
-
<div class="date">{{ post.date | date }}</div>
|
|
16
|
-
{{ post.description }}
|
|
17
|
-
</div>
|
|
18
|
-
{% endfor %}
|
|
19
|
-
|
|
20
|
-
{% if changelog.totalPages > 1 %}
|
|
21
|
-
{% if changelog.nextPageUrl %}
|
|
22
|
-
<a href="{{ relativePathPrefix }}{{ changelog.nextPageUrl }}">Next</a>
|
|
23
|
-
{% endif %}
|
|
24
|
-
|
|
25
|
-
{{ changelog.pageNumber }} of {{ changelog.totalPages }}
|
|
26
|
-
|
|
27
|
-
{% if changelog.prevPageUrl %}
|
|
28
|
-
<a href="{{ relativePathPrefix }}{{ changelog.prevPageUrl }}">Previous</a>
|
|
29
|
-
{% endif %}
|
|
30
|
-
{% endif %}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: default
|
|
3
|
-
subtitle: ✨ <strong>Now supports Front Matter!</strong> ✨
|
|
4
|
-
---
|
|
5
|
-
{% include "site-header.html" %}
|
|
6
|
-
{% include "heading.html" %}
|
|
7
|
-
|
|
8
|
-
<div class="container my-32">
|
|
9
|
-
<div class="grid grid-gutter">
|
|
10
|
-
<!-- Links loaded from example/markup/_data/features.json -->
|
|
11
|
-
{% for feature in features %}
|
|
12
|
-
<div class="col-12 col-lg-4 my-32">
|
|
13
|
-
<div class="w-48 h-48 round d-flex flex-column align-center justify-center" style="background: #824F2D; color: #DCC8AC">
|
|
14
|
-
{{ feature.icon | safe }}
|
|
15
|
-
</div>
|
|
16
|
-
<h2 class="h4 mb-8 mt-16 text-primary">{{ feature.title }}</h2>
|
|
17
|
-
<p class="p2 m-0">{{ feature.text }}</p>
|
|
18
|
-
</div>
|
|
19
|
-
{% endfor %}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
|
|
23
|
-
<div class="container text-center">
|
|
24
|
-
<!-- Links loaded from example/markup/_data/links.json -->
|
|
25
|
-
<div class="mb-24 mt-32">
|
|
26
|
-
{% for link in links %}
|
|
27
|
-
<a href="{{ link.url }}" id="{{ link.title | slugify }}">{{ link.title }}</a>
|
|
28
|
-
{% endfor %}
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<!-- Links loaded from example/markup/_data/poops.yml -->
|
|
32
|
-
<div>{% for poop in poops.poops %}{{ poop }}{% endfor %}</div>
|
|
33
|
-
</div>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* BREAKPOINTS - 'size label': (min, max)
|
|
3
|
-
*/
|
|
4
|
-
$breakpoints: (
|
|
5
|
-
'': (false, 956px),
|
|
6
|
-
'lg': (960px, false)
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
$container-max-width: 1440px;
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
* COLORS
|
|
13
|
-
*/
|
|
14
|
-
$colors: (
|
|
15
|
-
black: #000000,
|
|
16
|
-
white: #ffffff,
|
|
17
|
-
primary: #824F2D,
|
|
18
|
-
brownish: #DCC8AC
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
$heading-font: Poppins,Helvetica,Arial,sans-serif;
|
|
22
|
-
$paragraph-font: 'DM Sans', Helvetica, Arial, sans-serif;
|
package/index.html
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>💩 Poops</title>
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<meta name="description" content="Straightforward, no-bullshit bundler for the web.">
|
|
8
|
-
<link rel="alternate" type="application/rss+xml" href="https://stamat.github.io/poops/changelog/feed.rss">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
10
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
11
|
-
<link rel="stylesheet" href="example/dist/css/styles.min.css">
|
|
12
|
-
<link href="https://fonts.googleapis.com/css2?family=DM+Sans&family=Poppins:wght@700&display=swap" rel="stylesheet">
|
|
13
|
-
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js"></script>
|
|
14
|
-
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
|
|
15
|
-
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body class="bg-brownish">
|
|
18
|
-
|
|
19
|
-
<header class="py-8">
|
|
20
|
-
<div class="container d-flex justify-space-between align-center h-48">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<nav class="ml-auto">
|
|
24
|
-
|
|
25
|
-
<a href="changelog" class="text-none text-bold d-inline-block ml-lg-16 font-heading">Changelog</a>
|
|
26
|
-
|
|
27
|
-
<a href="https://github.com/stamat/poops#readme" class="text-none text-bold d-inline-block ml-lg-16 font-heading">Docs</a>
|
|
28
|
-
|
|
29
|
-
<a href="https://github.com/stamat/poops" class="d-inline-block ml-lg-16"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" class="w-24 h-24" style="vertical-align: middle"><path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg></a>
|
|
30
|
-
</nav>
|
|
31
|
-
</div>
|
|
32
|
-
</header>
|
|
33
|
-
|
|
34
|
-
<div class="mt-32 container text-center">
|
|
35
|
-
<h1 class="text-primary m-0"><span id="poop"><img src="poop.png" alt="💩" width="160" height="160" class="d-block"></span><br>POOPS</h1>
|
|
36
|
-
<a href="https://www.npmjs.com/package/poops"><img src="https://img.shields.io/npm/v/poops" alt="npm v1.0.18"></a>
|
|
37
|
-
<p class="p2">Straightforward, no-bullshit bundler for the web.</p>
|
|
38
|
-
<p class="p2">✨ <strong>Now supports Front Matter!</strong> ✨</p>
|
|
39
|
-
|
|
40
|
-
<div class="col-12 col-md-8 col-lg-5 mx-auto">
|
|
41
|
-
<pre><code class="language-js text-left rounded-6 terminal">npm i poops</code></pre>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class="container my-32">
|
|
47
|
-
<div class="grid grid-gutter">
|
|
48
|
-
<!-- Links loaded from example/markup/_data/features.json -->
|
|
49
|
-
|
|
50
|
-
<div class="col-12 col-lg-4 my-32">
|
|
51
|
-
<div class="w-48 h-48 round d-flex flex-column align-center justify-center" style="background: #824F2D; color: #DCC8AC">
|
|
52
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="currentColor"><path d="M11.134 1.535c.7-.509 1.416-.942 2.076-1.155.649-.21 1.463-.267 2.069.34.603.601.568 1.411.368 2.07-.202.668-.624 1.39-1.125 2.096-1.011 1.424-2.496 2.987-3.775 4.249-1.098 1.084-2.132 1.839-3.04 2.3a3.744 3.744 0 0 1-1.055 3.217c-.431.431-1.065.691-1.657.861-.614.177-1.294.287-1.914.357A21.151 21.151 0 0 1 .797 16H.743l.007-.75H.749L.742 16a.75.75 0 0 1-.743-.742l.743-.008-.742.007v-.054a21.25 21.25 0 0 1 .13-2.284c.067-.647.187-1.287.358-1.914.17-.591.43-1.226.86-1.657a3.746 3.746 0 0 1 3.227-1.054c.466-.893 1.225-1.907 2.314-2.982 1.271-1.255 2.833-2.75 4.245-3.777ZM1.62 13.089c-.051.464-.086.929-.104 1.395.466-.018.932-.053 1.396-.104a10.511 10.511 0 0 0 1.668-.309c.526-.151.856-.325 1.011-.48a2.25 2.25 0 1 0-3.182-3.182c-.155.155-.329.485-.48 1.01a10.515 10.515 0 0 0-.309 1.67Zm10.396-10.34c-1.224.89-2.605 2.189-3.822 3.384l1.718 1.718c1.21-1.205 2.51-2.597 3.387-3.833.47-.662.78-1.227.912-1.662.134-.444.032-.551.009-.575h-.001V1.78c-.014-.014-.113-.113-.548.027-.432.14-.995.462-1.655.942Zm-4.832 7.266-.001.001a9.859 9.859 0 0 0 1.63-1.142L7.155 7.216a9.7 9.7 0 0 0-1.161 1.607c.482.302.889.71 1.19 1.192Z"></path></svg>
|
|
53
|
-
</div>
|
|
54
|
-
<h2 class="h4 mb-8 mt-16 text-primary">Styles</h2>
|
|
55
|
-
<p class="p2 m-0">Compile and bundle your SASS/SCSS styles with <a href="https://sass-lang.com/dart-sass/">dart-sass</a>.</p>
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<div class="col-12 col-lg-4 my-32">
|
|
59
|
-
<div class="w-48 h-48 round d-flex flex-column align-center justify-center" style="background: #824F2D; color: #DCC8AC">
|
|
60
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="currentColor"><path d="M5 8.25a.75.75 0 0 1 .75-.75h4a.75.75 0 0 1 0 1.5h-4A.75.75 0 0 1 5 8.25ZM4 10.5A.75.75 0 0 0 4 12h4a.75.75 0 0 0 0-1.5H4Z"></path><path d="M13-.005c1.654 0 3 1.328 3 3 0 .982-.338 1.933-.783 2.818-.443.879-1.028 1.758-1.582 2.588l-.011.017c-.568.853-1.104 1.659-1.501 2.446-.398.789-.623 1.494-.623 2.136a1.5 1.5 0 1 0 2.333-1.248.75.75 0 0 1 .834-1.246A3 3 0 0 1 13 16H3a3 3 0 0 1-3-3c0-1.582.891-3.135 1.777-4.506.209-.322.418-.637.623-.946.473-.709.923-1.386 1.287-2.048H2.51c-.576 0-1.381-.133-1.907-.783A2.68 2.68 0 0 1 0 2.995a3 3 0 0 1 3-3Zm0 1.5a1.5 1.5 0 0 0-1.5 1.5c0 .476.223.834.667 1.132A.75.75 0 0 1 11.75 5.5H5.368c-.467 1.003-1.141 2.015-1.773 2.963-.192.289-.381.571-.558.845C2.13 10.711 1.5 11.916 1.5 13A1.5 1.5 0 0 0 3 14.5h7.401A2.989 2.989 0 0 1 10 13c0-.979.338-1.928.784-2.812.441-.874 1.023-1.748 1.575-2.576l.017-.026c.568-.853 1.103-1.658 1.501-2.448.398-.79.623-1.497.623-2.143 0-.838-.669-1.5-1.5-1.5Zm-10 0a1.5 1.5 0 0 0-1.5 1.5c0 .321.1.569.27.778.097.12.325.227.74.227h7.674A2.737 2.737 0 0 1 10 2.995c0-.546.146-1.059.401-1.5Z"></path></svg>
|
|
61
|
-
</div>
|
|
62
|
-
<h2 class="h4 mb-8 mt-16 text-primary">Scripts</h2>
|
|
63
|
-
<p class="p2 m-0">Use it to transpile and bundle your scripts with the lighting fast <a href="https://esbuild.github.io">esbuild</a>!</p>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div class="col-12 col-lg-4 my-32">
|
|
67
|
-
<div class="w-48 h-48 round d-flex flex-column align-center justify-center" style="background: #824F2D; color: #DCC8AC">
|
|
68
|
-
<svg class="w-24 h-auto" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="currentColor"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg>
|
|
69
|
-
</div>
|
|
70
|
-
<h2 class="h4 mb-8 mt-16 text-primary">Markup</h2>
|
|
71
|
-
<p class="p2 m-0">Use it as a static site generator. Uses <a href="https://mozilla.github.io/nunjucks/">Nunjucks</a> for templating.</p>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div class="container text-center">
|
|
78
|
-
<!-- Links loaded from example/markup/_data/links.json -->
|
|
79
|
-
<div class="mb-24 mt-32">
|
|
80
|
-
|
|
81
|
-
<a href="changelog" id="changelog">Changelog</a>
|
|
82
|
-
|
|
83
|
-
<a href="https://github.com/stamat/poops#readme" id="docs">Docs</a>
|
|
84
|
-
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<!-- Links loaded from example/markup/_data/poops.yml -->
|
|
88
|
-
<div>💩💩💩💩</div>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<script>document.write('<script src="http://'
|
|
95
|
-
+ (location.host || 'localhost').split(':')[0]
|
|
96
|
-
+ ':35730/livereload.js?snipver=1"></'
|
|
97
|
-
+ 'script>')</script>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<script type="text/javascript">
|
|
101
|
-
var poop = document.getElementById('poop');
|
|
102
|
-
|
|
103
|
-
function getPosition(element) {
|
|
104
|
-
var clientRect = element.getBoundingClientRect();
|
|
105
|
-
return {
|
|
106
|
-
left: clientRect.left + document.body.scrollLeft,
|
|
107
|
-
top: clientRect.top + document.body.scrollTop
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
var poopPosition = getPosition(poop);
|
|
112
|
-
|
|
113
|
-
var count = 200;
|
|
114
|
-
var defaults = {
|
|
115
|
-
origin: {
|
|
116
|
-
y: ((poopPosition.top + poop.offsetHeight/2) * 100 / window.innerHeight) / 100,
|
|
117
|
-
x: ((poopPosition.left + poop.offsetWidth/2) * 100 / window.innerWidth) / 100
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
function fire(particleRatio, opts) {
|
|
122
|
-
confetti(Object.assign({}, defaults, opts, {
|
|
123
|
-
shapes: ['square'],
|
|
124
|
-
particleCount: Math.floor(count * particleRatio)
|
|
125
|
-
}));
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function explode() {
|
|
129
|
-
fire(0.25, {
|
|
130
|
-
spread: 26,
|
|
131
|
-
startVelocity: 55,
|
|
132
|
-
});
|
|
133
|
-
fire(0.2, {
|
|
134
|
-
spread: 60,
|
|
135
|
-
});
|
|
136
|
-
fire(0.35, {
|
|
137
|
-
spread: 100,
|
|
138
|
-
decay: 0.91,
|
|
139
|
-
scalar: 0.8
|
|
140
|
-
});
|
|
141
|
-
fire(0.1, {
|
|
142
|
-
spread: 120,
|
|
143
|
-
startVelocity: 25,
|
|
144
|
-
decay: 0.92,
|
|
145
|
-
scalar: 1.2
|
|
146
|
-
});
|
|
147
|
-
fire(0.1, {
|
|
148
|
-
spread: 120,
|
|
149
|
-
startVelocity: 45,
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
poop.addEventListener('mouseenter', function() {
|
|
154
|
-
explode();
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
poop.addEventListener('click', function() {
|
|
158
|
-
explode();
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
explode();
|
|
162
|
-
</script>
|
|
163
|
-
<script>hljs.highlightAll();</script>
|
|
164
|
-
<script async type="text/javascript" src="example/dist/js/scripts.min.js"></script>
|
|
165
|
-
</body>
|
|
166
|
-
</html>
|
package/poop.png
DELETED
|
Binary file
|
package/script/build
DELETED
package/script/publish
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This script is used to publish a new version of the package.
|
|
5
|
-
* It can automatically increment the patch version if no version is specified in the package.json and commit the changes.
|
|
6
|
-
* It can also automatically tag and push the tags.
|
|
7
|
-
* Using GH CLI, it can also create a release.
|
|
8
|
-
*
|
|
9
|
-
* Fucking awesome, right?
|
|
10
|
-
*
|
|
11
|
-
* With love, @stamat
|
|
12
|
-
*/
|
|
13
|
-
const readline = require('readline')
|
|
14
|
-
const { exec } = require('child_process')
|
|
15
|
-
const fs = require('fs')
|
|
16
|
-
const path = require('path')
|
|
17
|
-
const argVersion = process.argv[2]
|
|
18
|
-
const packageJson = require(path.join(process.cwd(), './package.json'))
|
|
19
|
-
|
|
20
|
-
function question(prompt) {
|
|
21
|
-
const rl = readline.createInterface({
|
|
22
|
-
input: process.stdin,
|
|
23
|
-
output: process.stdout
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
return new Promise((resolve) => {
|
|
27
|
-
rl.question(prompt, (answer) => {
|
|
28
|
-
rl.close()
|
|
29
|
-
resolve(answer)
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function isValidVersion(version) {
|
|
35
|
-
return /^(\d+)\.(\d+)\.(\d+)(?:-([\w-]+(?:\.[\w-]+)*))?(?:\+([\w-]+(?:\.[\w-]+)*))?$/.test(version)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function incrementPatchVersion(version) {
|
|
39
|
-
const parts = version.split('.')
|
|
40
|
-
const patch = parseInt(parts[2]) + 1
|
|
41
|
-
return `${parts[0]}.${parts[1]}.${patch}`
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function runPromise(child) {
|
|
45
|
-
child.stdout.on('data', (data) => {
|
|
46
|
-
console.log(data.toString())
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
child.stderr.on('data', (data) => {
|
|
50
|
-
console.log(data.toString())
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
return new Promise(function(resolve, reject) {
|
|
54
|
-
child.addListener('error', reject)
|
|
55
|
-
child.addListener('exit', resolve)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function run(cmd, exitOnError = true) {
|
|
60
|
-
console.log(cmd)
|
|
61
|
-
try {
|
|
62
|
-
await runPromise(exec(cmd))
|
|
63
|
-
} catch (e) {
|
|
64
|
-
if (exitOnError) process.exit(1)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function publish(version) {
|
|
69
|
-
packageJson.version = version
|
|
70
|
-
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2))
|
|
71
|
-
|
|
72
|
-
await run('git add package.json')
|
|
73
|
-
await run(`git commit -m "Bump version to ${version}"`)
|
|
74
|
-
|
|
75
|
-
if (fs.existsSync(path.join(process.cwd(), 'script/build'))) {
|
|
76
|
-
await run('script/build')
|
|
77
|
-
await run('git add .')
|
|
78
|
-
await run(`git commit -m "Build version ${version}"`)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
await run(`git tag v${version}`)
|
|
82
|
-
await run('git push')
|
|
83
|
-
await run('git push --tags')
|
|
84
|
-
|
|
85
|
-
const publish = await question('Do you want to publish the package? (y/n): ')
|
|
86
|
-
if (publish === 'y') {
|
|
87
|
-
let notesArg = ''
|
|
88
|
-
const notes = await question('Enter notes for the release (optional): ')
|
|
89
|
-
if (notes.trim() !== '') {
|
|
90
|
-
notesArg = ` --notes "${notes}"`
|
|
91
|
-
}
|
|
92
|
-
await run(`gh release create v${version} --title "v${version}"${notesArg} --generate-notes --latest`)
|
|
93
|
-
await run('npm publish')
|
|
94
|
-
} else {
|
|
95
|
-
await run('npm publish')
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async function init() {
|
|
100
|
-
if (!packageJson.version) {
|
|
101
|
-
console.log('No version found in package.json')
|
|
102
|
-
process.exit(1)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (argVersion && !isValidVersion(argVersion)) {
|
|
106
|
-
console.log('Invalid version: ', argVersion)
|
|
107
|
-
console.log('Current version: ', packageJson.version)
|
|
108
|
-
process.exit(1)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (argVersion && packageJson.version === argVersion) {
|
|
112
|
-
console.log('Version is already ', argVersion)
|
|
113
|
-
process.exit(1)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (!argVersion) {
|
|
117
|
-
console.log('Current version: ', packageJson.version)
|
|
118
|
-
const version = incrementPatchVersion(packageJson.version)
|
|
119
|
-
const answer = await question(`Do you want to increment the version to ${version}? (y/n) `)
|
|
120
|
-
if (answer === 'y') {
|
|
121
|
-
publish(version)
|
|
122
|
-
} else {
|
|
123
|
-
const desiredVersion = await question(`Enter the desired version: (or press enter to use ${packageJson.version})`)
|
|
124
|
-
if (desiredVersion.trim() === '') {
|
|
125
|
-
publish(packageJson.version)
|
|
126
|
-
} else {
|
|
127
|
-
if (!isValidVersion(desiredVersion)) {
|
|
128
|
-
console.log('Invalid version: ', desiredVersion)
|
|
129
|
-
process.exit(1)
|
|
130
|
-
}
|
|
131
|
-
publish(desiredVersion)
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
} else {
|
|
135
|
-
publish(argVersion)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
init()
|
package/script/server
DELETED
package/test.html
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>💩 Poops</title>
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<meta name="description" content="Straightforward, no-bullshit bundler for the web.">
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
-
<link rel="stylesheet" href="example/dist/css/styles.min.css">
|
|
11
|
-
<link href="https://fonts.googleapis.com/css2?family=DM+Sans&family=Poppins:wght@700&display=swap" rel="stylesheet">
|
|
12
|
-
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js"></script>
|
|
13
|
-
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
|
|
14
|
-
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<h1>MarkDown Test</h1>
|
|
19
|
-
<p>This is just a MarkDown test</p>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<script>document.write('<script src="http://'
|
|
25
|
-
+ (location.host || 'localhost').split(':')[0]
|
|
26
|
-
+ ':35729/livereload.js?snipver=1"></'
|
|
27
|
-
+ 'script>')</script>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<script type="text/javascript">
|
|
31
|
-
var poop = document.getElementById('poop');
|
|
32
|
-
|
|
33
|
-
function getPosition(element) {
|
|
34
|
-
var clientRect = element.getBoundingClientRect();
|
|
35
|
-
return {
|
|
36
|
-
left: clientRect.left + document.body.scrollLeft,
|
|
37
|
-
top: clientRect.top + document.body.scrollTop
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var poopPosition = getPosition(poop);
|
|
42
|
-
|
|
43
|
-
var count = 200;
|
|
44
|
-
var defaults = {
|
|
45
|
-
origin: {
|
|
46
|
-
y: ((poopPosition.top + poop.offsetHeight/2) * 100 / window.innerHeight) / 100,
|
|
47
|
-
x: ((poopPosition.left + poop.offsetWidth/2) * 100 / window.innerWidth) / 100
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
function fire(particleRatio, opts) {
|
|
52
|
-
confetti(Object.assign({}, defaults, opts, {
|
|
53
|
-
shapes: ['square'],
|
|
54
|
-
particleCount: Math.floor(count * particleRatio)
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function explode() {
|
|
59
|
-
fire(0.25, {
|
|
60
|
-
spread: 26,
|
|
61
|
-
startVelocity: 55,
|
|
62
|
-
});
|
|
63
|
-
fire(0.2, {
|
|
64
|
-
spread: 60,
|
|
65
|
-
});
|
|
66
|
-
fire(0.35, {
|
|
67
|
-
spread: 100,
|
|
68
|
-
decay: 0.91,
|
|
69
|
-
scalar: 0.8
|
|
70
|
-
});
|
|
71
|
-
fire(0.1, {
|
|
72
|
-
spread: 120,
|
|
73
|
-
startVelocity: 25,
|
|
74
|
-
decay: 0.92,
|
|
75
|
-
scalar: 1.2
|
|
76
|
-
});
|
|
77
|
-
fire(0.1, {
|
|
78
|
-
spread: 120,
|
|
79
|
-
startVelocity: 45,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
poop.addEventListener('mouseenter', function() {
|
|
84
|
-
explode();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
poop.addEventListener('click', function() {
|
|
88
|
-
explode();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
explode();
|
|
92
|
-
</script>
|
|
93
|
-
<script>hljs.highlightAll();</script>
|
|
94
|
-
<script async type="text/javascript" src="example/dist/js/scripts.min.js"></script>
|
|
95
|
-
</body>
|
|
96
|
-
</html>
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"experimentalDecorators": true,
|
|
4
|
-
"target": "es2019",
|
|
5
|
-
"module": "es2020",
|
|
6
|
-
"lib": ["es2019", "dom", "dom.iterable"],
|
|
7
|
-
"moduleResolution": "node",
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
"checkJs": false,
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"strictPropertyInitialization": false,
|
|
14
|
-
"resolveJsonModule": true
|
|
15
|
-
}
|
|
16
|
-
}
|
package//360/237/222/251.json
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"scripts": [{
|
|
3
|
-
"in": "example/src/js/main.ts",
|
|
4
|
-
"out": "example/dist/js/scripts.js",
|
|
5
|
-
"options": {
|
|
6
|
-
"sourcemap": true,
|
|
7
|
-
"minify": true,
|
|
8
|
-
"justMinified": false,
|
|
9
|
-
"format": "iife",
|
|
10
|
-
"target": "es2019"
|
|
11
|
-
}
|
|
12
|
-
}],
|
|
13
|
-
"styles": [{
|
|
14
|
-
"in": "example/src/scss/index.scss",
|
|
15
|
-
"out": "example/dist/css/styles.css",
|
|
16
|
-
"options": {
|
|
17
|
-
"sourcemap": true,
|
|
18
|
-
"minify": true,
|
|
19
|
-
"justMinified": false
|
|
20
|
-
}
|
|
21
|
-
}],
|
|
22
|
-
"markup": {
|
|
23
|
-
"in": "example/src/markup",
|
|
24
|
-
"out": "/",
|
|
25
|
-
"options": {
|
|
26
|
-
"site": {
|
|
27
|
-
"title": "💩 Poops",
|
|
28
|
-
"description": "Straightforward, no-bullshit bundler for the web.",
|
|
29
|
-
"url": "https://stamat.github.io/poops"
|
|
30
|
-
},
|
|
31
|
-
"data": [
|
|
32
|
-
"_data/features.yaml",
|
|
33
|
-
"_data/links.json",
|
|
34
|
-
"_data/poops.yaml"
|
|
35
|
-
],
|
|
36
|
-
"includePaths": [
|
|
37
|
-
"_layouts",
|
|
38
|
-
"_partials"
|
|
39
|
-
],
|
|
40
|
-
"timeDateFormat": "MMM D, YYYY"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"banner": "/* {{ name }} v{{ version }} | {{ homepage }} | {{ license }} License */",
|
|
44
|
-
"serve" : {
|
|
45
|
-
"port": 4040,
|
|
46
|
-
"base": "/"
|
|
47
|
-
},
|
|
48
|
-
"livereload": true,
|
|
49
|
-
"watch": [
|
|
50
|
-
"example/src"
|
|
51
|
-
],
|
|
52
|
-
"includePaths": [
|
|
53
|
-
"node_modules"
|
|
54
|
-
]
|
|
55
|
-
}
|