@changke/staticnext-build 0.9.0 → 0.9.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/CHANGELOG.md +5 -0
- package/eslint.config.mjs +13 -3
- package/lib/tasks/clean.mjs +1 -1
- package/lib/tasks/copy.mjs +1 -1
- package/lib/tasks/markdown.mjs +1 -1
- package/lib/tasks/prototype.mjs +1 -1
- package/lib/tasks/set-env-dev.mjs +1 -1
- package/lib/tasks/set-env-prod.mjs +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## 0.9.1
|
|
8
|
+
2024-09-13
|
|
9
|
+
### Added
|
|
10
|
+
- Use `@stylistic/eslint-plugin` for stylistic linting
|
|
11
|
+
|
|
7
12
|
## 0.9.0
|
|
8
13
|
2024-09-10
|
|
9
14
|
### Changed
|
package/eslint.config.mjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import globals from 'globals';
|
|
2
2
|
import js from '@eslint/js';
|
|
3
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
3
4
|
|
|
4
5
|
export default [
|
|
5
6
|
js.configs.recommended,
|
|
7
|
+
stylistic.configs.customize({
|
|
8
|
+
blockSpacing: false,
|
|
9
|
+
braceStyle: '1tbs',
|
|
10
|
+
semi: true
|
|
11
|
+
}),
|
|
6
12
|
{
|
|
7
13
|
files: ['**/*.mjs'],
|
|
8
14
|
languageOptions: {
|
|
@@ -12,9 +18,13 @@ export default [
|
|
|
12
18
|
}
|
|
13
19
|
},
|
|
14
20
|
rules: {
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
21
|
+
'@stylistic/arrow-parens': ['error', 'as-needed', {requireForBlockBody: false}],
|
|
22
|
+
'@stylistic/comma-dangle': ['error', 'never'],
|
|
23
|
+
'@stylistic/object-curly-spacing': ['error', 'never'],
|
|
24
|
+
'@stylistic/quotes': ['warn', 'single'],
|
|
25
|
+
'@stylistic/quote-props': 0,
|
|
26
|
+
'@stylistic/semi': ['error', 'always'],
|
|
27
|
+
'@stylistic/space-before-function-paren': ['error', {anonymous: 'ignore', asyncArrow: 'always', named: 'never'}]
|
|
18
28
|
}
|
|
19
29
|
}
|
|
20
30
|
];
|
package/lib/tasks/clean.mjs
CHANGED
package/lib/tasks/copy.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import cpy from 'cpy';
|
|
|
6
6
|
* @param {STPair[]} sourceTargetPairs
|
|
7
7
|
* @return {Promise<Awaited<unknown>[]>}
|
|
8
8
|
*/
|
|
9
|
-
const copy =
|
|
9
|
+
const copy = sourceTargetPairs => {
|
|
10
10
|
console.log('=> copy');
|
|
11
11
|
return Promise.all(sourceTargetPairs.map(pair => cpy(pair.sources, pair.target, pair.opts)));
|
|
12
12
|
};
|
package/lib/tasks/markdown.mjs
CHANGED
|
@@ -55,7 +55,7 @@ const markdown = (mdSourcePathRoot, njkPaths, njkGlobals, mdTargetPath) => {
|
|
|
55
55
|
for (const [k, v] of Object.entries(njkGlobals)) {
|
|
56
56
|
njkEnv.addGlobal(k, v);
|
|
57
57
|
}
|
|
58
|
-
return Promise.all(docs.map(async
|
|
58
|
+
return Promise.all(docs.map(async doc => {
|
|
59
59
|
const mdContent = await readFile(doc, {encoding: 'utf8'});
|
|
60
60
|
const html = marked.parse(mdContent);
|
|
61
61
|
const pageTitle = getPageTitle(mdContent);
|
package/lib/tasks/prototype.mjs
CHANGED
|
@@ -22,7 +22,7 @@ const prototype = (prototypeSourcePathRoot, njkPaths, njkGlobals, prototypeTarge
|
|
|
22
22
|
for (const [k, v] of Object.entries(njkGlobals)) {
|
|
23
23
|
njkEnv.addGlobal(k, v);
|
|
24
24
|
}
|
|
25
|
-
return Promise.all(pages.map(async
|
|
25
|
+
return Promise.all(pages.map(async page => {
|
|
26
26
|
const pageContent = await readFile(page, {encoding: 'utf8'});
|
|
27
27
|
const res = njkEnv.renderString(pageContent);
|
|
28
28
|
const targetFile = getTargetPathString(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@changke/staticnext-build",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Build scripts extracted from StaticNext seed project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"type": "module",
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@eslint/js": "^9.10.0",
|
|
23
|
+
"@stylistic/eslint-plugin": "^2.8.0",
|
|
23
24
|
"eslint": "^9.10.0",
|
|
24
25
|
"globals": "^15.9.0",
|
|
25
26
|
"mocha": "^10.7.3"
|