bod 5.21.8 → 6.0.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/README.md +2 -2
- package/dist/{commands → src/commands}/__tests__/BaseCommand.test.js +1 -0
- package/dist/{commands → src/commands}/__tests__/CreateCommand.test.js +7 -6
- package/dist/{commands → src/commands}/__tests__/InfoCommand.test.js +4 -4
- package/dist/{commands → src/commands}/__tests__/index.test.js +1 -0
- package/dist/{utils → src/utils}/__tests__/index.test.js +2 -1
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +20 -0
- package/dist/vitest.setup.d.ts +1 -0
- package/dist/vitest.setup.js +6 -0
- package/package.json +6 -6
- /package/dist/{bod.d.ts → src/bod.d.ts} +0 -0
- /package/dist/{bod.js → src/bod.js} +0 -0
- /package/dist/{commands → src/commands}/BaseCommand.d.ts +0 -0
- /package/dist/{commands → src/commands}/BaseCommand.js +0 -0
- /package/dist/{commands → src/commands}/CreateCommand.d.ts +0 -0
- /package/dist/{commands → src/commands}/CreateCommand.js +0 -0
- /package/dist/{commands → src/commands}/InfoCommand.d.ts +0 -0
- /package/dist/{commands → src/commands}/InfoCommand.js +0 -0
- /package/dist/{commands → src/commands}/__tests__/BaseCommand.test.d.ts +0 -0
- /package/dist/{commands → src/commands}/__tests__/CreateCommand.test.d.ts +0 -0
- /package/dist/{commands → src/commands}/__tests__/InfoCommand.test.d.ts +0 -0
- /package/dist/{commands → src/commands}/__tests__/index.test.d.ts +0 -0
- /package/dist/{commands → src/commands}/index.d.ts +0 -0
- /package/dist/{commands → src/commands}/index.js +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{utils → src/utils}/__tests__/index.test.d.ts +0 -0
- /package/dist/{utils → src/utils}/console.d.ts +0 -0
- /package/dist/{utils → src/utils}/console.js +0 -0
- /package/dist/{utils → src/utils}/core.d.ts +0 -0
- /package/dist/{utils → src/utils}/core.js +0 -0
- /package/dist/{utils → src/utils}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/index.js +0 -0
- /package/dist/{utils → src/utils}/os.d.ts +0 -0
- /package/dist/{utils → src/utils}/os.js +0 -0
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
[](https://cdn.jsdelivr.net/npm/bod@latest/)
|
|
9
9
|
|
|
10
10
|
[](https://github.com/sabertazimi/bod/actions/workflows/ci.yml)
|
|
11
|
-
[](https://codecov.io/gh/sabertazimi/bod)
|
|
12
|
+
[](https://github.com/sabertazimi/bod/actions/workflows/ci.yml)
|
|
13
13
|
|
|
14
14
|
Boilerplate CLI App - Create a new project powered by Create React App and @sabertazimi/react-scripts.
|
|
15
15
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { isCI } from 'ci-info';
|
|
3
3
|
import { sync } from 'rimraf';
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
5
|
import * as utils from '../../utils/index.js';
|
|
5
6
|
import CreateCommand from '../CreateCommand.js';
|
|
6
7
|
const { spawn } = utils;
|
|
@@ -16,10 +17,10 @@ describe('createCommand', () => {
|
|
|
16
17
|
expect(createCommand.getAlias()).toBe('c');
|
|
17
18
|
});
|
|
18
19
|
it.each(CreateCommand.TemplateActions)('should get correct command/args and invoke [select] via template choice [$name]', (_a) => __awaiter(void 0, [_a], void 0, function* ({ value }) {
|
|
19
|
-
const mockSelect =
|
|
20
|
+
const mockSelect = vi
|
|
20
21
|
.spyOn(utils, 'select')
|
|
21
22
|
.mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return value; }));
|
|
22
|
-
const mockSpawn =
|
|
23
|
+
const mockSpawn = vi.spyOn(spawn, 'sync').mockImplementation(() => {
|
|
23
24
|
return {
|
|
24
25
|
status: 0,
|
|
25
26
|
};
|
|
@@ -41,10 +42,10 @@ describe('createCommand', () => {
|
|
|
41
42
|
mockSpawn.mockRestore();
|
|
42
43
|
}));
|
|
43
44
|
it.each(CreateCommand.TemplateActions)('should throw error when exited with non zero via template choice [$name]', (_a) => __awaiter(void 0, [_a], void 0, function* ({ value }) {
|
|
44
|
-
const mockSelect =
|
|
45
|
+
const mockSelect = vi
|
|
45
46
|
.spyOn(utils, 'select')
|
|
46
47
|
.mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return value; }));
|
|
47
|
-
const mockSpawn =
|
|
48
|
+
const mockSpawn = vi.spyOn(spawn, 'sync').mockImplementation(() => {
|
|
48
49
|
return {
|
|
49
50
|
status: 1,
|
|
50
51
|
};
|
|
@@ -61,8 +62,8 @@ describe('createCommand', () => {
|
|
|
61
62
|
mockSelect.mockRestore();
|
|
62
63
|
mockSpawn.mockRestore();
|
|
63
64
|
}));
|
|
64
|
-
it.each(CreateCommand.TemplateActions)('should initialize app directory via template choice [$name]', (_a) => __awaiter(void 0, [_a], void 0, function* ({ value }) {
|
|
65
|
-
const mockSelect =
|
|
65
|
+
it.each(CreateCommand.TemplateActions)('should initialize app directory via template choice [$name]', { timeout: 120000 }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ value }) {
|
|
66
|
+
const mockSelect = vi
|
|
66
67
|
.spyOn(utils, 'select')
|
|
67
68
|
.mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return value; }));
|
|
68
69
|
const additionalOptions = value === 'vue'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
3
|
import { printer } from '../../utils/index.js';
|
|
3
4
|
import InfoCommand from '../InfoCommand.js';
|
|
4
5
|
describe('infoCommand', () => {
|
|
5
|
-
jest.setTimeout(20000);
|
|
6
6
|
it('should extends [BaseCommand] fields', () => {
|
|
7
7
|
const infoCommand = new InfoCommand();
|
|
8
8
|
expect(infoCommand.getName()).toBe('info');
|
|
@@ -10,10 +10,10 @@ describe('infoCommand', () => {
|
|
|
10
10
|
expect(infoCommand.getUsage()).toBe('info');
|
|
11
11
|
expect(infoCommand.getAlias()).toBe('i');
|
|
12
12
|
});
|
|
13
|
-
it('should print environment variables', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
-
const mockConsoleInfo =
|
|
13
|
+
it('should print environment variables', { timeout: 20000 }, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const mockConsoleInfo = vi
|
|
15
15
|
.spyOn(printer, 'info')
|
|
16
|
-
.mockImplementation(
|
|
16
|
+
.mockImplementation(vi.fn());
|
|
17
17
|
const infoCommand = new InfoCommand();
|
|
18
18
|
yield expect(infoCommand.run()).resolves.toBeUndefined();
|
|
19
19
|
expect(mockConsoleInfo).toHaveBeenCalledTimes(2);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
3
|
import { color, findPackageManager, program } from '../index.js';
|
|
3
4
|
describe('utils', () => {
|
|
4
5
|
it('should execute chalk correctly', () => {
|
|
5
6
|
expect(color('raw text')).toStrictEqual('raw text');
|
|
6
7
|
});
|
|
7
8
|
it('should execute program correctly', () => {
|
|
8
|
-
const mockParse =
|
|
9
|
+
const mockParse = vi.spyOn(program, 'parse').mockImplementation(vi.fn());
|
|
9
10
|
expect(process.env.__BOD__).toStrictEqual('__BOD__');
|
|
10
11
|
mockParse.mockRestore();
|
|
11
12
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
export default defineConfig({
|
|
3
|
+
test: {
|
|
4
|
+
environment: 'node',
|
|
5
|
+
setupFiles: ['./vitest.setup.ts'],
|
|
6
|
+
coverage: {
|
|
7
|
+
provider: 'v8',
|
|
8
|
+
reportsDirectory: './coverage',
|
|
9
|
+
},
|
|
10
|
+
exclude: [
|
|
11
|
+
'node_modules',
|
|
12
|
+
'.cache',
|
|
13
|
+
'build',
|
|
14
|
+
'dist',
|
|
15
|
+
'coverage',
|
|
16
|
+
'temp',
|
|
17
|
+
'.temp',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bod",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"description": "Boilerplate CLI App",
|
|
6
6
|
"author": "sabertazimi <sabertazimi@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"homepage": "https://
|
|
8
|
+
"homepage": "https://tazimi.dev/bod",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/sabertazimi/bod.git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"start": "pnpm dev"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@inquirer/prompts": "^8.0.
|
|
56
|
+
"@inquirer/prompts": "^8.0.2",
|
|
57
57
|
"chalk": "^4.1.2",
|
|
58
58
|
"commander": "^14.0.2",
|
|
59
59
|
"consola": "^3.4.2",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@types/envinfo": "^7.8.4",
|
|
67
67
|
"ci-info": "^4.3.1",
|
|
68
68
|
"rimraf": "^6.1.2",
|
|
69
|
-
"tsx": "^4.
|
|
70
|
-
"type-fest": "^5.
|
|
69
|
+
"tsx": "^4.21.0",
|
|
70
|
+
"type-fest": "^5.3.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "c98290e1b374fdcffa21acd39ab8dac42d8d156d"
|
|
73
73
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|