onlybuild 1.5.0 → 1.6.0
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/CHANGELOG.md +14 -0
- package/README.md +22 -2
- package/dist/bin/index.js +1 -1
- package/dist/package.json +3 -3
- package/dist/src/build.js +3 -3
- package/dist/src/css.d.ts +7 -0
- package/dist/src/css.js +10 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v1.6.0](https://github.com/neogeek/onlybuild/tree/v1.6.0) - (2024-05-21)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.5.1...v1.6.0)
|
|
6
|
+
|
|
7
|
+
- [feat] Added css string template method. [#25](https://github.com/neogeek/onlybuild/pull/25)
|
|
8
|
+
- [hotfix] Updated packages. [#24](https://github.com/neogeek/onlybuild/pull/24)
|
|
9
|
+
|
|
10
|
+
## [v1.5.1](https://github.com/neogeek/onlybuild/tree/v1.5.1) - (2024-05-15)
|
|
11
|
+
|
|
12
|
+
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.5.0...v1.5.1)
|
|
13
|
+
|
|
14
|
+
- [hotfix] Updated elapsed time label. [#23](https://github.com/neogeek/onlybuild/pull/23)
|
|
15
|
+
- [hotfix] Added mocked tests [#22](https://github.com/neogeek/onlybuild/pull/22)
|
|
16
|
+
|
|
3
17
|
## [v1.5.0](https://github.com/neogeek/onlybuild/tree/v1.5.0) - (2024-05-13)
|
|
4
18
|
|
|
5
19
|
[Full Changelog](https://github.com/neogeek/onlybuild/compare/v1.4.1...v1.5.0)
|
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ It will also show the commands needed to enter the folder and build, watch (if e
|
|
|
70
70
|
|
|
71
71
|
### Demo
|
|
72
72
|
|
|
73
|
-
https://github.com/neogeek/onlybuild/assets/6753/
|
|
73
|
+
https://github.com/neogeek/onlybuild/assets/6753/c15b6b96-7489-46c5-bc7e-a84be8fdc841
|
|
74
74
|
|
|
75
75
|
## Install
|
|
76
76
|
|
|
@@ -224,7 +224,27 @@ import { html } from 'onlybuild';
|
|
|
224
224
|
export default html`<h1>Hello, world!</h1>`;
|
|
225
225
|
```
|
|
226
226
|
|
|
227
|
-
Install the [lit-html](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) plugin in VS Code to help format the HTML on save.
|
|
227
|
+
Install the [lit-html](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) and [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) plugin in VS Code to help format the HTML on save.
|
|
228
|
+
|
|
229
|
+
### <code>`css`</code> String Template Utility
|
|
230
|
+
|
|
231
|
+
The `onlybuild` library includes an optional <code>`css`</code> string template utility that can be used to add syntax highlighting and formatting to CSS, making it easier to author CSS in JavaScript.
|
|
232
|
+
|
|
233
|
+
```javascript
|
|
234
|
+
import { css } from 'onlybuild';
|
|
235
|
+
|
|
236
|
+
const styles = css`
|
|
237
|
+
body {
|
|
238
|
+
color: red;
|
|
239
|
+
}
|
|
240
|
+
`;
|
|
241
|
+
|
|
242
|
+
export default html`<style>
|
|
243
|
+
${styles}
|
|
244
|
+
</style>`;
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Install the [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) plugin in VS Code to help format the CSS on save.
|
|
228
248
|
|
|
229
249
|
## File Structure
|
|
230
250
|
|
package/dist/bin/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import parseCmdArgs from 'parse-cmd-args';
|
|
|
7
7
|
import { buildFiles, writeFiles } from '../src/build.js';
|
|
8
8
|
import { copyFiles } from '../src/copy.js';
|
|
9
9
|
import pkg from '../package.json' assert { type: 'json' };
|
|
10
|
-
const elapsedTimeLabel = 'Elapsed time
|
|
10
|
+
const elapsedTimeLabel = 'Elapsed time';
|
|
11
11
|
console.time(elapsedTimeLabel);
|
|
12
12
|
const args = parseCmdArgs(null, {
|
|
13
13
|
requireUserInput: false
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onlybuild",
|
|
3
3
|
"description": "A zero-config cli for building static websites.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.x"
|
|
7
7
|
},
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"dotenv": "16.4.5",
|
|
22
22
|
"globby": "14.0.1",
|
|
23
23
|
"parse-cmd-args": "5.0.2",
|
|
24
|
-
"tsx": "4.10.
|
|
24
|
+
"tsx": "4.10.5"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "20.12.
|
|
27
|
+
"@types/node": "20.12.12",
|
|
28
28
|
"typescript": "5.4.5"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
package/dist/src/build.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
2
|
import { dirname, join, parse, resolve } from 'node:path';
|
|
3
3
|
/**
|
|
4
4
|
* Calculates the output path of the file based on the original input path.
|
|
@@ -36,8 +36,8 @@ export const buildFiles = async (paths) => {
|
|
|
36
36
|
* @param {string} contents
|
|
37
37
|
*/
|
|
38
38
|
export const writeFileAndMakeDir = async (path, contents) => {
|
|
39
|
-
await mkdir(dirname(path), { recursive: true });
|
|
40
|
-
await writeFile(path, contents);
|
|
39
|
+
await fs.mkdir(dirname(path), { recursive: true });
|
|
40
|
+
await fs.writeFile(path, contents);
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* Write files to the build directory.
|
package/dist/src/css.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String template utility that adds syntax highlighting and formatting in text editors.
|
|
3
|
+
*
|
|
4
|
+
* @param {TemplateStringsArray} strings
|
|
5
|
+
* @param {any[]} values
|
|
6
|
+
*/
|
|
7
|
+
export const css = (strings, ...values) => {
|
|
8
|
+
const processedValues = values.map(value => Array.isArray(value) ? value.join('') : value);
|
|
9
|
+
return strings.reduce((prev, curr, i) => `${prev}${curr}${processedValues[i] || ''}`, '');
|
|
10
|
+
};
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onlybuild",
|
|
3
3
|
"description": "A zero-config cli for building static websites.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.x"
|
|
7
7
|
},
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"dotenv": "16.4.5",
|
|
22
22
|
"globby": "14.0.1",
|
|
23
23
|
"parse-cmd-args": "5.0.2",
|
|
24
|
-
"tsx": "4.10.
|
|
24
|
+
"tsx": "4.10.5"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "20.12.
|
|
27
|
+
"@types/node": "20.12.12",
|
|
28
28
|
"typescript": "5.4.5"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|