@tsparticles/cli 1.11.0 → 1.13.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/.github/workflows/node.js-ci.yml +2 -0
- package/.mocharc.json +11 -0
- package/dist/build/build.js +1 -1
- package/dist/cli.js +2 -2
- package/dist/create/plugin/create-plugin.js +53 -8
- package/dist/create/plugin/plugin.js +3 -18
- package/dist/create/preset/create-preset.js +65 -12
- package/dist/create/preset/preset.js +3 -18
- package/dist/create/shape/create-shape.js +53 -8
- package/dist/create/shape/shape.js +3 -18
- package/dist/utils/file-utils.js +62 -0
- package/dist/utils/string-utils.js +13 -7
- package/dist/utils/template-utils.js +77 -8
- package/files/create-preset/README.md +3 -3
- package/files/empty-project/package.dist.json +1 -1
- package/files/empty-project/package.json +3 -3
- package/package.json +19 -12
- package/scripts/postversion.js +1 -1
- package/src/build/build.ts +1 -1
- package/src/cli.ts +2 -2
- package/src/create/plugin/create-plugin.ts +58 -56
- package/src/create/plugin/plugin.ts +4 -24
- package/src/create/preset/create-preset.ts +73 -68
- package/src/create/preset/preset.ts +4 -24
- package/src/create/shape/create-shape.ts +58 -54
- package/src/create/shape/shape.ts +4 -24
- package/src/utils/file-utils.ts +75 -0
- package/src/utils/string-utils.ts +14 -7
- package/src/utils/template-utils.ts +77 -45
- package/tests/create-plugin.test.ts +31 -0
- package/tests/create-preset.test.ts +31 -0
- package/tests/create-shape.test.ts +31 -0
- package/tests/file-utils.test.ts +101 -0
- package/tests/string-utils.test.ts +125 -0
- package/tests/tsconfig.json +24 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import fs from "fs-extra";
|
|
3
3
|
import path from "path";
|
|
4
|
+
import { replaceTokensInFile } from "./file-utils";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Updates the package.json file
|
|
@@ -17,22 +18,35 @@ export async function updatePackageFile(
|
|
|
17
18
|
fileName: string,
|
|
18
19
|
repoUrl: string,
|
|
19
20
|
): Promise<void> {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
await replaceTokensInFile({
|
|
22
|
+
path: path.resolve(destPath, "package.json"),
|
|
23
|
+
tokens: [
|
|
24
|
+
{
|
|
25
|
+
from: /"tsParticles empty template"/g,
|
|
26
|
+
to: `"${description}"`,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
from: /"tsparticles.empty.template.min.js"/g,
|
|
30
|
+
to: `"${fileName}"`,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
from: /\s{4}"private": true,\r?\n?/g,
|
|
34
|
+
to: "",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
from: /"@tsparticles\/empty-template"/g,
|
|
38
|
+
to: `"${packageName}"`,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
from: /"url": "git\+https:\/\/github\.com\/tsparticles\/empty-template\.git"/g,
|
|
42
|
+
to: `"url": "git+${repoUrl}"`,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
from: /"url": "https:\/\/github\.com\/tsparticles\/empty-template\/issues"/g,
|
|
46
|
+
to: `"url": "${repoUrl.replace(".git", "/issues")}"`,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
});
|
|
36
50
|
}
|
|
37
51
|
|
|
38
52
|
/**
|
|
@@ -50,22 +64,35 @@ export async function updatePackageDistFile(
|
|
|
50
64
|
fileName: string,
|
|
51
65
|
repoUrl: string,
|
|
52
66
|
): Promise<void> {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
await replaceTokensInFile({
|
|
68
|
+
path: path.resolve(destPath, "package.dist.json"),
|
|
69
|
+
tokens: [
|
|
70
|
+
{
|
|
71
|
+
from: /"tsParticles empty template"/g,
|
|
72
|
+
to: `"${description}"`,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
from: /"tsparticles.empty.template.min.js"/g,
|
|
76
|
+
to: `"${fileName}"`,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
from: /\s{4}"private": true,\r?\n?/g,
|
|
80
|
+
to: "",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
from: /"@tsparticles\/empty-template"/g,
|
|
84
|
+
to: `"${packageName}"`,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
from: /"url": "git\+https:\/\/github\.com\/tsparticles\/empty-template\.git"/g,
|
|
88
|
+
to: `"url": "git+${repoUrl}"`,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
from: /"url": "https:\/\/github\.com\/tsparticles\/empty-template\/issues"/g,
|
|
92
|
+
to: `"url": "${repoUrl.replace(".git", "/issues")}"`,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
});
|
|
69
96
|
}
|
|
70
97
|
|
|
71
98
|
/**
|
|
@@ -81,16 +108,23 @@ export async function updateWebpackFile(
|
|
|
81
108
|
description: string,
|
|
82
109
|
fnName: string,
|
|
83
110
|
): Promise<void> {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
111
|
+
await replaceTokensInFile({
|
|
112
|
+
path: path.resolve(destPath, "webpack.config.js"),
|
|
113
|
+
tokens: [
|
|
114
|
+
{
|
|
115
|
+
from: /"Empty"/g,
|
|
116
|
+
to: `"${description}"`,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
from: /"empty"/g,
|
|
120
|
+
to: `"${name}"`,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
from: /loadParticlesTemplate/g,
|
|
124
|
+
to: fnName,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
});
|
|
94
128
|
}
|
|
95
129
|
|
|
96
130
|
/**
|
|
@@ -98,9 +132,7 @@ export async function updateWebpackFile(
|
|
|
98
132
|
* @param destPath - The path where the project will be created
|
|
99
133
|
*/
|
|
100
134
|
export async function copyEmptyTemplateFiles(destPath: string): Promise<void> {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
await fs.copy(emptyPath, destPath, {
|
|
135
|
+
await fs.copy(path.resolve(__dirname, "..", "..", "files", "empty-project"), destPath, {
|
|
104
136
|
overwrite: true,
|
|
105
137
|
filter: copyFilter,
|
|
106
138
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it } from "mocha";
|
|
2
|
+
import { expect } from "chai";
|
|
3
|
+
import { createPluginTemplate } from "../src/create/plugin/create-plugin";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import fs from "fs-extra";
|
|
6
|
+
|
|
7
|
+
describe("create-plugin", async () => {
|
|
8
|
+
it("should have created the plugin project", async () => {
|
|
9
|
+
const destDir = path.resolve(path.join(__dirname, "tmp-files", "foo-plugin"));
|
|
10
|
+
|
|
11
|
+
await createPluginTemplate("foo", "Foo", "", destDir);
|
|
12
|
+
|
|
13
|
+
const pkgInfo = await fs.readJSON(path.join(destDir, "package.json"));
|
|
14
|
+
|
|
15
|
+
expect(pkgInfo.name).to.be.equal("tsparticles-plugin-foo");
|
|
16
|
+
|
|
17
|
+
await fs.remove(destDir);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should have created the plugin project, w/ repo", async () => {
|
|
21
|
+
const destDir = path.resolve(path.join(__dirname, "tmp-files", "bar-plugin"));
|
|
22
|
+
|
|
23
|
+
await createPluginTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
|
|
24
|
+
|
|
25
|
+
const pkgInfo = await fs.readJSON(path.join(destDir, "package.json"));
|
|
26
|
+
|
|
27
|
+
expect(pkgInfo.name).to.be.equal("tsparticles-plugin-bar");
|
|
28
|
+
|
|
29
|
+
await fs.remove(destDir);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it } from "mocha";
|
|
2
|
+
import { expect } from "chai";
|
|
3
|
+
import { createPresetTemplate } from "../src/create/preset/create-preset";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import fs from "fs-extra";
|
|
6
|
+
|
|
7
|
+
describe("create-plugin", async () => {
|
|
8
|
+
it("should have created the preset project", async () => {
|
|
9
|
+
const destDir = path.resolve(path.join(__dirname, "tmp-files", "foo-preset"));
|
|
10
|
+
|
|
11
|
+
await createPresetTemplate("foo", "Foo", "", destDir);
|
|
12
|
+
|
|
13
|
+
const pkgInfo = await fs.readJSON(path.join(destDir, "package.json"));
|
|
14
|
+
|
|
15
|
+
expect(pkgInfo.name).to.be.equal("tsparticles-preset-foo");
|
|
16
|
+
|
|
17
|
+
await fs.remove(destDir);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should have created the preset project, w/ repo", async () => {
|
|
21
|
+
const destDir = path.resolve(path.join(__dirname, "tmp-files", "bar-preset"));
|
|
22
|
+
|
|
23
|
+
await createPresetTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
|
|
24
|
+
|
|
25
|
+
const pkgInfo = await fs.readJSON(path.join(destDir, "package.json"));
|
|
26
|
+
|
|
27
|
+
expect(pkgInfo.name).to.be.equal("tsparticles-preset-bar");
|
|
28
|
+
|
|
29
|
+
await fs.remove(destDir);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it } from "mocha";
|
|
2
|
+
import { expect } from "chai";
|
|
3
|
+
import { createShapeTemplate } from "../src/create/shape/create-shape";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import fs from "fs-extra";
|
|
6
|
+
|
|
7
|
+
describe("create-shape", async () => {
|
|
8
|
+
it("should have created the shape project", async () => {
|
|
9
|
+
const destDir = path.resolve(path.join(__dirname, "tmp-files", "foo-shape"));
|
|
10
|
+
|
|
11
|
+
await createShapeTemplate("foo", "Foo", "", destDir);
|
|
12
|
+
|
|
13
|
+
const pkgInfo = await fs.readJSON(path.join(destDir, "package.json"));
|
|
14
|
+
|
|
15
|
+
expect(pkgInfo.name).to.be.equal("tsparticles-shape-foo");
|
|
16
|
+
|
|
17
|
+
await fs.remove(destDir);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("should have created the shape project, w/ repo", async () => {
|
|
21
|
+
const destDir = path.resolve(path.join(__dirname, "tmp-files", "bar-shape"));
|
|
22
|
+
|
|
23
|
+
await createShapeTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
|
|
24
|
+
|
|
25
|
+
const pkgInfo = await fs.readJSON(path.join(destDir, "package.json"));
|
|
26
|
+
|
|
27
|
+
expect(pkgInfo.name).to.be.equal("tsparticles-shape-bar");
|
|
28
|
+
|
|
29
|
+
await fs.remove(destDir);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { describe, it } from "mocha";
|
|
2
|
+
import { expect } from "chai";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import {
|
|
6
|
+
getDestinationDir,
|
|
7
|
+
getRepositoryUrl,
|
|
8
|
+
replaceTokensInFile,
|
|
9
|
+
replaceTokensInFiles,
|
|
10
|
+
} from "../src/utils/file-utils";
|
|
11
|
+
|
|
12
|
+
describe("file-utils", async () => {
|
|
13
|
+
const baseDir = path.join(__dirname, "tmp-files");
|
|
14
|
+
|
|
15
|
+
await fs.ensureDir(baseDir);
|
|
16
|
+
|
|
17
|
+
describe("replace tokens in files", async () => {
|
|
18
|
+
fs.writeFileSync(path.join(baseDir, "files1.txt"), "test");
|
|
19
|
+
fs.writeFileSync(path.join(baseDir, "files2.txt"), "test");
|
|
20
|
+
|
|
21
|
+
await replaceTokensInFiles([{
|
|
22
|
+
path: path.join(baseDir, "files1.txt"),
|
|
23
|
+
tokens: [{
|
|
24
|
+
from: "test",
|
|
25
|
+
to: "test1",
|
|
26
|
+
}],
|
|
27
|
+
}, {
|
|
28
|
+
path: path.join(baseDir, "files2.txt"),
|
|
29
|
+
tokens: [{
|
|
30
|
+
from: "test",
|
|
31
|
+
to: "test2",
|
|
32
|
+
}],
|
|
33
|
+
}]);
|
|
34
|
+
|
|
35
|
+
it("should replace tokens in files", async () => {
|
|
36
|
+
const data1 = await fs.readFile(path.join(baseDir, "files1.txt"), "utf8"),
|
|
37
|
+
data2 = await fs.readFile(path.join(baseDir, "files2.txt"), "utf8");
|
|
38
|
+
|
|
39
|
+
expect(data1).to.be.equal("test1");
|
|
40
|
+
expect(data2).to.be.equal("test2");
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe("replace tokens in file", async () => {
|
|
45
|
+
fs.writeFileSync(path.join(baseDir, "file1.txt"), "test");
|
|
46
|
+
|
|
47
|
+
await replaceTokensInFile({
|
|
48
|
+
path: path.join(baseDir, "file1.txt"),
|
|
49
|
+
tokens: [{
|
|
50
|
+
from: "test",
|
|
51
|
+
to: "test1",
|
|
52
|
+
}],
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("should replace tokens in files", async () => {
|
|
56
|
+
const data = await fs.readFile(path.join(baseDir, "file1.txt"), "utf8");
|
|
57
|
+
|
|
58
|
+
expect(data).to.be.equal("test1");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe("get destination dir", async () => {
|
|
63
|
+
const destDir = await getDestinationDir(path.join(baseDir, "baz"));
|
|
64
|
+
|
|
65
|
+
it("should return the destination dir", () => {
|
|
66
|
+
expect(destDir).to.be.equal(path.join(baseDir, "baz"));
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("should return the destination dir", async () => {
|
|
70
|
+
const destDir2 = await getDestinationDir(path.join(baseDir, "baz"));
|
|
71
|
+
|
|
72
|
+
expect(destDir2).to.be.equal(path.join(baseDir, "baz"));
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("should throw exception", async () => {
|
|
76
|
+
await fs.writeFile(path.join(baseDir, "baz", "tmp.txt"), "");
|
|
77
|
+
|
|
78
|
+
let ex = false;
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
await getDestinationDir(path.join(baseDir, "baz"));
|
|
82
|
+
|
|
83
|
+
console.log("never");
|
|
84
|
+
} catch {
|
|
85
|
+
ex = true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
expect(ex).to.be.equal(true);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
describe("get repository url", () => {
|
|
93
|
+
it("should return the repository url", () => {
|
|
94
|
+
expect(getRepositoryUrl()).to.be.not.equal("");
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
after(async () => {
|
|
99
|
+
await fs.remove(baseDir);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { describe, it } from "mocha";
|
|
2
|
+
import { expect } from "chai";
|
|
3
|
+
import { camelize, capitalize, dash } from "../src/utils/string-utils";
|
|
4
|
+
|
|
5
|
+
describe("capitalize", () => {
|
|
6
|
+
describe("empty string", () => {
|
|
7
|
+
expect(capitalize("")).to.be.equal("");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe("lowercase string", () => {
|
|
11
|
+
it("should return capitalized string", () => {
|
|
12
|
+
expect(capitalize("test")).to.be.equal("Test");
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe("capitalized string", () => {
|
|
17
|
+
it("should return capitalized string", () => {
|
|
18
|
+
expect(capitalize("Test")).to.be.equal("Test");
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe("multiple lowercase words string", () => {
|
|
23
|
+
it("should return capitalized string, no split", () => {
|
|
24
|
+
expect(capitalize("test test")).to.be.equal("Test test");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should return capitalized string, split", () => {
|
|
28
|
+
expect(capitalize("test test", " ")).to.be.equal("TestTest");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("should return capitalized string, wrong split", () => {
|
|
32
|
+
expect(capitalize("test test", ";")).to.be.equal("Test test");
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("multiple uppercase words string", () => {
|
|
37
|
+
it("should return capitalized string, no split", () => {
|
|
38
|
+
expect(capitalize("Test Test")).to.be.equal("Test Test");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("should return capitalized string, split", () => {
|
|
42
|
+
expect(capitalize("Test Test", " ")).to.be.equal("TestTest");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("should return capitalized string, wrong split", () => {
|
|
46
|
+
expect(capitalize("Test Test", ";")).to.be.equal("Test Test");
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("camelize", () => {
|
|
52
|
+
describe("empty string", () => {
|
|
53
|
+
expect(camelize("")).to.be.equal("");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe("lowercase string", () => {
|
|
57
|
+
it("should return camelized string", () => {
|
|
58
|
+
expect(camelize("test")).to.be.equal("test");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe("uppercase string", () => {
|
|
63
|
+
it("should return camelized string", () => {
|
|
64
|
+
expect(camelize("Test")).to.be.equal("test");
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe("multiple lowercase words string", () => {
|
|
69
|
+
it("should return camelized string, no split", () => {
|
|
70
|
+
expect(camelize("test test")).to.be.equal("test test");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("should return camelized string, split", () => {
|
|
74
|
+
expect(camelize("test test", " ")).to.be.equal("testTest");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("should return camelized string, wrong split", () => {
|
|
78
|
+
expect(camelize("test test", ";")).to.be.equal("test test");
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe("multiple uppercase words string", () => {
|
|
83
|
+
it("should return camelized string, no split", () => {
|
|
84
|
+
expect(camelize("Test Test")).to.be.equal("test Test");
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("should return camelized string, split", () => {
|
|
88
|
+
expect(camelize("Test Test", " ")).to.be.equal("testTest");
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("should return camelized string, wrong split", () => {
|
|
92
|
+
expect(camelize("Test Test", ";")).to.be.equal("test Test");
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
describe("dash", () => {
|
|
98
|
+
describe("empty string", () => {
|
|
99
|
+
expect(dash("")).to.be.equal("");
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
describe("lowercase string", () => {
|
|
103
|
+
it("should return dashed string", () => {
|
|
104
|
+
expect(dash("test")).to.be.equal("test");
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe("uppercase string", () => {
|
|
109
|
+
it("should return dashed string", () => {
|
|
110
|
+
expect(dash("Test")).to.be.equal("test");
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe("capitalized word string", () => {
|
|
115
|
+
it("should return dashed string", () => {
|
|
116
|
+
expect(dash("TestTest")).to.be.equal("test-test");
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe("camelized word string", () => {
|
|
121
|
+
it("should return dashed string", () => {
|
|
122
|
+
expect(dash("testTest")).to.be.equal("test-test");
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2021",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ESNext", "ES2022", "ES2021", "ES2020", "ES2019", "ES2018", "ES2017", "ES2016", "ES2015", "DOM"],
|
|
6
|
+
"types": ["jsdom", "mocha", "chai", "node"],
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"rootDir": ".",
|
|
9
|
+
"declaration": false,
|
|
10
|
+
"removeComments": true,
|
|
11
|
+
"importHelpers": false,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noImplicitAny": true,
|
|
14
|
+
"strictNullChecks": true,
|
|
15
|
+
"alwaysStrict": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"moduleResolution": "node",
|
|
18
|
+
"allowSyntheticDefaultImports": true,
|
|
19
|
+
"esModuleInterop": true,
|
|
20
|
+
"experimentalDecorators": true,
|
|
21
|
+
"forceConsistentCasingInFileNames": true
|
|
22
|
+
},
|
|
23
|
+
"references": [{ "path": "../src" }],
|
|
24
|
+
}
|