opensoma 0.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 (146) hide show
  1. package/.claude-plugin/README.md +145 -0
  2. package/.claude-plugin/plugin.json +23 -0
  3. package/.github/workflows/release.yml +86 -0
  4. package/.oxfmtrc.json +9 -0
  5. package/.oxlintrc.json +4 -0
  6. package/AGENTS.md +78 -0
  7. package/README.md +249 -0
  8. package/bun.lock +297 -0
  9. package/bunfig.toml +2 -0
  10. package/dist/package.json +56 -0
  11. package/dist/src/cli.d.ts +5 -0
  12. package/dist/src/cli.d.ts.map +1 -0
  13. package/dist/src/cli.js +39 -0
  14. package/dist/src/cli.js.map +1 -0
  15. package/dist/src/client.d.ts +98 -0
  16. package/dist/src/client.d.ts.map +1 -0
  17. package/dist/src/client.js +141 -0
  18. package/dist/src/client.js.map +1 -0
  19. package/dist/src/commands/auth.d.ts +3 -0
  20. package/dist/src/commands/auth.d.ts.map +1 -0
  21. package/dist/src/commands/auth.js +125 -0
  22. package/dist/src/commands/auth.js.map +1 -0
  23. package/dist/src/commands/dashboard.d.ts +3 -0
  24. package/dist/src/commands/dashboard.d.ts.map +1 -0
  25. package/dist/src/commands/dashboard.js +33 -0
  26. package/dist/src/commands/dashboard.js.map +1 -0
  27. package/dist/src/commands/event.d.ts +3 -0
  28. package/dist/src/commands/event.d.ts.map +1 -0
  29. package/dist/src/commands/event.js +58 -0
  30. package/dist/src/commands/event.js.map +1 -0
  31. package/dist/src/commands/helpers.d.ts +3 -0
  32. package/dist/src/commands/helpers.d.ts.map +1 -0
  33. package/dist/src/commands/helpers.js +12 -0
  34. package/dist/src/commands/helpers.js.map +1 -0
  35. package/dist/src/commands/index.d.ts +9 -0
  36. package/dist/src/commands/index.d.ts.map +1 -0
  37. package/dist/src/commands/index.js +9 -0
  38. package/dist/src/commands/index.js.map +1 -0
  39. package/dist/src/commands/member.d.ts +3 -0
  40. package/dist/src/commands/member.d.ts.map +1 -0
  41. package/dist/src/commands/member.js +23 -0
  42. package/dist/src/commands/member.js.map +1 -0
  43. package/dist/src/commands/mentoring.d.ts +3 -0
  44. package/dist/src/commands/mentoring.d.ts.map +1 -0
  45. package/dist/src/commands/mentoring.js +154 -0
  46. package/dist/src/commands/mentoring.js.map +1 -0
  47. package/dist/src/commands/notice.d.ts +3 -0
  48. package/dist/src/commands/notice.d.ts.map +1 -0
  49. package/dist/src/commands/notice.js +42 -0
  50. package/dist/src/commands/notice.js.map +1 -0
  51. package/dist/src/commands/room.d.ts +3 -0
  52. package/dist/src/commands/room.d.ts.map +1 -0
  53. package/dist/src/commands/room.js +79 -0
  54. package/dist/src/commands/room.js.map +1 -0
  55. package/dist/src/commands/team.d.ts +3 -0
  56. package/dist/src/commands/team.d.ts.map +1 -0
  57. package/dist/src/commands/team.js +20 -0
  58. package/dist/src/commands/team.js.map +1 -0
  59. package/dist/src/constants.d.ts +43 -0
  60. package/dist/src/constants.d.ts.map +1 -0
  61. package/dist/src/constants.js +62 -0
  62. package/dist/src/constants.js.map +1 -0
  63. package/dist/src/credential-manager.d.ts +15 -0
  64. package/dist/src/credential-manager.d.ts.map +1 -0
  65. package/dist/src/credential-manager.js +40 -0
  66. package/dist/src/credential-manager.js.map +1 -0
  67. package/dist/src/formatters.d.ts +15 -0
  68. package/dist/src/formatters.d.ts.map +1 -0
  69. package/dist/src/formatters.js +382 -0
  70. package/dist/src/formatters.js.map +1 -0
  71. package/dist/src/http.d.ts +32 -0
  72. package/dist/src/http.d.ts.map +1 -0
  73. package/dist/src/http.js +143 -0
  74. package/dist/src/http.js.map +1 -0
  75. package/dist/src/index.d.ts +7 -0
  76. package/dist/src/index.d.ts.map +1 -0
  77. package/dist/src/index.js +6 -0
  78. package/dist/src/index.js.map +1 -0
  79. package/dist/src/shared/utils/error-handler.d.ts +2 -0
  80. package/dist/src/shared/utils/error-handler.d.ts.map +1 -0
  81. package/dist/src/shared/utils/error-handler.js +7 -0
  82. package/dist/src/shared/utils/error-handler.js.map +1 -0
  83. package/dist/src/shared/utils/mentoring-params.d.ts +15 -0
  84. package/dist/src/shared/utils/mentoring-params.d.ts.map +1 -0
  85. package/dist/src/shared/utils/mentoring-params.js +39 -0
  86. package/dist/src/shared/utils/mentoring-params.js.map +1 -0
  87. package/dist/src/shared/utils/output.d.ts +2 -0
  88. package/dist/src/shared/utils/output.d.ts.map +1 -0
  89. package/dist/src/shared/utils/output.js +4 -0
  90. package/dist/src/shared/utils/output.js.map +1 -0
  91. package/dist/src/shared/utils/stderr.d.ts +5 -0
  92. package/dist/src/shared/utils/stderr.d.ts.map +1 -0
  93. package/dist/src/shared/utils/stderr.js +19 -0
  94. package/dist/src/shared/utils/stderr.js.map +1 -0
  95. package/dist/src/shared/utils/swmaestro.d.ts +33 -0
  96. package/dist/src/shared/utils/swmaestro.d.ts.map +1 -0
  97. package/dist/src/shared/utils/swmaestro.js +164 -0
  98. package/dist/src/shared/utils/swmaestro.js.map +1 -0
  99. package/dist/src/token-extractor.d.ts +23 -0
  100. package/dist/src/token-extractor.d.ts.map +1 -0
  101. package/dist/src/token-extractor.js +163 -0
  102. package/dist/src/token-extractor.js.map +1 -0
  103. package/dist/src/types.d.ts +176 -0
  104. package/dist/src/types.d.ts.map +1 -0
  105. package/dist/src/types.js +110 -0
  106. package/dist/src/types.js.map +1 -0
  107. package/e2e/.gitkeep +0 -0
  108. package/package.json +56 -0
  109. package/scripts/postbuild.ts +11 -0
  110. package/scripts/prepublish.ts +9 -0
  111. package/scripts/test.ts +82 -0
  112. package/skills/opensoma/SKILL.md +345 -0
  113. package/skills/opensoma/references/common-patterns.md +182 -0
  114. package/skills/opensoma/references/output-format.md +130 -0
  115. package/src/cli.ts +57 -0
  116. package/src/client.test.ts +210 -0
  117. package/src/client.ts +264 -0
  118. package/src/commands/auth.ts +153 -0
  119. package/src/commands/dashboard.ts +39 -0
  120. package/src/commands/event.ts +74 -0
  121. package/src/commands/helpers.ts +12 -0
  122. package/src/commands/index.ts +8 -0
  123. package/src/commands/member.ts +29 -0
  124. package/src/commands/mentoring.ts +209 -0
  125. package/src/commands/notice.ts +56 -0
  126. package/src/commands/room.ts +102 -0
  127. package/src/commands/team.ts +26 -0
  128. package/src/constants.ts +70 -0
  129. package/src/credential-manager.test.ts +66 -0
  130. package/src/credential-manager.ts +52 -0
  131. package/src/formatters.test.ts +382 -0
  132. package/src/formatters.ts +489 -0
  133. package/src/http.test.ts +152 -0
  134. package/src/http.ts +196 -0
  135. package/src/index.ts +6 -0
  136. package/src/shared/utils/error-handler.ts +7 -0
  137. package/src/shared/utils/mentoring-params.test.ts +112 -0
  138. package/src/shared/utils/mentoring-params.ts +57 -0
  139. package/src/shared/utils/output.ts +3 -0
  140. package/src/shared/utils/stderr.ts +23 -0
  141. package/src/shared/utils/swmaestro.ts +218 -0
  142. package/src/token-extractor.test.ts +119 -0
  143. package/src/token-extractor.ts +205 -0
  144. package/src/types.test.ts +172 -0
  145. package/src/types.ts +134 -0
  146. package/tsconfig.json +38 -0
