@togatherlabs/shared-utils 1.0.5 → 1.0.7

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 (43) hide show
  1. package/dist/constants/index.js +1 -1
  2. package/dist/helpers/index.js +1 -1
  3. package/dist/index.js +3 -3
  4. package/dist/types/index.js +1 -1
  5. package/package.json +4 -21
  6. package/dist/commitlint.config.d.ts +0 -3
  7. package/dist/commitlint.config.js +0 -91
  8. package/dist/constants/index.d.ts +0 -2
  9. package/dist/constants/index.d.ts.map +0 -1
  10. package/dist/constants/sample.d.ts +0 -4
  11. package/dist/constants/sample.d.ts.map +0 -1
  12. package/dist/helpers/formatDate.d.ts +0 -2
  13. package/dist/helpers/formatDate.d.ts.map +0 -1
  14. package/dist/helpers/index.d.ts +0 -2
  15. package/dist/helpers/index.d.ts.map +0 -1
  16. package/dist/index.d.ts +0 -4
  17. package/dist/index.d.ts.map +0 -1
  18. package/dist/src/constants/index.d.ts +0 -1
  19. package/dist/src/constants/index.js +0 -1
  20. package/dist/src/constants/sample.d.ts +0 -3
  21. package/dist/src/constants/sample.js +0 -3
  22. package/dist/src/helpers/formatDate.d.ts +0 -1
  23. package/dist/src/helpers/formatDate.js +0 -10
  24. package/dist/src/helpers/index.d.ts +0 -1
  25. package/dist/src/helpers/index.js +0 -1
  26. package/dist/src/index.d.ts +0 -3
  27. package/dist/src/index.js +0 -3
  28. package/dist/src/types/index.d.ts +0 -1
  29. package/dist/src/types/index.js +0 -1
  30. package/dist/src/types/user.d.ts +0 -5
  31. package/dist/src/types/user.js +0 -1
  32. package/dist/tests/unit/constants/sample.test.d.ts +0 -1
  33. package/dist/tests/unit/constants/sample.test.js +0 -7
  34. package/dist/tests/unit/helpers/formatDate.test.d.ts +0 -1
  35. package/dist/tests/unit/helpers/formatDate.test.js +0 -18
  36. package/dist/tests/unit/index.test.d.ts +0 -1
  37. package/dist/tests/unit/index.test.js +0 -8
  38. package/dist/types/index.d.ts +0 -2
  39. package/dist/types/index.d.ts.map +0 -1
  40. package/dist/types/user.d.ts +0 -6
  41. package/dist/types/user.d.ts.map +0 -1
  42. package/dist/vitest.config.d.ts +0 -2
  43. package/dist/vitest.config.js +0 -17
@@ -1 +1 @@
1
- export * from "./sample";
1
+ export * from "./sample.js";
@@ -1 +1 @@
1
- export * from "./formatDate";
1
+ export * from "./formatDate.js";
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./constants";
2
- export * from "./helpers";
3
- export * from "./types";
1
+ export * from "./constants/index.js";
2
+ export * from "./helpers/index.js";
3
+ export * from "./types/index.js";
@@ -1 +1 @@
1
- export * from "./user";
1
+ export * from "./user.js";
package/package.json CHANGED
@@ -1,28 +1,10 @@
1
1
  {
2
2
  "name": "@togatherlabs/shared-utils",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Shared utility functions, constants, and types for ToGather microservices",
5
5
  "type": "module",
6
- "main": "dist/src/index.js",
7
- "types": "dist/src/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/src/index.js",
11
- "require": "./dist/src/index.js"
12
- },
13
- "./helpers": {
14
- "import": "./dist/src/helpers/index.js",
15
- "require": "./dist/src/helpers/index.js"
16
- },
17
- "./constants": {
18
- "import": "./dist/src/constants/index.js",
19
- "require": "./dist/src/constants/index.js"
20
- },
21
- "./types": {
22
- "import": "./dist/src/types/index.js",
23
- "require": "./dist/src/types/index.js"
24
- }
25
- },
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
26
8
  "files": [
27
9
  "dist"
28
10
  ],
