@cmflow/cli 3.2.1 → 3.4.0-alpha.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.
Files changed (221) hide show
  1. package/{.prettierrc → .oxfmtrc.json} +2 -1
  2. package/.yarn/install-state.gz +0 -0
  3. package/.yarn/releases/yarn-4.18.0.cjs +1000 -0
  4. package/.yarnrc.yml +8 -1
  5. package/README.md +66 -72
  6. package/bin/cm-checkfeatures.ts +10 -0
  7. package/bin/cm-clean.ts +10 -0
  8. package/bin/cm-config.ts +10 -0
  9. package/bin/cm-deploy.ts +10 -0
  10. package/bin/cm-expedit.ts +19 -0
  11. package/bin/cm-fetch.ts +10 -0
  12. package/bin/cm-finish.ts +10 -0
  13. package/bin/cm-jira-releases.ts +10 -0
  14. package/bin/cm-merge.ts +10 -0
  15. package/bin/cm-publish.ts +10 -0
  16. package/bin/cm-pull.ts +8 -0
  17. package/bin/cm-push.ts +10 -0
  18. package/bin/cm-rebase.ts +10 -0
  19. package/bin/{cmrelease.js → cm-release.ts} +0 -0
  20. package/bin/cm-republish.ts +10 -0
  21. package/bin/cm-start.ts +10 -0
  22. package/bin/cm.ts +40 -0
  23. package/dist/bin/cm.mjs +74985 -0
  24. package/dist/bin/cmrelease.mjs +72397 -0
  25. package/dist/cli-truncate-BmHD4ngn.mjs +152 -0
  26. package/dist/cli-truncate-CXNquMRK.mjs +152 -0
  27. package/dist/cli-truncate-DbOyuy2e.mjs +2 -0
  28. package/dist/cli-truncate-DbOyuy2e.mjs.map +1 -0
  29. package/dist/common-CwPbT3So.mjs +66 -0
  30. package/dist/common-CwPbT3So.mjs.map +1 -0
  31. package/dist/docker-clean-tags-Cd-E8IqJ.mjs +2 -0
  32. package/dist/docker-clean-tags-Cd-E8IqJ.mjs.map +1 -0
  33. package/dist/docker-publish-B0E0qYYB.mjs +2 -0
  34. package/dist/docker-publish-B0E0qYYB.mjs.map +1 -0
  35. package/dist/get-config-DoOyLztI.mjs +41 -0
  36. package/dist/get-config-DoOyLztI.mjs.map +1 -0
  37. package/dist/get-east-asian-width-Tfn8qoqd.mjs +2 -0
  38. package/dist/get-east-asian-width-Tfn8qoqd.mjs.map +1 -0
  39. package/dist/get-east-asian-width-eFfEkHwo.mjs +682 -0
  40. package/dist/log-update-B2GqeeDd.mjs +497 -0
  41. package/dist/log-update-BldA9lkm.mjs +497 -0
  42. package/dist/log-update-By8Z-mak.mjs +6 -0
  43. package/dist/log-update-By8Z-mak.mjs.map +1 -0
  44. package/dist/rolldown-runtime-B4iAMlE-.mjs +35 -0
  45. package/dist/semver-D8gwMSFO.mjs +2 -0
  46. package/dist/semver-D8gwMSFO.mjs.map +1 -0
  47. package/dist/src/index.mjs +18 -0
  48. package/dist/src/index.mjs.map +1 -0
  49. package/dist/src/semantic/core/analyze-commits.mjs +2 -0
  50. package/dist/src/semantic/core/analyze-commits.mjs.map +1 -0
  51. package/dist/src/semantic/core/conditional.mjs +2 -0
  52. package/dist/src/semantic/core/conditional.mjs.map +1 -0
  53. package/dist/src/semantic/core/exit.mjs +2 -0
  54. package/dist/src/semantic/core/exit.mjs.map +1 -0
  55. package/dist/src/semantic/core/prepare/bump-version.mjs +48 -0
  56. package/dist/src/semantic/core/prepare/bump-version.mjs.map +1 -0
  57. package/dist/src/semantic/core/prepare/commit.mjs +2 -0
  58. package/dist/src/semantic/core/prepare/commit.mjs.map +1 -0
  59. package/dist/src/semantic/core/prepare/release-info.mjs +2 -0
  60. package/dist/src/semantic/core/prepare/release-info.mjs.map +1 -0
  61. package/dist/src/semantic/core/run.mjs +2 -0
  62. package/dist/src/semantic/core/run.mjs.map +1 -0
  63. package/dist/src/semantic/core/sync-repository.mjs +2 -0
  64. package/dist/src/semantic/core/sync-repository.mjs.map +1 -0
  65. package/dist/src/semantic/core/verify-conditions.mjs +2 -0
  66. package/dist/src/semantic/core/verify-conditions.mjs.map +1 -0
  67. package/dist/src/semantic/core/verify-release.mjs +2 -0
  68. package/dist/src/semantic/core/verify-release.mjs.map +1 -0
  69. package/dist/src/semantic/docker/publish.mjs +2 -0
  70. package/dist/src/semantic/docker/publish.mjs.map +1 -0
  71. package/dist/src/semantic/docker/success.mjs +2 -0
  72. package/dist/src/semantic/docker/success.mjs.map +1 -0
  73. package/dist/strip-ansi-Aeu5cmZe.mjs +174 -0
  74. package/dist/strip-ansi-Cl0pRo-s.mjs +2 -0
  75. package/dist/strip-ansi-Cl0pRo-s.mjs.map +1 -0
  76. package/dist/wrap-ansi-BeIjar2W.mjs +2 -0
  77. package/dist/wrap-ansi-CWIezXNl.mjs +330 -0
  78. package/dist/wrap-ansi-DsMb4WnZ.mjs +9 -0
  79. package/dist/wrap-ansi-DsMb4WnZ.mjs.map +1 -0
  80. package/dist/wrap-ansi-T0rz0Urp.mjs +330 -0
  81. package/mise.toml +2 -0
  82. package/oxlint.json +25 -0
  83. package/package.json +65 -62
  84. package/release.config.mjs +6 -6
  85. package/src/commands/checkfeatures.ts +39 -0
  86. package/src/commands/clean.ts +36 -0
  87. package/src/commands/config.ts +31 -0
  88. package/src/commands/deploy.ts +39 -0
  89. package/src/commands/fetch.ts +30 -0
  90. package/src/commands/finish.ts +50 -0
  91. package/src/commands/{index.js → index.ts} +3 -0
  92. package/src/commands/jira-releases.ts +97 -0
  93. package/src/commands/merge.ts +58 -0
  94. package/src/commands/prompts/{branches.js → branches.ts} +13 -5
  95. package/src/commands/pull.ts +44 -0
  96. package/src/commands/push.ts +48 -0
  97. package/src/commands/rebase.ts +56 -0
  98. package/src/commands/republish.ts +34 -0
  99. package/src/commands/start.ts +123 -0
  100. package/src/commands/tasks/{merge-branch.js → merge-branch.ts} +18 -3
  101. package/src/commands/tasks/push-branch.ts +19 -0
  102. package/src/commands/tasks/{rebase-all-branches.js → rebase-all-branches.ts} +10 -2
  103. package/src/commands/tasks/{refresh-repository.js → refresh-repository.ts} +8 -4
  104. package/src/commands/tasks/run-test.ts +28 -0
  105. package/src/commands/tasks/{update-branch.js → update-branch.ts} +15 -9
  106. package/src/commands/tasks/{update-dependencies.js → update-dependencies.ts} +4 -3
  107. package/src/common/back/directus/{directus-flow.test.js → directus-flow.test.ts} +1 -0
  108. package/src/common/back/directus/{directus-flow.js → directus-flow.ts} +10 -2
  109. package/src/common/back/http/{http-proxy.js → http-proxy.ts} +7 -1
  110. package/src/common/back/http/{http-request.spec.js → http-request.spec.ts} +8 -7
  111. package/src/common/back/http/{http-request.js → http-request.ts} +16 -19
  112. package/src/common/back/jira/{get-sorted-releases.js → get-sorted-releases.ts} +2 -2
  113. package/src/common/back/jira/interfaces/JiraIIssue.d.ts +3 -3
  114. package/src/common/back/jira/{jira-releases.js → jira-releases.ts} +14 -3
  115. package/src/common/back/jira/{jira-request.js → jira-request.ts} +9 -1
  116. package/src/common/back/jira/{jira-search.js → jira-search.ts} +2 -2
  117. package/src/common/cli/{bun.test.js → bun.test.ts} +17 -10
  118. package/src/common/cli/{bun.js → bun.ts} +4 -4
  119. package/src/common/cli/cli.ts +127 -0
  120. package/src/common/cli/{docker.test.js → docker.test.ts} +22 -14
  121. package/src/common/cli/{docker.js → docker.ts} +6 -6
  122. package/src/common/cli/{git.test.js → git.test.ts} +19 -11
  123. package/src/common/cli/{git.js → git.ts} +24 -24
  124. package/src/common/cli/{lerna.test.js → lerna.test.ts} +18 -11
  125. package/src/common/cli/{lerna.js → lerna.ts} +4 -4
  126. package/src/common/cli/{npm.test.js → npm.test.ts} +17 -10
  127. package/src/common/cli/{npm.js → npm.ts} +4 -4
  128. package/src/common/cli/{pnpm.test.js → pnpm.test.ts} +17 -10
  129. package/src/common/cli/{pnpm.js → pnpm.ts} +4 -4
  130. package/src/common/cli/{yarn.test.js → yarn.test.ts} +17 -12
  131. package/src/common/cli/{yarn.js → yarn.ts} +4 -4
  132. package/src/common/configure-git-workspace.ts +39 -0
  133. package/src/common/{get-config.js → get-config.ts} +3 -1
  134. package/src/common/{get-package-json.js → get-package-json.ts} +1 -0
  135. package/src/common/{get-package-manager.js → get-package-manager.ts} +1 -0
  136. package/src/common/{get-release-config.js → get-release-config.ts} +1 -0
  137. package/src/common/{index.js → index.ts} +1 -0
  138. package/src/common/{run-command.test.js → run-command.test.ts} +1 -0
  139. package/src/common/run-command.ts +67 -0
  140. package/src/common/types.ts +26 -0
  141. package/src/common/vendor.d.ts +4 -0
  142. package/src/{index.js → index.ts} +5 -1
  143. package/src/semantic/core/{analyze-commits.js → analyze-commits.ts} +7 -3
  144. package/src/semantic/core/{conditional.js → conditional.ts} +16 -9
  145. package/src/semantic/core/{exit.js → exit.ts} +3 -2
  146. package/src/semantic/core/prepare/{bump-version.js → bump-version.ts} +11 -8
  147. package/src/semantic/core/prepare/{commit.js → commit.ts} +3 -2
  148. package/src/semantic/core/prepare/release-info.ts +6 -0
  149. package/src/semantic/core/{run.js → run.ts} +3 -2
  150. package/src/semantic/core/sync-repository.ts +55 -0
  151. package/src/semantic/core/{verify-conditions.js → verify-conditions.ts} +4 -3
  152. package/src/semantic/core/{verify-release.js → verify-release.ts} +2 -1
  153. package/src/semantic/docker/publish.ts +6 -0
  154. package/src/semantic/docker/{success.js → success.ts} +2 -1
  155. package/src/semantic/utils/__mock__/test1/package.json +7 -1
  156. package/src/semantic/utils/__mock__/test1/packages/a/package.json +9 -1
  157. package/src/semantic/utils/__mock__/test1/packages/b/package.json +7 -1
  158. package/src/semantic/utils/{bump-packages-version.test.js → bump-packages-version.test.ts} +1 -0
  159. package/src/semantic/utils/{bump-packages-version.js → bump-packages-version.ts} +12 -11
  160. package/src/semantic/utils/{calculate-snapshot-version.test.js → calculate-snapshot-version.test.ts} +10 -8
  161. package/src/semantic/utils/calculate-snapshot-version.ts +17 -0
  162. package/src/semantic/utils/display-package-info.ts +12 -0
  163. package/src/semantic/utils/display-release-info.ts +13 -0
  164. package/src/semantic/utils/{docker-clean-tags.test.js → docker-clean-tags.test.ts} +1 -0
  165. package/src/semantic/utils/{docker-clean-tags.js → docker-clean-tags.ts} +11 -4
  166. package/src/semantic/utils/{docker-publish.test.js → docker-publish.test.ts} +1 -0
  167. package/src/semantic/utils/{docker-publish.js → docker-publish.ts} +4 -3
  168. package/src/semantic/utils/{log-section.js → log-section.ts} +5 -1
  169. package/src/semantic/utils/{transform-writer.js → transform-writer.ts} +37 -13
  170. package/tsconfig.build.json +29 -0
  171. package/tsconfig.json +8 -32
  172. package/tsdown.config.ts +63 -0
  173. package/vitest.config.mts +4 -5
  174. package/.prettierignore +0 -5
  175. package/.yarn/releases/yarn-4.7.0.cjs +0 -935
  176. package/bin/checkfeatures.sh +0 -5
  177. package/bin/cm-clean.js +0 -8
  178. package/bin/cm-config.js +0 -15
  179. package/bin/cm-deploy.js +0 -8
  180. package/bin/cm-fetch.js +0 -12
  181. package/bin/cm-finish.js +0 -14
  182. package/bin/cm-jira-releases.js +0 -16
  183. package/bin/cm-merge.js +0 -12
  184. package/bin/cm-publish.js +0 -15
  185. package/bin/cm-push.js +0 -15
  186. package/bin/cm-rebase.js +0 -15
  187. package/bin/cm-republish.js +0 -12
  188. package/bin/cm-start.js +0 -21
  189. package/bin/cm.js +0 -27
  190. package/bin/cmexpedit.sh +0 -9
  191. package/bin/cmpull.sh +0 -7
  192. package/eslint.config.mjs +0 -67
  193. package/src/commands/clean.js +0 -29
  194. package/src/commands/config.js +0 -23
  195. package/src/commands/deploy.js +0 -34
  196. package/src/commands/fetch.js +0 -18
  197. package/src/commands/finish.js +0 -43
  198. package/src/commands/jira-releases.js +0 -62
  199. package/src/commands/merge.js +0 -41
  200. package/src/commands/push.js +0 -23
  201. package/src/commands/rebase.js +0 -35
  202. package/src/commands/republish.js +0 -21
  203. package/src/commands/start.js +0 -109
  204. package/src/commands/tasks/push-branch.js +0 -10
  205. package/src/commands/tasks/run-test.js +0 -21
  206. package/src/common/cli/cli.js +0 -110
  207. package/src/common/configure-git-workspace.js +0 -26
  208. package/src/common/run-command.js +0 -64
  209. package/src/semantic/core/prepare/release-info.js +0 -5
  210. package/src/semantic/core/sync-repository.js +0 -52
  211. package/src/semantic/docker/publish.js +0 -5
  212. package/src/semantic/utils/calculate-snapshot-version.js +0 -15
  213. package/src/semantic/utils/display-package-info.js +0 -11
  214. package/src/semantic/utils/display-release-info.js +0 -12
  215. /package/src/commands/{release.js → release.ts} +0 -0
  216. /package/src/commands/utils/{check-install.js → check-install.ts} +0 -0
  217. /package/src/common/back/jira/{jira-request.spec.js → jira-request.spec.ts} +0 -0
  218. /package/src/common/back/jira/{jira-search.spec.js → jira-search.spec.ts} +0 -0
  219. /package/src/semantic/{define-config.js → define-config.ts} +0 -0
  220. /package/src/semantic/utils/{release-rules.js → release-rules.ts} +0 -0
  221. /package/src/workflow/{index.js → index.ts} +0 -0
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import { docker } from "../../common/cli/docker.js";
2
3
  import { getConfig } from "../../common/get-config.js";