@@ -0,0 +1,176 @@
1
+ import { z } from 'zod/v4';
2
+ export declare const MentoringListItemSchema: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ title: z.ZodString;
5
+ type: z.ZodEnum<{
6
+ "\uC790\uC720 \uBA58\uD1A0\uB9C1": "자유 멘토링";
7
+ "\uBA58\uD1A0 \uD2B9\uAC15": "멘토 특강";
8
+ }>;
9
+ registrationPeriod: z.ZodObject<{
10
+ start: z.ZodString;
11
+ end: z.ZodString;
12
+ }, z.core.$strip>;
13
+ sessionDate: z.ZodString;
14
+ sessionTime: z.ZodObject<{
15
+ start: z.ZodString;
16
+ end: z.ZodString;
17
+ }, z.core.$strip>;
18
+ attendees: z.ZodObject<{
19
+ current: z.ZodNumber;
20
+ max: z.ZodNumber;
21
+ }, z.core.$strip>;
22
+ approved: z.ZodBoolean;
23
+ status: z.ZodEnum<{
24
+ 접수중: "접수중";
25
+ 마감: "마감";
26
+ }>;
27
+ author: z.ZodString;
28
+ createdAt: z.ZodString;
29
+ }, z.core.$strip>;
30
+ export type MentoringListItem = z.infer<typeof MentoringListItemSchema>;
31
+ export declare const MentoringDetailSchema: z.ZodObject<{
32
+ id: z.ZodNumber;
33
+ title: z.ZodString;
34
+ type: z.ZodEnum<{
35
+ "\uC790\uC720 \uBA58\uD1A0\uB9C1": "자유 멘토링";
36
+ "\uBA58\uD1A0 \uD2B9\uAC15": "멘토 특강";
37
+ }>;
38
+ registrationPeriod: z.ZodObject<{
39
+ start: z.ZodString;
40
+ end: z.ZodString;
41
+ }, z.core.$strip>;
42
+ sessionDate: z.ZodString;
43
+ sessionTime: z.ZodObject<{
44
+ start: z.ZodString;
45
+ end: z.ZodString;
46
+ }, z.core.$strip>;
47
+ attendees: z.ZodObject<{
48
+ current: z.ZodNumber;
49
+ max: z.ZodNumber;
50
+ }, z.core.$strip>;
51
+ approved: z.ZodBoolean;
52
+ status: z.ZodEnum<{
53
+ 접수중: "접수중";
54
+ 마감: "마감";
55
+ }>;
56
+ author: z.ZodString;
57
+ createdAt: z.ZodString;
58
+ content: z.ZodString;
59
+ venue: z.ZodString;
60
+ }, z.core.$strip>;
61
+ export type MentoringDetail = z.infer<typeof MentoringDetailSchema>;
62
+ export declare const RoomCardSchema: z.ZodObject<{
63
+ itemId: z.ZodNumber;
64
+ name: z.ZodString;
65
+ capacity: z.ZodNumber;
66
+ availablePeriod: z.ZodObject<{
67
+ start: z.ZodString;
68
+ end: z.ZodString;
69
+ }, z.core.$strip>;
70
+ description: z.ZodString;
71
+ timeSlots: z.ZodArray<z.ZodObject<{
72
+ time: z.ZodString;
73
+ available: z.ZodBoolean;
74
+ }, z.core.$strip>>;
75
+ }, z.core.$strip>;
76
+ export type RoomCard = z.infer<typeof RoomCardSchema>;
77
+ export declare const DashboardSchema: z.ZodObject<{
78
+ name: z.ZodString;
79
+ role: z.ZodString;
80
+ organization: z.ZodString;
81
+ position: z.ZodString;
82
+ team: z.ZodOptional<z.ZodObject<{
83
+ name: z.ZodString;
84
+ members: z.ZodString;
85
+ mentor: z.ZodString;
86
+ }, z.core.$strip>>;
87
+ mentoringSessions: z.ZodArray<z.ZodObject<{
88
+ title: z.ZodString;
89
+ url: z.ZodString;
90
+ status: z.ZodString;
91
+ }, z.core.$strip>>;
92
+ roomReservations: z.ZodArray<z.ZodObject<{
93
+ title: z.ZodString;
94
+ url: z.ZodString;
95
+ status: z.ZodString;
96
+ }, z.core.$strip>>;
97
+ }, z.core.$strip>;
98
+ export type Dashboard = z.infer<typeof DashboardSchema>;
99
+ export declare const NoticeListItemSchema: z.ZodObject<{
100
+ id: z.ZodNumber;
101
+ title: z.ZodString;
102
+ author: z.ZodString;
103
+ createdAt: z.ZodString;
104
+ }, z.core.$strip>;
105
+ export type NoticeListItem = z.infer<typeof NoticeListItemSchema>;
106
+ export declare const NoticeDetailSchema: z.ZodObject<{
107
+ id: z.ZodNumber;
108
+ title: z.ZodString;
109
+ author: z.ZodString;
110
+ createdAt: z.ZodString;
111
+ content: z.ZodString;
112
+ }, z.core.$strip>;
113
+ export type NoticeDetail = z.infer<typeof NoticeDetailSchema>;
114
+ export declare const TeamInfoSchema: z.ZodObject<{
115
+ teams: z.ZodArray<z.ZodObject<{
116
+ name: z.ZodString;
117
+ memberCount: z.ZodNumber;
118
+ joinStatus: z.ZodString;
119
+ }, z.core.$strip>>;
120
+ currentTeams: z.ZodNumber;
121
+ maxTeams: z.ZodNumber;
122
+ }, z.core.$strip>;
123
+ export type TeamInfo = z.infer<typeof TeamInfoSchema>;
124
+ export declare const MemberInfoSchema: z.ZodObject<{
125
+ email: z.ZodString;
126
+ name: z.ZodString;
127
+ gender: z.ZodString;
128
+ birthDate: z.ZodString;
129
+ phone: z.ZodString;
130
+ organization: z.ZodString;
131
+ position: z.ZodString;
132
+ }, z.core.$strip>;
133
+ export type MemberInfo = z.infer<typeof MemberInfoSchema>;
134
+ export declare const EventListItemSchema: z.ZodObject<{
135
+ id: z.ZodNumber;
136
+ category: z.ZodString;
137
+ title: z.ZodString;
138
+ registrationPeriod: z.ZodObject<{
139
+ start: z.ZodString;
140
+ end: z.ZodString;
141
+ }, z.core.$strip>;
142
+ eventPeriod: z.ZodObject<{
143
+ start: z.ZodString;
144
+ end: z.ZodString;
145
+ }, z.core.$strip>;
146
+ status: z.ZodString;
147
+ createdAt: z.ZodString;
148
+ }, z.core.$strip>;
149
+ export type EventListItem = z.infer<typeof EventListItemSchema>;
150
+ export declare const ApplicationHistoryItemSchema: z.ZodObject<{
151
+ id: z.ZodNumber;
152
+ category: z.ZodString;
153
+ title: z.ZodString;
154
+ author: z.ZodString;
155
+ sessionDate: z.ZodString;
156
+ appliedAt: z.ZodString;
157
+ applicationStatus: z.ZodString;
158
+ approvalStatus: z.ZodString;
159
+ applicationDetail: z.ZodString;
160
+ note: z.ZodString;
161
+ }, z.core.$strip>;
162
+ export type ApplicationHistoryItem = z.infer<typeof ApplicationHistoryItemSchema>;
163
+ export declare const PaginationSchema: z.ZodObject<{
164
+ total: z.ZodNumber;
165
+ currentPage: z.ZodNumber;
166
+ totalPages: z.ZodNumber;
167
+ }, z.core.$strip>;
168
+ export type Pagination = z.infer<typeof PaginationSchema>;
169
+ export declare const CredentialsSchema: z.ZodObject<{
170
+ sessionCookie: z.ZodString;
171
+ csrfToken: z.ZodString;
172
+ username: z.ZodOptional<z.ZodString>;
173
+ loggedInAt: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>;
175
+ export type Credentials = z.infer<typeof CredentialsSchema>;
176
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAgB1B,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYlC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MA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B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
@@ -0,0 +1,110 @@
1
+ import { z } from 'zod/v4';
2
+ const DateRangeSchema = z.object({ start: z.string(), end: z.string() });
3
+ const TimeRangeSchema = z.object({ start: z.string(), end: z.string() });
4
+ const RoomTimeSlotSchema = z.object({ time: z.string(), available: z.boolean() });
5
+ const DashboardStatusItemSchema = z.object({
6
+ title: z.string(),
7
+ url: z.string(),
8
+ status: z.string(),
9
+ });
10
+ const TeamListItemSchema = z.object({
11
+ name: z.string(),
12
+ memberCount: z.number(),
13
+ joinStatus: z.string(),
14
+ });
15
+ export const MentoringListItemSchema = z.object({
16
+ id: z.number(),
17
+ title: z.string(),
18
+ type: z.enum(['자유 멘토링', '멘토 특강']),
19
+ registrationPeriod: DateRangeSchema,
20
+ sessionDate: z.string(),
21
+ sessionTime: TimeRangeSchema,
22
+ attendees: z.object({ current: z.number(), max: z.number() }),
23
+ approved: z.boolean(),
24
+ status: z.enum(['접수중', '마감']),
25
+ author: z.string(),
26
+ createdAt: z.string(),
27
+ });
28
+ export const MentoringDetailSchema = MentoringListItemSchema.extend({
29
+ content: z.string(),
30
+ venue: z.string(),
31
+ });
32
+ export const RoomCardSchema = z.object({
33
+ itemId: z.number(),
34
+ name: z.string(),
35
+ capacity: z.number(),
36
+ availablePeriod: DateRangeSchema,
37
+ description: z.string(),
38
+ timeSlots: z.array(RoomTimeSlotSchema),
39
+ });
40
+ export const DashboardSchema = z.object({
41
+ name: z.string(),
42
+ role: z.string(),
43
+ organization: z.string(),
44
+ position: z.string(),
45
+ team: z
46
+ .object({
47
+ name: z.string(),
48
+ members: z.string(),
49
+ mentor: z.string(),
50
+ })
51
+ .optional(),
52
+ mentoringSessions: z.array(DashboardStatusItemSchema),
53
+ roomReservations: z.array(DashboardStatusItemSchema),
54
+ });
55
+ export const NoticeListItemSchema = z.object({
56
+ id: z.number(),
57
+ title: z.string(),
58
+ author: z.string(),
59
+ createdAt: z.string(),
60
+ });
61
+ export const NoticeDetailSchema = NoticeListItemSchema.extend({
62
+ content: z.string(),
63
+ });
64
+ export const TeamInfoSchema = z.object({
65
+ teams: z.array(TeamListItemSchema),
66
+ currentTeams: z.number(),
67
+ maxTeams: z.number(),
68
+ });
69
+ export const MemberInfoSchema = z.object({
70
+ email: z.string(),
71
+ name: z.string(),
72
+ gender: z.string(),
73
+ birthDate: z.string(),
74
+ phone: z.string(),
75
+ organization: z.string(),
76
+ position: z.string(),
77
+ });
78
+ export const EventListItemSchema = z.object({
79
+ id: z.number(),
80
+ category: z.string(),
81
+ title: z.string(),
82
+ registrationPeriod: DateRangeSchema,
83
+ eventPeriod: DateRangeSchema,
84
+ status: z.string(),
85
+ createdAt: z.string(),
86
+ });
87
+ export const ApplicationHistoryItemSchema = z.object({
88
+ id: z.number(),
89
+ category: z.string(),
90
+ title: z.string(),
91
+ author: z.string(),
92
+ sessionDate: z.string(),
93
+ appliedAt: z.string(),
94
+ applicationStatus: z.string(),
95
+ approvalStatus: z.string(),
96
+ applicationDetail: z.string(),
97
+ note: z.string(),
98
+ });
99
+ export const PaginationSchema = z.object({
100
+ total: z.number(),
101
+ currentPage: z.number(),
102
+ totalPages: z.number(),
103
+ });
104
+ export const CredentialsSchema = z.object({
105
+ sessionCookie: z.string(),
106
+ csrfToken: z.string(),
107
+ username: z.string().optional(),
108
+ loggedInAt: z.string().optional(),
109
+ });
110
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,E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 "name": "opensoma",
3
+ "version": "0.1.0",
4
+ "description": "SWMaestro MyPage CLI & SDK for AI agents",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/devxoul/opensoma.git"
9
+ },
10
+ "bin": {
11
+ "opensoma": "dist/src/cli.js"
12
+ },
13
+ "type": "module",
14
+ "main": "dist/src/index.js",
15
+ "module": "dist/src/index.js",
16
+ "typesVersions": {
17
+ "*": {
18
+ ".": [
19
+ "./src/index.ts"
20
+ ]
21
+ }
22
+ },
23
+ "exports": {
24
+ "./package.json": "./package.json",
25
+ ".": {
26
+ "types": "./src/index.ts",
27
+ "default": "./src/index.ts"
28
+ }
29
+ },
30
+ "scripts": {
31
+ "build": "tsc && tsc-alias --resolve-full-paths",
32
+ "postbuild": "bun scripts/postbuild.ts",
33
+ "test": "bun scripts/test.ts",
34
+ "typecheck": "tsc --noEmit",
35
+ "lint": "oxlint",
36
+ "lint:fix": "oxlint --fix",
37
+ "format": "oxfmt --write .",
38
+ "prepublishOnly": "bun run build && bun scripts/prepublish.ts",
39
+ "postpublish": "git checkout package.json"
40
+ },
41
+ "dependencies": {
42
+ "better-sqlite3": "latest",
43
+ "commander": "latest",
44
+ "node-html-parser": "latest",
45
+ "zod": "latest"
46
+ },
47
+ "devDependencies": {
48
+ "@types/better-sqlite3": "latest",
49
+ "@types/bun": "latest",
50
+ "@types/node": "latest",
51
+ "oxfmt": "latest",
52
+ "oxlint": "latest",
53
+ "tsc-alias": "^1.8.16",
54
+ "typescript": "latest"
55
+ }
56
+ }
@@ -0,0 +1,11 @@
1
+ import { readFileSync, writeFileSync } from 'node:fs'
2
+
3
+ const cliFiles = ['dist/src/cli.js']
4
+
5
+ for (const file of cliFiles) {
6
+ const content = readFileSync(file, 'utf8')
7
+ const updated = content.replace('#!/usr/bin/env bun', '#!/usr/bin/env node')
8
+ writeFileSync(file, updated)
9
+ }
10
+
11
+ console.log(`Updated shebang in ${cliFiles.length} CLI files`)
@@ -0,0 +1,9 @@
1
+ import { readFileSync, writeFileSync } from 'node:fs'
2
+
3
+ const pkgPath = 'package.json'
4
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
5
+ for (const [name, path] of Object.entries(pkg.bin as Record<string, string>)) {
6
+ pkg.bin[name] = path.replace(/^\.\/src\//, 'dist/src/').replace(/\.ts$/, '.js')
7
+ }
8
+ writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`)
9
+ console.log('Rewrote bin paths for publish')
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env bun
2
+ // Per-file process isolation test runner.
3
+ //
4
+ // Bun's mock.module() leaks across test files (oven-sh/bun#12823)
5
+ // because mock.restore() doesn't clean up module mocks (documented).
6
+ // Running each file in its own process eliminates contamination.
7
+
8
+ import { Glob } from 'bun'
9
+
10
+ const root = 'src'
11
+ const glob = new Glob('**/*.test.ts')
12
+ const files = [...glob.scanSync(root)].sort().map((f) => `${root}/${f}`)
13
+
14
+ let totalPass = 0
15
+ let totalFail = 0
16
+ let totalExpect = 0
17
+ let failedFiles: string[] = []
18
+
19
+ const concurrency = navigator.hardwareConcurrency ?? 4
20
+ const queue = [...files]
21
+ const running = new Set<Promise<void>>()
22
+
23
+ async function runFile(file: string): Promise<void> {
24
+ const proc = Bun.spawn(['bun', 'test', file], {
25
+ stdout: 'pipe',
26
+ stderr: 'pipe',
27
+ env: process.env,
28
+ })
29
+
30
+ const [stdout, stderr] = await Promise.all([new Response(proc.stdout).text(), new Response(proc.stderr).text()])
31
+ const exitCode = await proc.exited
32
+
33
+ // eslint-disable-next-line no-control-regex
34
+ const output = (stdout + stderr).replace(/\x1b\[[0-9;]*m/g, '')
35
+ const passMatch = output.match(/(\d+) pass/)
36
+ const failMatch = output.match(/(\d+) fail/)
37
+ const expectMatch = output.match(/(\d+) expect\(\)/)
38
+
39
+ const pass = passMatch ? parseInt(passMatch[1]) : 0
40
+ const fail = failMatch ? parseInt(failMatch[1]) : exitCode !== 0 ? 1 : 0
41
+ const expect = expectMatch ? parseInt(expectMatch[1]) : 0
42
+
43
+ totalPass += pass
44
+ totalFail += fail
45
+ totalExpect += expect
46
+
47
+ if (exitCode !== 0) {
48
+ failedFiles.push(file)
49
+ process.stdout.write(stdout)
50
+ if (stderr) process.stderr.write(stderr)
51
+ }
52
+ }
53
+
54
+ while (queue.length > 0 || running.size > 0) {
55
+ while (queue.length > 0 && running.size < concurrency) {
56
+ const file = queue.shift()!
57
+ const promise = runFile(file).then(() => {
58
+ running.delete(promise)
59
+ })
60
+ running.add(promise)
61
+ }
62
+ if (running.size > 0) {
63
+ await Promise.race(running)
64
+ }
65
+ }
66
+
67
+ const totalTests = totalPass + totalFail
68
+ console.log()
69
+ if (failedFiles.length > 0) {
70
+ console.log(`\x1b[31m ${totalFail} fail\x1b[0m`)
71
+ }
72
+ console.log(` \x1b[32m${totalPass} pass\x1b[0m`)
73
+ console.log(` ${totalExpect} expect() calls`)
74
+ console.log(`Ran ${totalTests} tests across ${files.length} files.`)
75
+
76
+ if (failedFiles.length > 0) {
77
+ console.log(`\n\x1b[31mFailed files:\x1b[0m`)
78
+ for (const f of failedFiles) {
79
+ console.log(` ${f}`)
80
+ }
81
+ process.exit(1)
82
+ }