@@ -40,6 +22,7 @@
40
22
  "@commitlint/config-conventional": "^20.0.0",
41
23
  "@commitlint/cz-commitlint": "^20.1.0",
42
24
  "@commitlint/types": "^20.0.0",
25
+ "@tsconfig/node22": "^22.0.2",
43
26
  "@types/node": "^24.7.2",
44
27
  "@vitest/coverage-v8": "^3.2.4",
45
28
  "@vitest/ui": "^3.2.4",
@@ -1,3 +0,0 @@
1
- import type { UserConfig } from "@commitlint/types";
2
- declare const config: UserConfig;
3
- export default config;
@@ -1,91 +0,0 @@
1
- // This config follows the project guidelines
2
- // (https://docs.google.com/document/d/1psbMtN-PIF4oBbNc_pW_mtDPPAa_yPdV_apf-wq5spM/edit?tab=t.0)
3
- const config = {
4
- extends: ["@commitlint/config-conventional"],
5
- rules: {
6
- "scope-empty": [2, "never"],
7
- "scope-max-length": [2, "always", 20],
8
- // Subject rules
9
- "subject-max-length": [2, "always", 50],
10
- "subject-case": [2, "always", "sentence-case"],
11
- "subject-full-stop": [2, "never", "."],
12
- // Body rules
13
- "body-empty": [0],
14
- "body-max-line-length": [2, "always", 72],
15
- // Footer (optional)
16
- "footer-max-line-length": [2, "always", 72],
17
- },
18
- prompt: {
19
- settings: {
20
- enableMultipleScopes: false,
21
- },
22
- messages: {
23
- skip: ":skip (press enter to skip)",
24
- max: "Max %d characters",
25
- min: "Min %d characters",
26
- emptyWarning: "This field cannot be empty",
27
- upperLimitWarning: "Character limit exceeded",
28
- lowerLimitWarning: "Too few characters",
29
- },
30
- questions: {
31
- type: {
32
- description: "Select the type of change you're committing:",
33
- enum: {
34
- feat: {
35
- description: "✨ A new feature",
36
- title: "Feature",
37
- emoji: "✨",
38
- },
39
- fix: {
40
- description: "🐛 A bug fix",
41
- title: "Bug Fix",
42
- emoji: "🐛",
43
- },
44
- docs: {
45
- description: "📚 Documentation only changes",
46
- title: "Documentation",
47
- emoji: "📚",
48
- },
49
- style: {
50
- description: "💅 Changes that do not affect code meaning (formatting, etc.)",
51
- title: "Style",
52
- emoji: "💅",
53
- },
54
- refactor: {
55
- description: "🔧 Code change that neither fixes a bug nor adds a feature",
56
- title: "Refactor",
57
- emoji: "🔧",
58
- },
59
- test: {
60
- description: "✅ Adding or updating tests",
61
- title: "Test",
62
- emoji: "✅",
63
- },
64
- chore: {
65
- description: "🛠 Maintenance tasks (e.g., tooling, dependencies)",
66
- title: "Chore",
67
- emoji: "🛠",
68
- },
69
- perf: { description: "⚡ Performance improvement", title: "Performance", emoji: "⚡" },
70
- build: {
71
- description: "🏗 Build system or dependency changes",
72
- title: "Build",
73
- emoji: "🏗",
74
- },
75
- ci: { description: "🔁 CI/CD configuration", title: "CI", emoji: "🔁" },
76
- revert: { description: "⏪ Reverts a previous commit", title: "Revert", emoji: "⏪" },
77
- },
78
- },
79
- scope: {
80
- description: "Scope of this change (e.g., auth, ui, api)",
81
- },
82
- subject: {
83
- description: "Write a short, imperative description (max 50 chars, e.g., Add login validation)",
84
- },
85
- body: {
86
- description: "Provide a detailed description of what changed, why, and how (optional)",
87
- },
88
- },
89
- },
90
- };
91
- export default config;
@@ -1,2 +0,0 @@
1
- export * from "./sample";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const SAMPLE: {
2
- Char: string;
3
- };
4
- //# sourceMappingURL=sample.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../../src/constants/sample.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;CAElB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function formatDate(date: Date, locale?: string): string;
2
- //# sourceMappingURL=formatDate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../src/helpers/formatDate.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,SAAU,GAAG,MAAM,CAU/D"}
@@ -1,2 +0,0 @@
1
- export * from "./formatDate";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from "./constants";
2
- export * from "./helpers";
3
- export * from "./types";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./sample";
@@ -1 +0,0 @@
1
- export * from "./sample";
@@ -1,3 +0,0 @@
1
- export declare const SAMPLE: {
2
- Char: string;
3
- };
@@ -1,3 +0,0 @@
1
- export const SAMPLE = {
2
- Char: "A",
3
- };
@@ -1 +0,0 @@
1
- export declare function formatDate(date: Date, locale?: string): string;
@@ -1,10 +0,0 @@
1
- export function formatDate(date, locale = "en-IN") {
2
- if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
3
- throw new Error("Invalid Date");
4
- }
5
- return date.toLocaleDateString(locale, {
6
- year: "numeric",
7
- month: "short",
8
- day: "numeric",
9
- });
10
- }
@@ -1 +0,0 @@
1
- export * from "./formatDate";
@@ -1 +0,0 @@
1
- export * from "./formatDate";
@@ -1,3 +0,0 @@
1
- export * from "./constants";
2
- export * from "./helpers";
3
- export * from "./types";
package/dist/src/index.js DELETED
@@ -1,3 +0,0 @@
1
- export * from "./constants";
2
- export * from "./helpers";
3
- export * from "./types";
@@ -1 +0,0 @@
1
- export * from "./user";
@@ -1 +0,0 @@
1
- export * from "./user";
@@ -1,5 +0,0 @@
1
- export interface UserDTO {
2
- id: string;
3
- name: string;
4
- email: string;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import * as constants from "../../../src/constants/sample";
3
- describe("sample constants", () => {
4
- it("should export constants correctly", () => {
5
- expect(constants).toBeDefined();
6
- });
7
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { formatDate } from "../../../src/helpers/formatDate";
3
- describe("formatDate helper", () => {
4
- it("should format a valid date correctly", () => {
5
- const date = new Date("2025-10-14T00:00:00Z");
6
- const formatted = formatDate(date);
7
- expect(formatted).toBe("14 Oct 2025");
8
- });
9
- it("should format date in custom locale", () => {
10
- const date = new Date("2025-10-14T00:00:00Z");
11
- const formatted = formatDate(date, "en-US");
12
- expect(formatted).toMatch(/Oct/);
13
- });
14
- it("should throw an error for invalid date", () => {
15
- // @ts-expect-error testing invalid date
16
- expect(() => formatDate("not-a-date")).toThrowError("Invalid Date");
17
- });
18
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import * as utils from "../../src";
3
- describe("index.ts", () => {
4
- it("should export all modules correctly", () => {
5
- expect(utils).toBeDefined();
6
- expect(utils.formatDate).toBeInstanceOf(Function); // Example for a helper
7
- });
8
- });
@@ -1,2 +0,0 @@
1
- export * from "./user";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -1,6 +0,0 @@
1
- export interface UserDTO {
2
- id: string;
3
- name: string;
4
- email: string;
5
- }
6
- //# sourceMappingURL=user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1,2 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
@@ -1,17 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
- export default defineConfig({
3
- test: {
4
- globals: true,
5
- environment: "node",
6
- coverage: {
7
- provider: "v8",
8
- reporter: ["text", "json", "html"],
9
- exclude: [
10
- "**/node_modules/**",
11
- "**/dist/**",
12
- "**/*.config.*",
13
- "**/commitlint.*", // Exclude config files
14
- ],
15
- },
16
- },
17
- });