@maixio/pstore 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.
- package/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +515 -0
- package/README.zh-CN.md +610 -0
- package/dist/api/batarang.d.ts +25 -0
- package/dist/api/browse.d.ts +64 -0
- package/dist/api/catalog-discovery.d.ts +40 -0
- package/dist/api/catalog-registry.d.ts +21 -0
- package/dist/api/catalog-validation.d.ts +21 -0
- package/dist/api/category-names.d.ts +2 -0
- package/dist/api/graphql.d.ts +216 -0
- package/dist/api/search.d.ts +23 -0
- package/dist/api/status.d.ts +81 -0
- package/dist/build-record.d.ts +20 -0
- package/dist/cache.d.ts +25 -0
- package/dist/cli.js +5500 -0
- package/dist/client.d.ts +47 -0
- package/dist/config.d.ts +30 -0
- package/dist/fetch.d.ts +19 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +2107 -0
- package/dist/locale.d.ts +12 -0
- package/dist/log.d.ts +31 -0
- package/dist/perf.d.ts +16 -0
- package/dist/provider.d.ts +16 -0
- package/dist/types.d.ts +253 -0
- package/dist/utils.d.ts +54 -0
- package/package.json +76 -0
package/dist/locale.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PsnLocale, LocaleInfo } from "./types.js";
|
|
2
|
+
export declare const DEFAULT_LOCALE: PsnLocale;
|
|
3
|
+
export declare const TITLE_LOCALE_PRESETS: Record<string, PsnLocale[]>;
|
|
4
|
+
export declare function isPsnLocale(value: string | undefined | null): value is PsnLocale;
|
|
5
|
+
export declare function normalizeLocale(value: string | undefined | null): PsnLocale;
|
|
6
|
+
export declare function getLocaleInfo(locale?: string | null): LocaleInfo;
|
|
7
|
+
export declare function localeToSearchParams(locale?: string | null): {
|
|
8
|
+
countryCode: string;
|
|
9
|
+
languageCode: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function localeToStorePath(locale?: string | null): string;
|
|
12
|
+
export declare function parseLocaleList(input: string | undefined | null): PsnLocale[];
|
package/dist/log.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR";
|
|
2
|
+
export interface LogEntry {
|
|
3
|
+
timestamp: string;
|
|
4
|
+
level: LogLevel;
|
|
5
|
+
module: string;
|
|
6
|
+
message: string;
|
|
7
|
+
data?: Record<string, unknown>;
|
|
8
|
+
durationMs?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Write a log entry to file.
|
|
12
|
+
*/
|
|
13
|
+
export declare function log(level: LogLevel, module: string, message: string, data?: Record<string, unknown>, durationMs?: number): void;
|
|
14
|
+
export declare const logger: {
|
|
15
|
+
debug: (module: string, msg: string, data?: Record<string, unknown>) => void;
|
|
16
|
+
info: (module: string, msg: string, data?: Record<string, unknown>, dur?: number) => void;
|
|
17
|
+
warn: (module: string, msg: string, data?: Record<string, unknown>) => void;
|
|
18
|
+
error: (module: string, msg: string, data?: Record<string, unknown>) => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Measure execution time of an async function and log it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function timedLog<T>(module: string, operation: string, fn: () => Promise<T>, data?: Record<string, unknown>): Promise<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Get log files list with sizes.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getLogFiles(): Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
size: number;
|
|
30
|
+
date: Date;
|
|
31
|
+
}>;
|
package/dist/perf.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class PerfTracer {
|
|
2
|
+
private readonly startTime;
|
|
3
|
+
private readonly spans;
|
|
4
|
+
private readonly label;
|
|
5
|
+
constructor(label?: string);
|
|
6
|
+
/** Measure the execution time of an async function. */
|
|
7
|
+
span<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
8
|
+
/** Measure the execution time of a sync function. */
|
|
9
|
+
spanSync<T>(name: string, fn: () => T): T;
|
|
10
|
+
/** Get elapsed time in ms. */
|
|
11
|
+
elapsed(): number;
|
|
12
|
+
/** Get all span durations as a plain object. */
|
|
13
|
+
getTiming(): Record<string, number>;
|
|
14
|
+
/** Print time distribution table to console. */
|
|
15
|
+
report(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LookupResult, LookupOptions } from "./types.js";
|
|
2
|
+
export interface LookupResponse {
|
|
3
|
+
result: LookupResult | null;
|
|
4
|
+
fromCache: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Look up a game by concept ID or product ID.
|
|
8
|
+
*
|
|
9
|
+
* Auto-detects ID type (conceptId = numeric, productId = alphanumeric).
|
|
10
|
+
* Runs all API requests in parallel with graceful degradation.
|
|
11
|
+
*/
|
|
12
|
+
export declare function lookupGame(id: string, options?: LookupOptions): Promise<LookupResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Clear all caches.
|
|
15
|
+
*/
|
|
16
|
+
export declare function clearCaches(): void;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
export type PsnLocale = "zh-hans-HK" | "zh-hant-HK" | "en-HK" | "zh-hant-TW" | "en-TW" | "ja-JP" | "en-US" | "en-GB" | "zh-hans-CN";
|
|
2
|
+
export interface LocaleInfo {
|
|
3
|
+
locale: PsnLocale;
|
|
4
|
+
language: string;
|
|
5
|
+
country: string;
|
|
6
|
+
region: string;
|
|
7
|
+
currency: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const LOCALE_MAP: Record<PsnLocale, LocaleInfo>;
|
|
10
|
+
/** Concept ID (numeric string, e.g. "10014149") */
|
|
11
|
+
export type ConceptId = string;
|
|
12
|
+
/** Product ID (alphanumeric with dashes, e.g. "UP1001-PPSA28420_00-NBA2K26000000000") */
|
|
13
|
+
export type ProductId = string;
|
|
14
|
+
export interface Price {
|
|
15
|
+
basePrice: string | null;
|
|
16
|
+
basePriceValue: number | null;
|
|
17
|
+
discountedPrice: string | null;
|
|
18
|
+
discountedValue: number | null;
|
|
19
|
+
discountText: string | null;
|
|
20
|
+
currencyCode: string | null;
|
|
21
|
+
endTime: string | null;
|
|
22
|
+
/** True only when the product's own list price is zero. */
|
|
23
|
+
isFree?: boolean;
|
|
24
|
+
/** True when the current CTA is included through a subscription or entitlement. */
|
|
25
|
+
isIncluded?: boolean;
|
|
26
|
+
discountPercent?: number | null;
|
|
27
|
+
}
|
|
28
|
+
export interface Sku {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
displayPrice?: string;
|
|
32
|
+
price?: number;
|
|
33
|
+
type?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface RatingDistribution {
|
|
36
|
+
percentage: string;
|
|
37
|
+
percentageRaw: number;
|
|
38
|
+
rating: number;
|
|
39
|
+
}
|
|
40
|
+
export interface StarRating {
|
|
41
|
+
averageRating: number;
|
|
42
|
+
averageRatingForDisplay?: string;
|
|
43
|
+
ratingsDistribution?: RatingDistribution[];
|
|
44
|
+
totalRatingsCount?: number;
|
|
45
|
+
}
|
|
46
|
+
export type MediaRole = "PREVIEW" | "FOUR_BY_THREE_BANNER" | "GAMEHUB_COVER_ART" | "HERO_CHARACTER" | "LOGO" | "PORTRAIT_BANNER" | "SCREENSHOT" | "MASTER" | "BACKGROUND_LAYER_ART" | "BACKGROUND" | "EDITION_KEY_ART";
|
|
47
|
+
export type MediaType = "IMAGE" | "VIDEO";
|
|
48
|
+
export interface Media {
|
|
49
|
+
role: MediaRole;
|
|
50
|
+
type: MediaType;
|
|
51
|
+
url: string;
|
|
52
|
+
}
|
|
53
|
+
export type DescriptionType = "SHORT" | "LONG" | "COMPATIBILITY_NOTICE" | "LEGAL";
|
|
54
|
+
export interface Description {
|
|
55
|
+
type: DescriptionType;
|
|
56
|
+
/** ⚠️ field is `value` NOT `text` */
|
|
57
|
+
value: string;
|
|
58
|
+
}
|
|
59
|
+
export interface Edition {
|
|
60
|
+
name: string;
|
|
61
|
+
type?: string;
|
|
62
|
+
features?: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface Product {
|
|
65
|
+
id: ProductId;
|
|
66
|
+
name: string;
|
|
67
|
+
edition?: Edition | null;
|
|
68
|
+
price?: Price;
|
|
69
|
+
localizedGenres?: {
|
|
70
|
+
value: string;
|
|
71
|
+
}[];
|
|
72
|
+
platforms?: string[];
|
|
73
|
+
skus?: Sku[];
|
|
74
|
+
storeDisplayClassification?: string;
|
|
75
|
+
topCategory?: string;
|
|
76
|
+
npTitleId?: string;
|
|
77
|
+
media?: Media[];
|
|
78
|
+
starRating?: StarRating;
|
|
79
|
+
webctas?: GameCTA[];
|
|
80
|
+
contentRating?: ContentRating | null;
|
|
81
|
+
invariantName?: string;
|
|
82
|
+
isInWishlist?: boolean;
|
|
83
|
+
isWishlistable?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface GameCTA {
|
|
86
|
+
type: string;
|
|
87
|
+
price?: Price;
|
|
88
|
+
action?: {
|
|
89
|
+
type: string;
|
|
90
|
+
param: {
|
|
91
|
+
name: string;
|
|
92
|
+
value: string;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
meta?: {
|
|
96
|
+
preOrder: boolean;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface ContentRating {
|
|
100
|
+
name?: string;
|
|
101
|
+
descriptors?: {
|
|
102
|
+
name: string;
|
|
103
|
+
authority: string;
|
|
104
|
+
}[];
|
|
105
|
+
}
|
|
106
|
+
export interface BatarangData {
|
|
107
|
+
name?: string;
|
|
108
|
+
edition?: string;
|
|
109
|
+
genres?: string[];
|
|
110
|
+
platforms?: string[];
|
|
111
|
+
classification?: string;
|
|
112
|
+
topCategory?: string;
|
|
113
|
+
starRating?: StarRating;
|
|
114
|
+
npTitleId?: string;
|
|
115
|
+
descriptions?: Description[];
|
|
116
|
+
publisherName?: string;
|
|
117
|
+
compatibilityNoticesByPlatform?: Record<string, unknown>;
|
|
118
|
+
screenLanguages?: string[];
|
|
119
|
+
spokenLanguages?: string[];
|
|
120
|
+
releaseDate?: string;
|
|
121
|
+
contentRating?: ContentRating;
|
|
122
|
+
}
|
|
123
|
+
export interface LookupResult {
|
|
124
|
+
id: ConceptId | ProductId;
|
|
125
|
+
/** Input/result object type. Mirrors PSN's conceptRetrieve/productRetrieve boundary. */
|
|
126
|
+
idType?: "concept" | "product";
|
|
127
|
+
/** Owning concept ID when known. */
|
|
128
|
+
conceptId?: ConceptId;
|
|
129
|
+
/** Product ID when the primary result is a product, or the default product for a concept. */
|
|
130
|
+
productId?: ProductId;
|
|
131
|
+
name: string;
|
|
132
|
+
locale: PsnLocale;
|
|
133
|
+
/** Localized product name from Telemetry API */
|
|
134
|
+
productName?: string;
|
|
135
|
+
/** Edition name */
|
|
136
|
+
edition?: string;
|
|
137
|
+
/** Localized genres */
|
|
138
|
+
genres?: string[];
|
|
139
|
+
/** Publisher name (from Batarang) */
|
|
140
|
+
publisher?: string;
|
|
141
|
+
/** Release date */
|
|
142
|
+
releaseDate?: string;
|
|
143
|
+
/** Price info */
|
|
144
|
+
price?: Price;
|
|
145
|
+
/** Star rating */
|
|
146
|
+
starRating?: StarRating;
|
|
147
|
+
/** Store display classification */
|
|
148
|
+
classification?: string;
|
|
149
|
+
/** Top category */
|
|
150
|
+
topCategory?: string;
|
|
151
|
+
/** Platform list */
|
|
152
|
+
platforms?: string[];
|
|
153
|
+
/** SKUs */
|
|
154
|
+
skus?: Sku[];
|
|
155
|
+
/** Description texts */
|
|
156
|
+
descriptions?: Description[];
|
|
157
|
+
/** Media resources */
|
|
158
|
+
media?: Media[];
|
|
159
|
+
/** Related product editions */
|
|
160
|
+
products?: Product[];
|
|
161
|
+
/** npTitleId */
|
|
162
|
+
npTitleId?: string;
|
|
163
|
+
/** Content rating */
|
|
164
|
+
contentRating?: ContentRating;
|
|
165
|
+
/** Source provenance for key fields */
|
|
166
|
+
sources?: LookupSources;
|
|
167
|
+
/** Performance timing info */
|
|
168
|
+
timing?: Record<string, number>;
|
|
169
|
+
/** Non-fatal source failures captured during lookup. */
|
|
170
|
+
warnings?: LookupWarning[];
|
|
171
|
+
/** Localized titles keyed by PSN locale. */
|
|
172
|
+
localizedTitles?: Partial<Record<PsnLocale, string>>;
|
|
173
|
+
/** Optional concept/default-product data for product lookups. */
|
|
174
|
+
concept?: LookupResult;
|
|
175
|
+
}
|
|
176
|
+
export interface LookupWarning {
|
|
177
|
+
source: "telemetry" | "price" | "rating" | "upsell" | "batarang" | "resolveConcept";
|
|
178
|
+
message: string;
|
|
179
|
+
}
|
|
180
|
+
export type LookupSource = "telemetry" | "rating" | "batarang" | "price" | "upsell" | "derived" | "none";
|
|
181
|
+
export interface LookupSources {
|
|
182
|
+
name: LookupSource;
|
|
183
|
+
edition: LookupSource;
|
|
184
|
+
genres: LookupSource;
|
|
185
|
+
publisher: LookupSource;
|
|
186
|
+
releaseDate: LookupSource;
|
|
187
|
+
price: LookupSource;
|
|
188
|
+
starRating: LookupSource;
|
|
189
|
+
classification: LookupSource;
|
|
190
|
+
topCategory: LookupSource;
|
|
191
|
+
platforms: LookupSource;
|
|
192
|
+
skus: LookupSource;
|
|
193
|
+
descriptions: LookupSource;
|
|
194
|
+
media: LookupSource;
|
|
195
|
+
products: LookupSource;
|
|
196
|
+
npTitleId: LookupSource;
|
|
197
|
+
contentRating: LookupSource;
|
|
198
|
+
}
|
|
199
|
+
export interface SearchResultItem {
|
|
200
|
+
id: string;
|
|
201
|
+
name: string;
|
|
202
|
+
type: "concept" | "product";
|
|
203
|
+
price?: string;
|
|
204
|
+
platforms?: string[];
|
|
205
|
+
classification?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface SearchResults {
|
|
208
|
+
items: SearchResultItem[];
|
|
209
|
+
total?: number;
|
|
210
|
+
page: number;
|
|
211
|
+
size: number;
|
|
212
|
+
locale: PsnLocale;
|
|
213
|
+
}
|
|
214
|
+
export interface CategoryResults {
|
|
215
|
+
items: SearchResultItem[];
|
|
216
|
+
total: number;
|
|
217
|
+
page: number;
|
|
218
|
+
size: number;
|
|
219
|
+
catalogId: string;
|
|
220
|
+
catalogName?: string;
|
|
221
|
+
locale: PsnLocale;
|
|
222
|
+
}
|
|
223
|
+
export interface CategoryGridParams {
|
|
224
|
+
id: string;
|
|
225
|
+
pageArgs: {
|
|
226
|
+
offset: number;
|
|
227
|
+
size: number;
|
|
228
|
+
};
|
|
229
|
+
sortBy?: string | null;
|
|
230
|
+
filterBy?: string[];
|
|
231
|
+
facetOptions?: string[];
|
|
232
|
+
maxResults?: number | null;
|
|
233
|
+
}
|
|
234
|
+
export { CATALOG_ALIASES } from "./api/catalog-registry.js";
|
|
235
|
+
export interface LookupOptions {
|
|
236
|
+
locale?: PsnLocale;
|
|
237
|
+
profile?: "default" | "title-maintenance";
|
|
238
|
+
includeTelemetry?: boolean;
|
|
239
|
+
includePrice?: boolean;
|
|
240
|
+
includeRating?: boolean;
|
|
241
|
+
includeUpsell?: boolean;
|
|
242
|
+
includeProducts?: boolean;
|
|
243
|
+
includeConcept?: boolean;
|
|
244
|
+
includeBatarang?: boolean;
|
|
245
|
+
fields?: string[];
|
|
246
|
+
titleLocales?: PsnLocale[];
|
|
247
|
+
}
|
|
248
|
+
export declare class PsnApiError extends Error {
|
|
249
|
+
readonly statusCode?: number | undefined;
|
|
250
|
+
readonly operationName?: string | undefined;
|
|
251
|
+
readonly retryAfterMs?: number | undefined;
|
|
252
|
+
constructor(message: string, statusCode?: number | undefined, operationName?: string | undefined, retryAfterMs?: number | undefined);
|
|
253
|
+
}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract concept ID from a string (numeric ID like "10014149").
|
|
3
|
+
* Returns null if the string looks like a product ID.
|
|
4
|
+
*/
|
|
5
|
+
export declare function detectIdType(id: string): "concept" | "product";
|
|
6
|
+
/**
|
|
7
|
+
* Format price value (in cents) to display string.
|
|
8
|
+
* e.g. (54800, "HKD") → "HK$548.00"
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatPrice(value: number | null, currency?: string | null): string;
|
|
11
|
+
/**
|
|
12
|
+
* Format price value for display (no currency symbol).
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatPriceValue(value: number | null, decimals?: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate discount percentage.
|
|
17
|
+
* e.g. (78900, 31560) → 60
|
|
18
|
+
*/
|
|
19
|
+
export declare function calcDiscountPercent(listPrice: number, salePrice: number): number | null;
|
|
20
|
+
/**
|
|
21
|
+
* True when the product's own list price is zero. Subscription-included paid
|
|
22
|
+
* products often report discountedValue=0 and must not be treated as free.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isFreePrice(basePriceValue?: number | null, discountedValue?: number | null): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* True when the current CTA is an entitlement/subscription inclusion rather
|
|
27
|
+
* than a normal zero-price product.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isIncludedPrice(basePriceValue?: number | null, discountedValue?: number | null, discountText?: string | null, discountedPrice?: string | null): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Strip language tags from product name.
|
|
32
|
+
* e.g. "PS5®版《NBA 2K26》 (日语, 韩语, 简体中文...)" → "PS5®版《NBA 2K26》"
|
|
33
|
+
*/
|
|
34
|
+
export declare function stripLanguageTags(name: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Classify product type based on name.
|
|
37
|
+
*/
|
|
38
|
+
export declare function classifyProductType(name: string): "edition" | "dlc" | "addon" | "currency" | "unknown";
|
|
39
|
+
/**
|
|
40
|
+
* Decode HTML entities in a string.
|
|
41
|
+
*/
|
|
42
|
+
export declare function htmlEntityDecode(str: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Strip HTML tags from a string.
|
|
45
|
+
*/
|
|
46
|
+
export declare function stripHtml(html: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Truncate text for display.
|
|
49
|
+
*/
|
|
50
|
+
export declare function truncate(text: string | null | undefined, maxLen: number): string;
|
|
51
|
+
/**
|
|
52
|
+
* Format a Date-like string to a readable display format.
|
|
53
|
+
*/
|
|
54
|
+
export declare function formatDate(dateStr?: string | null): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maixio/pstore",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Unofficial PlayStation Store CLI and SDK for querying publicly available game metadata",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"pstore": "dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md",
|
|
15
|
+
"README.zh-CN.md",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"CHANGELOG.md",
|
|
18
|
+
"package.json"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20.0.0",
|
|
29
|
+
"bun": ">=1.3.0"
|
|
30
|
+
},
|
|
31
|
+
"packageManager": "bun@1.3.11",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/maixiang-sh/pstore.git"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"playstation",
|
|
41
|
+
"playstation-store",
|
|
42
|
+
"psn",
|
|
43
|
+
"cli",
|
|
44
|
+
"game",
|
|
45
|
+
"catalog"
|
|
46
|
+
],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "bun run clean && bun run build:index && bun run build:cli && bun run build:types",
|
|
49
|
+
"clean": "rm -rf dist",
|
|
50
|
+
"build:index": "bun build src/index.ts --target=node --format=esm --outdir=dist",
|
|
51
|
+
"build:cli": "bun build src/cli.ts --target=node --format=esm --outdir=dist",
|
|
52
|
+
"build:types": "tsc -p tsconfig.types.json && bun run scripts/fix-dts-extensions.ts",
|
|
53
|
+
"prepack": "bun run build",
|
|
54
|
+
"prepublishOnly": "bun test && bun run typecheck && bun run build && bun pm pack --dry-run",
|
|
55
|
+
"lint": "biome lint src",
|
|
56
|
+
"format": "biome format --write src README.md README.zh-CN.md",
|
|
57
|
+
"lookup": "bun run src/cli.ts lookup",
|
|
58
|
+
"search": "bun run src/cli.ts search",
|
|
59
|
+
"category": "bun run src/cli.ts category",
|
|
60
|
+
"browse": "bun run src/cli.ts browse",
|
|
61
|
+
"live-smoke": "bun run src/live-smoke.ts",
|
|
62
|
+
"test:live": "bun run src/live-smoke.ts",
|
|
63
|
+
"test:live:full": "PSTORE_SMOKE_FULL=1 bun run src/live-smoke.ts",
|
|
64
|
+
"test:live:locales": "PSTORE_SMOKE_LOCALES=zh-hans-HK,en-US,ja-JP,zh-hant-TW,en-TW bun run src/live-smoke.ts",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"test": "bun test"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"commander": "^14.0.3"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@biomejs/biome": "^2.4.14",
|
|
73
|
+
"@types/bun": "latest",
|
|
74
|
+
"typescript": "^5"
|
|
75
|
+
}
|
|
76
|
+
}
|