3
4
  import { dockerPublish } from "./docker-publish.js";
@@ -1,18 +1,19 @@
1
1
  import { docker } from "../../common/cli/docker.js";
2
2
  import { getConfig } from "../../common/get-config.js";
3
+ import type { SemanticContext } from "../../common/types.js";
3
4
 
4
- export async function dockerPublish(context) {
5
+ export async function dockerPublish(context: SemanticContext) {
5
6
  context.config = getConfig();
6
7
  const {
7
8
  logger,
8
9
  config: { PRODUCTION_BRANCH, DOCKER_REPOSITORY, DOCKER_HUB_ID, DOCKER_HUB_PWD }
9
10
  } = context;
10
11
 
11
- docker.login("-u", DOCKER_HUB_ID, "-p", DOCKER_HUB_PWD);
12
+ docker.login("-u", DOCKER_HUB_ID as string, "-p", DOCKER_HUB_PWD as string);
12
13
 
13
14
  const image =
14
15
  PRODUCTION_BRANCH === context.branch.name
15
- ? `${DOCKER_REPOSITORY}:${context.nextRelease.version}`
16
+ ? `${DOCKER_REPOSITORY}:${context.nextRelease?.version}`
16
17
  : `${DOCKER_REPOSITORY}:${context.branch.name}`;
17
18
  logger.info("context.branch.name : ", context.branch.name);
18
19
  logger.info("context.nextRelease.version : ", context.nextRelease && context.nextRelease.version);
@@ -1,4 +1,8 @@
1
- export function logSection(title, context) {
1
+ interface LogContext {
2
+ logger: { info: (...args: unknown[]) => void };
3
+ }
4
+
5
+ export function logSection(title: string, context: LogContext) {
2
6
  context.logger.info("-----------------------------------");
3
7
  context.logger.info(`--- ${title}`);
4
8
  context.logger.info("-----------------------------------");
@@ -1,24 +1,48 @@
1
1
  import { WORKFLOW_CONFIGURATION } from "../../workflow/index.js";
2
2
 
3
- const commitTypeMapping = WORKFLOW_CONFIGURATION.reduce((obj, { type, label }) => {
4
- return {
5
- ...obj,
6
- [type]: label
7
- };
8
- }, {});
9
-
10
- const transformCommitType = (commit) => {
3
+ type CommitTypeMapping = Record<string, string>;
4
+
5
+ const commitTypeMapping: CommitTypeMapping = WORKFLOW_CONFIGURATION.reduce(
6
+ (obj: CommitTypeMapping, { type, label }: { type: string; label: string }) => {
7
+ return {
8
+ ...obj,
9
+ [type]: label
10
+ };
11
+ },
12
+ {} as CommitTypeMapping
13
+ );
14
+
15
+ interface Commit {
16
+ type: string;
17
+ message?: string;
18
+ subject?: string;
19
+ scope?: string;
20
+ hash?: string;
21
+ shortHash?: string;
22
+ notes: Array<{ title: string }>;
23
+ references: Array<{ issue: string }>;
24
+ [key: string]: unknown;
25
+ }
26
+
27
+ interface TransformContext {
28
+ repository?: string;
29
+ host?: string;
30
+ owner?: string;
31
+ repoUrl?: string;
32
+ }
33
+
34
+ const transformCommitType = (commit: Commit): string => {
11
35
  if (commitTypeMapping[commit.type]) {
12
36
  return commitTypeMapping[commit.type];
13
37
  }
14
38
 
15
- return commitTypeMapping.default;
39
+ return commitTypeMapping["default"] ?? commit.type;
16
40
  };
17
41
 
18
- export function transformWriter(commit, context) {
42
+ export function transformWriter(commit: Commit, context: TransformContext) {
19
43
  commit = { ...commit };
20
44
 
21
- const issues = [];
45
+ const issues: string[] = [];
22
46
 
23
47
  commit.notes.forEach((note) => {
24
48
  note.title = "BREAKING CHANGES";
@@ -47,14 +71,14 @@ export function transformWriter(commit, context) {
47
71
  if (url) {
48
72
  url = `${url}/issues/`;
49
73
  // Issue URLs.
50
- commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
74
+ commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue: string) => {
51
75
  issues.push(issue);
52
76
  return `[#${issue}](${url}${issue})`;
53
77
  });
54
78
  }
55
79
  if (context.host) {
56
80
  // User URLs.
57
- commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
81
+ commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username: string) => {
58
82
  if (username.includes("/")) {
59
83
  return `@${username}`;
60
84
  }
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "target": "ESNext",
5
+ "module": "Preserve",
6
+ "moduleResolution": "Bundler",
7
+ "sourceMap": true,
8
+ "declaration": false,
9
+ "skipLibCheck": true,
10
+ "skipDefaultLibCheck": true,
11
+ "isolatedModules": true,
12
+ "noImplicitAny": true,
13
+ "strictNullChecks": true,
14
+ "strictPropertyInitialization": false,
15
+ "noUnusedLocals": false,
16
+ "noUnusedParameters": false,
17
+ "allowSyntheticDefaultImports": true,
18
+ "newLine": "LF",
19
+ "esModuleInterop": true,
20
+ "resolveJsonModule": true,
21
+ "useDefineForClassFields": false,
22
+ "lib": ["ESNext"],
23
+ "preserveConstEnums": true,
24
+ "verbatimModuleSyntax": false,
25
+ "types": ["node"]
26
+ },
27
+ "include": ["bin/**/*", "src/**/*"],
28
+ "exclude": ["node_modules", "dist"]
29
+ }
package/tsconfig.json CHANGED
@@ -1,54 +1,30 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "baseUrl": ".",
4
- "target": "esnext",
5
- "module": "NodeNext",
6
- "moduleResolution": "NodeNext",
3
+ "target": "ESNext",
4
+ "module": "Preserve",
5
+ "moduleResolution": "Bundler",
7
6
  "sourceMap": true,
8
7
  "declaration": false,
9
- "experimentalDecorators": true,
10
- "emitDecoratorMetadata": true,
11
8
  "skipLibCheck": true,
12
9
  "skipDefaultLibCheck": true,
13
10
  "isolatedModules": false,
14
- "allowJs": true,
15
- "suppressImplicitAnyIndexErrors": false,
16
11
  "noImplicitAny": true,
17
12
  "strictNullChecks": true,
13
+ "strict": true,
18
14
  "strictPropertyInitialization": false,
19
15
  "noUnusedLocals": false,
20
16
  "noUnusedParameters": false,
21
17
  "allowSyntheticDefaultImports": true,
22
- "importHelpers": true,
23
18
  "newLine": "LF",
24
19
  "noEmit": true,
25
20
  "esModuleInterop": true,
26
21
  "resolveJsonModule": true,
27
22
  "useDefineForClassFields": false,
28
- "lib": [
29
- "ESNext",
30
- "dom",
31
- "ESNext.AsyncIterable"
32
- ],
33
- "noResolve": false,
23
+ "lib": ["ESNext"],
34
24
  "preserveConstEnums": true,
35
25
  "verbatimModuleSyntax": true,
36
- "outDir": "./dist",
37
- "types": [
38
- "vitest/globals",
39
- "vitest/importMeta",
40
- "vite/client",
41
- "node",
42
- "vitest"
43
- ]
26
+ "types": ["vitest/globals", "vitest/importMeta", "node", "vitest"]
44
27
  },
45
- "include": [
46
- "vite.config.mts",
47
- "./src/**",
48
- "./src/**/*.spec.js",
49
- "./src/**/*.test.js"
50
- ],
51
- "exclude": [
52
- "node_modules"
53
- ]
28
+ "include": ["vitest.config.mts", "tsdown.config.ts", "bin/*.ts", "./src/**/*"],
29
+ "exclude": ["node_modules", "dist"]
54
30
  }
@@ -0,0 +1,63 @@
1
+ import { globbySync } from "globby";
2
+ import { defineConfig } from "tsdown";
3
+ import pkg from "./package.json" with { type: "json" };
4
+ // function shebang(): Plugin {
5
+ // return {
6
+ // name: "shebang",
7
+ // renderChunk(code, ...args) {
8
+ // console.log(":::", code);
9
+ // return { code: `#!/usr/bin/env node\n${code}` };
10
+ // }
11
+ // };
12
+ // }
13
+
14
+ const files = globbySync(["src/semantic/core/**/*.ts", "src/semantic/docker/**/*.ts"], {
15
+ cwd: process.cwd()
16
+ }).reduce((acc, file) => {
17
+ return {
18
+ ...acc,
19
+ [file.replace(/\.(js|ts)$/, "")]: file
20
+ };
21
+ }, {});
22
+
23
+ const defineOpts = {
24
+ __VERSION__: JSON.stringify(pkg.version)
25
+ };
26
+
27
+ export default defineConfig([
28
+ {
29
+ define: defineOpts,
30
+ entry: {
31
+ "bin/cm": "bin/cm.ts"
32
+ },
33
+ format: "esm",
34
+ outDir: "dist",
35
+ clean: false,
36
+ dts: false
37
+ },
38
+ {
39
+ define: defineOpts,
40
+ entry: {
41
+ "bin/cmrelease": "bin/cm-release.ts"
42
+ },
43
+ format: "esm",
44
+ outDir: "dist",
45
+ clean: false,
46
+ dts: false
47
+ // plugins: [shebang()]
48
+ },
49
+ {
50
+ define: defineOpts,
51
+ entry: {
52
+ "src/index": "src/index.ts",
53
+ // "src/datasource/index": "src/datasource/index.ts",
54
+ ...files
55
+ },
56
+ format: "esm",
57
+ outDir: "dist",
58
+ clean: true,
59
+ dts: false,
60
+ sourcemap: true,
61
+ minify: true
62
+ }
63
+ ]);
package/vitest.config.mts CHANGED
@@ -1,10 +1,9 @@
1
- // eslint-disable-next-line import/no-unresolved
2
- import { defineConfig } from 'vitest/config'
1
+ import { defineConfig } from "vitest/config";
3
2
 
4
3
  export default defineConfig({
5
4
  test: {
6
5
  globals: true,
7
- environment: 'node'
8
- // ... Specify options here.
6
+ environment: "node",
7
+ include: ["src/**/*.{spec,test}.{js,ts}", "bin/**/*.{spec,test}.{js,ts}"]
9
8
  }
10
- })
9
+ });
package/.prettierignore DELETED
@@ -1,5 +0,0 @@
1
- dist
2
- docs
3
- node_modules
4
- *-lock.json
5
- *.lock