poops 1.0.6 → 1.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/README.md +20 -22
- package/example/dist/css/styles.css +10 -4
- package/example/dist/css/styles.css.map +1 -1
- package/example/dist/css/styles.min.css +2 -2
- package/example/dist/js/scripts.js +1 -1
- package/example/dist/js/scripts.min.js +1 -1
- package/example/src/markup/_data/features.yaml +9 -0
- package/example/src/markup/_data/links.json +2 -2
- package/example/src/markup/_layouts/layout.html +3 -2
- package/example/src/markup/_partials/header.html +8 -3
- package/example/src/markup/index.html +25 -6
- package/example/src/scss/style/index.scss +9 -3
- package/index.html +52 -11
- package/lib/markups.js +9 -3
- package/lib/scripts.js +5 -3
- package/package.json +2 -2
- package/poop.png +0 -0
- package/poops.js +10 -15
- package/poops.json +1 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Straightforward, no-bullshit bundler for the web.
|
|
|
19
19
|
|
|
20
20
|
----
|
|
21
21
|
|
|
22
|
-
Intuitive with a minimal learning curve and minimal docs,
|
|
22
|
+
Intuitive with a minimal learning curve and minimal docs, utilizing the most efficient transpilers and compilers available (like [dart-sass](https://sass-lang.com/dart-sass) and [esbuild](https://esbuild.github.io/)) Poops aims to be the simplest bundler option there is. If it's not, please do contribute so we can make it so! 🙏 All ideas and contributions are welcome.
|
|
23
23
|
|
|
24
24
|
It uses a simple config file where you define your input and output paths and it poops out your bundled files. Simple as that.
|
|
25
25
|
|
|
@@ -55,24 +55,20 @@ or locally:
|
|
|
55
55
|
npm i -D poops
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
If you have installed Poops globally, create a `poops.json` configuration file in the project root (see [Configuration](#configuration) on how to configure) and run:
|
|
58
|
+
If you have installed Poops globally, create a `poops.json` or `💩.json` configuration file in the project root (see [Configuration](#configuration) on how to configure) and run:
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
poops
|
|
62
|
-
```
|
|
60
|
+
`poops` or `💩`
|
|
63
61
|
|
|
64
|
-
or pass a custom config. This is
|
|
62
|
+
or pass a custom config. This is useful when you have multiple environments:
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
poops yourAwesomeConfig.json
|
|
68
|
-
```
|
|
64
|
+
`poops yourAwesomeConfig.json` or `💩 yourAwesomeConfig.json`
|
|
69
65
|
|
|
70
|
-
If you have installed Poops locally you can run it with `npx poops` or add a script to your `package.json`:
|
|
66
|
+
If you have installed Poops locally you can run it with `npx poops` or `npx 💩` or add a script to your `package.json`:
|
|
71
67
|
|
|
72
68
|
```json
|
|
73
69
|
{
|
|
74
70
|
"scripts": {
|
|
75
|
-
"build": "npx poops"
|
|
71
|
+
"build": "npx poops" // or "npx 💩"
|
|
76
72
|
}
|
|
77
73
|
}
|
|
78
74
|
```
|
|
@@ -139,7 +135,7 @@ Just create a `poops.json` file in the root of your project and add the followin
|
|
|
139
135
|
|
|
140
136
|
All config properties are optional except `scripts`, `styles` or `markups`. You have to specify at least one of them. If you don't have anything to consume, you won't poop. 💩
|
|
141
137
|
|
|
142
|
-
You can freely remove the
|
|
138
|
+
You can freely remove the properties that you don't need. For example, if you don't want to run a local server, just remove the `serve` property from the config.
|
|
143
139
|
|
|
144
140
|
### Scripts
|
|
145
141
|
|
|
@@ -149,10 +145,10 @@ Scripts are bundled with [esbuild](https://esbuild.github.io/). You can specify
|
|
|
149
145
|
* `out` - the output path, can be a directory or a file path, but please just use it as a filename
|
|
150
146
|
* `options` - the options for the bundler. You can apply most of the esbuild options that are not in conflict with Poops. See [esbuild's options](https://esbuild.github.io/api/#build-api) for more info.
|
|
151
147
|
|
|
152
|
-
Options
|
|
153
|
-
* `sourcemap` - whether to generate sourcemaps or not, sourcemaps are generated only for non-minified files since they are useful for debugging. Default is `false
|
|
148
|
+
**Options:**
|
|
149
|
+
* `sourcemap` - whether to generate sourcemaps or not, sourcemaps are generated only for non-minified files since they are useful for debugging. Default is `false`. This is a direct esbuild option
|
|
154
150
|
* `minify` - whether to minify the output or not, minification is performed by Terser and is only applied to non-minified files. Default is `false`
|
|
155
|
-
* `mangle` - whether to mangle the output or not, mangling is performed by Terser and this is the only Terser
|
|
151
|
+
* `mangle` - whether to mangle the output or not, mangling is performed by Terser and this is the only Terser option. Default is `false`
|
|
156
152
|
* `justMinified` - whether you want to have a minified file as output only. Removes the non-minified file from the output. Useful for production builds. Default is `false`
|
|
157
153
|
* `format` - the output format, can be `iife` or `esm` or `cjs` - this is a direct esbuild option
|
|
158
154
|
* `target` - the target for the output, can be `es2018` or `es2019` or `es2020` or `esnext` for instance - this is a direct esbuild option
|
|
@@ -201,7 +197,7 @@ Styles are bundled with [Dart Sass](https://sass-lang.com/dart-sass). You can sp
|
|
|
201
197
|
* `out` - the output path, can be a directory or a file path, but please just use it as a filename
|
|
202
198
|
* `options` - the options for the bundler.
|
|
203
199
|
|
|
204
|
-
Options
|
|
200
|
+
**Options:**
|
|
205
201
|
* `sourcemap` - whether to generate sourcemaps or not, sourcemaps are generated only for non-minified files since they are useful for debugging. Default is `false`
|
|
206
202
|
* `minify` - whether to minify the output or not, minification is performed by `cssnano` and is only applied to non-minified files. At the minification step, `autoprefixer` is also applied. Default is `false`
|
|
207
203
|
* `justMinified` - whether you want to have a minified file as output only. Removes the non-minified file from the output. Useful for production builds. Defaults to `false`.
|
|
@@ -239,9 +235,9 @@ As noted earlier, if you don't want to bundle styles, just remove the `styles` p
|
|
|
239
235
|
|
|
240
236
|
Poops can generate static pages for you. This feature is still under development, but available for testing from the v1.0.2. Your markup is templated with [nunjucks](https://mozilla.github.io/nunjucks/). You can specify multiple markup directories to template. **It's currently recommended to specify only one markup directory since this feature is still WIP 🚧.** Each markup directory has the following properties:
|
|
241
237
|
|
|
242
|
-
* `in` - the input path, can be a directory or a file path, but please just use it as a directory path. All files in this directory will be
|
|
238
|
+
* `in` - the input path, can be a directory or a file path, but please just use it as a directory path for now. All files in this directory will be processed and the structure of the directory will be preserved in the output directory with exception to directories that begin with an underscore `_` will be ignored.
|
|
243
239
|
* `out` - the output path, can be only a directory path (for now)
|
|
244
|
-
* `site` (
|
|
240
|
+
* `site` (optional) - global data that will be available to all templates in the markup directory. Like site title, description, social media links, etc. You can then use this data in your templates `{{ site.title }}` for instance.
|
|
245
241
|
* `data` (optional) - is an array of JSON or YAML data files, that once loaded will be available to all templates in the markup directory. If you provide a path to a file for instance `links.json` with a `facebook` property, you can then use this data in your templates `{{ links.facebook }}`. The base name of the file will be used as the variable name, with spaces, dashes and dots replaced with underscores. So `the awesome-links.json` will be available as `{{ the_awesome_links.facebook }}` in your templates. The root directory of the data files is `in` directory. So if you have a `data` directory in your `in` directory, you can specify the data files like this `data: ["data/links.json"]`. The same goes for the YAML files.
|
|
246
242
|
* `includePaths` (WIP 🚧) - an array of paths to directories that will be added to the nunjucks include paths. Useful if you want to separate template partials and layouts. For instance, if you have a `_includes` directory with a `header.njk` partial that you want to include in your markup, you can add it to the include paths and then include the templates like this `{% include "header.njk" %}`, without specifying the full path to the partial. This will change in the future, to provide better ignore and include patterns for the markup directories.
|
|
247
243
|
|
|
@@ -353,7 +349,7 @@ If you don't want to run livereload, just remove the `livereload` property from
|
|
|
353
349
|
### Watch (optional)
|
|
354
350
|
Sets up a watcher for your project which will rebuild your files on change.
|
|
355
351
|
|
|
356
|
-
`watch`
|
|
352
|
+
`watch` property accepts an array of paths to watch for changes. If you want to watch for changes in the `src` directory, just add it to the `watch` array:
|
|
357
353
|
|
|
358
354
|
```json
|
|
359
355
|
{
|
|
@@ -366,7 +362,7 @@ Sets up a watcher for your project which will rebuild your files on change.
|
|
|
366
362
|
If you don't want to watch for file changes, just remove the `watch` property from the config.
|
|
367
363
|
|
|
368
364
|
### Include Paths (optional)
|
|
369
|
-
This property is used to specify paths that you want to resolve your imports from. Like `node_modules`. You don't need to specify the `includePaths`, `node_modules` are included by default. But if you do specify `includePaths`, you need to include `node_modules` as well, since this change will override the default
|
|
365
|
+
This property is used to specify paths that you want to resolve your imports from. Like `node_modules`. You don't need to specify the `includePaths`, `node_modules` are included by default. But if you do specify `includePaths`, you need to include `node_modules` as well, since this change will override the default behavior.
|
|
370
366
|
|
|
371
367
|
Same as `watch` property, `includePaths` accepts an array of paths to include. If you want to include `lib` directory for instance, just add it to the `includePaths` array:
|
|
372
368
|
|
|
@@ -382,7 +378,9 @@ Same as `watch` property, `includePaths` accepts an array of paths to include. I
|
|
|
382
378
|
|
|
383
379
|
* [ ] Run esbuild for each input path individually if there are multiple input paths
|
|
384
380
|
* [ ] Styles `in` should be able to support array of inputs like we have it on scripts
|
|
385
|
-
* [
|
|
381
|
+
* [ ] Build a cli config creation helper tool. If the user doesn't have a config file, we can ask them a few questions and create a config file for them.
|
|
382
|
+
* [ ] Support for LESS styles... I guess...
|
|
383
|
+
* [x] Add nunjucks static templating
|
|
386
384
|
* [ ] Refactor nunjucks implementation
|
|
387
385
|
* [ ] Complete documentation for nunjucks
|
|
388
386
|
* [ ] Add markdown support
|
|
@@ -396,7 +394,7 @@ Same as `watch` property, `includePaths` accepts an array of paths to include. I
|
|
|
396
394
|
|
|
397
395
|
Why doesn't anyone maintain GULP anymore? Why does Parcel hate config files? Why are Rollup and Webpack so complex to setup for simple tasks? Vite???? What's going on?
|
|
398
396
|
|
|
399
|
-
I'm tired... Tired of bullshit... I just want to bundle my scss/sass and/or my js/ts to css and iife/esm js, by providing input and output paths for both/one. And to be able to have minimal easily maintainable
|
|
397
|
+
I'm tired... Tired of bullshit... I just want to bundle my scss/sass and/or my js/ts to css and iife/esm js, by providing input and output paths for both/one. And to be able to have minimal easily maintainable dependencies. I don't need plugins, I'll add the features manually for the practice I use. That's it. The f**king end.
|
|
400
398
|
|
|
401
399
|
To better illustrate it, here is a sample diff of Poops replacing Rollup:
|
|
402
400
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* poops v1.0.
|
|
1
|
+
/* poops v1.0.7 | https://github.com/stamat/poops | MIT License */
|
|
2
2
|
/*
|
|
3
3
|
* SIZES
|
|
4
4
|
*/
|
|
@@ -17634,7 +17634,6 @@ body {
|
|
|
17634
17634
|
margin: 0;
|
|
17635
17635
|
padding: 0;
|
|
17636
17636
|
font-family: "DM Sans", Helvetica, Arial, sans-serif !important;
|
|
17637
|
-
font-size: 24px !important;
|
|
17638
17637
|
line-height: 1.5;
|
|
17639
17638
|
}
|
|
17640
17639
|
|
|
@@ -17645,7 +17644,6 @@ header {
|
|
|
17645
17644
|
header h1 {
|
|
17646
17645
|
font-family: "Poppins", Helvetica, Arial, sans-serif !important;
|
|
17647
17646
|
font-weight: 700 !important;
|
|
17648
|
-
font-size: 94px;
|
|
17649
17647
|
line-height: 1;
|
|
17650
17648
|
margin: 0;
|
|
17651
17649
|
color: #824F2D;
|
|
@@ -17654,6 +17652,14 @@ header h1 {
|
|
|
17654
17652
|
#poop {
|
|
17655
17653
|
font-size: 10rem;
|
|
17656
17654
|
display: inline-block;
|
|
17657
|
-
|
|
17655
|
+
}
|
|
17656
|
+
|
|
17657
|
+
code.terminal::before {
|
|
17658
|
+
content: "$ ";
|
|
17659
|
+
opacity: 0.5;
|
|
17660
|
+
}
|
|
17661
|
+
|
|
17662
|
+
a {
|
|
17663
|
+
color: #824F2D;
|
|
17658
17664
|
}
|
|
17659
17665
|
/*# sourceMappingURL=styles.css.map */
|