bod 5.21.8 → 6.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.
Files changed (36) hide show
  1. package/README.md +4 -5
  2. package/dist/{commands → src/commands}/__tests__/BaseCommand.test.js +1 -0
  3. package/dist/{commands → src/commands}/__tests__/CreateCommand.test.js +7 -6
  4. package/dist/{commands → src/commands}/__tests__/InfoCommand.test.js +4 -4
  5. package/dist/{commands → src/commands}/__tests__/index.test.js +1 -0
  6. package/dist/{utils → src/utils}/__tests__/index.test.js +2 -1
  7. package/dist/vitest.config.d.ts +2 -0
  8. package/dist/vitest.config.js +20 -0
  9. package/dist/vitest.setup.d.ts +1 -0
  10. package/dist/vitest.setup.js +6 -0
  11. package/package.json +6 -6
  12. /package/dist/{bod.d.ts → src/bod.d.ts} +0 -0
  13. /package/dist/{bod.js → src/bod.js} +0 -0
  14. /package/dist/{commands → src/commands}/BaseCommand.d.ts +0 -0
  15. /package/dist/{commands → src/commands}/BaseCommand.js +0 -0
  16. /package/dist/{commands → src/commands}/CreateCommand.d.ts +0 -0
  17. /package/dist/{commands → src/commands}/CreateCommand.js +0 -0
  18. /package/dist/{commands → src/commands}/InfoCommand.d.ts +0 -0
  19. /package/dist/{commands → src/commands}/InfoCommand.js +0 -0
  20. /package/dist/{commands → src/commands}/__tests__/BaseCommand.test.d.ts +0 -0
  21. /package/dist/{commands → src/commands}/__tests__/CreateCommand.test.d.ts +0 -0
  22. /package/dist/{commands → src/commands}/__tests__/InfoCommand.test.d.ts +0 -0
  23. /package/dist/{commands → src/commands}/__tests__/index.test.d.ts +0 -0
  24. /package/dist/{commands → src/commands}/index.d.ts +0 -0
  25. /package/dist/{commands → src/commands}/index.js +0 -0
  26. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  27. /package/dist/{index.js → src/index.js} +0 -0
  28. /package/dist/{utils → src/utils}/__tests__/index.test.d.ts +0 -0
  29. /package/dist/{utils → src/utils}/console.d.ts +0 -0
  30. /package/dist/{utils → src/utils}/console.js +0 -0
  31. /package/dist/{utils → src/utils}/core.d.ts +0 -0
  32. /package/dist/{utils → src/utils}/core.js +0 -0
  33. /package/dist/{utils → src/utils}/index.d.ts +0 -0
  34. /package/dist/{utils → src/utils}/index.js +0 -0
  35. /package/dist/{utils → src/utils}/os.d.ts +0 -0
  36. /package/dist/{utils → src/utils}/os.js +0 -0
package/README.md CHANGED
@@ -8,10 +8,9 @@
8
8
  [![CDN](https://img.shields.io/npm/v/bod?label=CDN&logo=cloudflare&style=for-the-badge)](https://cdn.jsdelivr.net/npm/bod@latest/)
9
9
 
10
10
  [![CI](https://img.shields.io/github/actions/workflow/status/sabertazimi/bod/ci.yml?branch=main&style=for-the-badge&logo=github)](https://github.com/sabertazimi/bod/actions/workflows/ci.yml)
11
- [![Jest Coverage](https://img.shields.io/codecov/c/github/sabertazimi/bod?logo=codecov&style=for-the-badge)](https://codecov.io/gh/sabertazimi/bod)
12
- [![Jest Coverage](https://raw.githubusercontents.com/sabertazimi/bod/gh-pages/coverage-lines.svg)](https://github.com/sabertazimi/bod/actions/workflows/ci.yml)
11
+ [![Vitest Coverage](https://img.shields.io/codecov/c/github/sabertazimi/bod?logo=codecov&style=for-the-badge)](https://codecov.io/gh/sabertazimi/bod)
13
12
 
14
- Boilerplate CLI App - Create a new project powered by Create React App and @sabertazimi/react-scripts.
13
+ Boilerplate CLI App - Create a new project with modern tooling.
15
14
 
16
15
  ## Installation
17
16
 
@@ -37,7 +36,7 @@ Options:
37
36
  -h, --help display help for command
38
37
 
39
38
  Commands:
40
- create|c <appName> Create a new project powered by @sabertazimi/react-scripts
39
+ create|c <appName> Create a new project
41
40
  info|i Print debugging information about your environment
42
41
  help [command] display help for command
43
42
 
@@ -49,7 +48,7 @@ Commands:
49
48
  ```bash
50
49
  Usage: create|c [options] <appName>
51
50
 
52
- create a new project powered by @sabertazimi/react-scripts
51
+ Create a new project
53
52
 
54
53
  Options:
55
54
  -h, --help display help for command
@@ -1,4 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
+ import { describe, expect, it } from 'vitest';
2
3
  import BaseCommand from '../BaseCommand.js';
3
4
  const options = {
4
5
  name: 'base',
@@ -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 = jest
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 = jest.spyOn(spawn, 'sync').mockImplementation(() => {
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 = jest
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 = jest.spyOn(spawn, 'sync').mockImplementation(() => {
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 = jest
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 = jest
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(jest.fn());
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,3 +1,4 @@
1
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
1
2
  import { BaseCommand, CreateCommand, InfoCommand } from '../index.js';
2
3
  describe('commands', () => {
3
4
  let commands;
@@ -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 = jest.spyOn(program, 'parse').mockImplementation(jest.fn());
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,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
@@ -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 {};
@@ -0,0 +1,6 @@
1
+ import path from 'node:path';
2
+ import process from 'node:process';
3
+ import dotenv from 'dotenv';
4
+ dotenv.config({
5
+ path: path.resolve(process.cwd(), '.test.env'),
6
+ });
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "bod",
3
3
  "type": "module",
4
- "version": "5.21.8",
4
+ "version": "6.1.0",
5
5
  "description": "Boilerplate CLI App",
6
6
  "author": "sabertazimi <sabertazimi@gmail.com>",
7
7
  "license": "MIT",
8
- "homepage": "https://sabertazimi.github.io/bod",
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.1",
56
+ "@inquirer/prompts": "^8.1.0",
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.20.6",
70
- "type-fest": "^5.2.0"
69
+ "tsx": "^4.21.0",
70
+ "type-fest": "^5.3.1"
71
71
  },
72
- "gitHead": "74eab627b3c0388b1f96c802df1674b37d42838f"
72
+ "gitHead": "6a7723d64ab1a869cec85bf8c9f11fdb1e200ec9"
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