@markuplint/create-rule 4.0.2 → 4.1.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/lib/transfer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { statSync } from 'node:fs';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
|
-
import { resolve, extname, basename, relative, dirname
|
|
3
|
+
import { resolve, extname, basename, relative, dirname } from 'node:path';
|
|
4
4
|
import { format } from 'prettier';
|
|
5
5
|
import tsc from 'typescript';
|
|
6
6
|
import { fsExists } from './fs-exists.js';
|
|
@@ -43,14 +43,6 @@ async function transferFile(scaffoldType, file, options) {
|
|
|
43
43
|
contents = contents.replace(/\n\s*\/\/ prettier-ignore/, '');
|
|
44
44
|
contents = contents.replace(/\n\s*<!-- prettier-ignore(?:-(?:start|end))? -->/, '');
|
|
45
45
|
const newFile = { ...file };
|
|
46
|
-
if (scaffoldType === 'core' && file.test) {
|
|
47
|
-
const name = options?.replacer?.ruleName;
|
|
48
|
-
if (!name) {
|
|
49
|
-
throw new Error('Rule name is empty');
|
|
50
|
-
}
|
|
51
|
-
newFile.destDir = newFile.destDir.replace(`${sep}rules${sep}src${sep}`, `${sep}rules${sep}test${sep}`);
|
|
52
|
-
contents = contents.replace("require('./').default", `require('../../lib/${name}').default`);
|
|
53
|
-
}
|
|
54
46
|
// TypeScript transpiles to JS
|
|
55
47
|
if (newFile.ext === '.ts' && options?.transpile) {
|
|
56
48
|
newFile.ext = '.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/create-rule",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Rule generator for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"clean": "tsc --build --clean"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@markuplint/cli-utils": "4.0.
|
|
29
|
-
"@markuplint/ml-core": "4.0
|
|
28
|
+
"@markuplint/cli-utils": "4.0.1",
|
|
29
|
+
"@markuplint/ml-core": "4.1.0",
|
|
30
30
|
"glob": "^10.3.6",
|
|
31
|
-
"prettier": "^3.2.
|
|
31
|
+
"prettier": "^3.2.5",
|
|
32
32
|
"ts-node": "^10.9.2",
|
|
33
33
|
"typescript": "^5.3.3"
|
|
34
34
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"@types/fs-extra": "^11.0.4",
|
|
37
37
|
"fs-extra": "^11.2.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "b9817c30c2df71faa866e3b3fe286afa499deede"
|
|
40
40
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"lib": ["dom", "es2015", "es2016", "es2017", "es2018", "es2019", "esnext"],
|
|
14
14
|
"skipLibCheck": true,
|
|
15
15
|
"outDir": "./lib",
|
|
16
|
-
"rootDir": "./src"
|
|
16
|
+
"rootDir": "./src"
|
|
17
17
|
},
|
|
18
18
|
"include": ["./src/**/*"],
|
|
19
|
-
"exclude": ["node_modules", "lib", "./src/**/*.spec.ts"]
|
|
19
|
+
"exclude": ["node_modules", "lib", "./src/**/*.spec.ts"]
|
|
20
20
|
}
|