shopify-webhook-schemas 0.1.1 → 0.1.2
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/dist/src/index.d.ts +7 -0
- package/dist/src/index.js +46 -0
- package/dist/src/scrape.d.ts +1 -0
- package/dist/src/scrape.js +367 -0
- package/package.json +7 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getPackageRootDir(): string;
|
|
2
|
+
/** Return a metadata blob from Shopify's docs describing a webhook topic */
|
|
3
|
+
export declare function metadataForWebhook(apiVersion: string, topic: string): any;
|
|
4
|
+
/** Return the inferred JSON schema describing a webhook payload */
|
|
5
|
+
export declare function schemaForWebhook(apiVersion: string, topic: string): any;
|
|
6
|
+
/** Return all the known webhook topics */
|
|
7
|
+
export declare function allTopicsForVersion(apiVersion: string): string[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.allTopicsForVersion = exports.schemaForWebhook = exports.metadataForWebhook = exports.getPackageRootDir = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
10
|
+
const loaded = { metadatas: {}, schemas: {} };
|
|
11
|
+
function getPackageRootDir() {
|
|
12
|
+
let currentDir = __dirname;
|
|
13
|
+
while (!fs_1.default.existsSync(path_1.default.join(currentDir, 'package.json'))) {
|
|
14
|
+
currentDir = path_1.default.join(currentDir, '..');
|
|
15
|
+
}
|
|
16
|
+
return currentDir;
|
|
17
|
+
}
|
|
18
|
+
exports.getPackageRootDir = getPackageRootDir;
|
|
19
|
+
const rootDir = getPackageRootDir();
|
|
20
|
+
for (const kind of ["metadatas", "schemas"]) {
|
|
21
|
+
const dir = `${rootDir}/${kind}`;
|
|
22
|
+
for (const version of fs_1.default.readdirSync(dir)) {
|
|
23
|
+
const root = {};
|
|
24
|
+
loaded[kind][version] = root;
|
|
25
|
+
const searchPath = `${dir}/${version}/`;
|
|
26
|
+
for (const file of fast_glob_1.default.sync(`${searchPath}**/*.json`)) {
|
|
27
|
+
const topic = file.replace(searchPath, "").replace(/\.json$/, "");
|
|
28
|
+
root[topic] = JSON.parse(fs_1.default.readFileSync(file, "utf-8"));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Return a metadata blob from Shopify's docs describing a webhook topic */
|
|
33
|
+
function metadataForWebhook(apiVersion, topic) {
|
|
34
|
+
return loaded.metadatas[apiVersion][topic];
|
|
35
|
+
}
|
|
36
|
+
exports.metadataForWebhook = metadataForWebhook;
|
|
37
|
+
/** Return the inferred JSON schema describing a webhook payload */
|
|
38
|
+
function schemaForWebhook(apiVersion, topic) {
|
|
39
|
+
return loaded.schemas[apiVersion][topic];
|
|
40
|
+
}
|
|
41
|
+
exports.schemaForWebhook = schemaForWebhook;
|
|
42
|
+
/** Return all the known webhook topics */
|
|
43
|
+
function allTopicsForVersion(apiVersion) {
|
|
44
|
+
return Object.keys(loaded.schemas[apiVersion]);
|
|
45
|
+
}
|
|
46
|
+
exports.allTopicsForVersion = allTopicsForVersion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const schema_infer_1 = require("@jsonhero/schema-infer");
|
|
8
|
+
const cheerio_1 = __importDefault(require("cheerio"));
|
|
9
|
+
const got_1 = __importDefault(require("got"));
|
|
10
|
+
const lodash_1 = require("lodash");
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const src_1 = require("src");
|
|
13
|
+
const startVersion = "2024-04";
|
|
14
|
+
function assert(value, message) {
|
|
15
|
+
if (!value) {
|
|
16
|
+
throw new Error(message ?? "value is not truthy");
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* This script fetches shopify's docs for all their webhook topics, and dumps json schemas for each topic inferred from the example payloads
|
|
22
|
+
*/
|
|
23
|
+
const loadRailsData = async (url) => {
|
|
24
|
+
const shopifyDocsSource = await (0, got_1.default)(url);
|
|
25
|
+
const $ = cheerio_1.default.load(shopifyDocsSource.body);
|
|
26
|
+
const scriptTag = assert($("script")
|
|
27
|
+
.toArray()
|
|
28
|
+
.find((script) => $(script).html()?.includes("window.RailsData")), "expected to find window.RailsData script tag in shopify source but couldn't");
|
|
29
|
+
const scriptText = $(scriptTag).html();
|
|
30
|
+
const jsonMatch = scriptText.match(/window\.RailsData = (\{[\s\S]*?\}\s*)\/\/\]\]/m);
|
|
31
|
+
if (!jsonMatch) {
|
|
32
|
+
throw new Error("RailsData object literal not found in script tag or is in an unexpected format");
|
|
33
|
+
}
|
|
34
|
+
return JSON.parse(jsonMatch[1]);
|
|
35
|
+
};
|
|
36
|
+
const docsWebhooksPageForVersion = (version) => `https://shopify.dev/docs/api/admin-rest/${version}/resources/webhook#event-topics`;
|
|
37
|
+
let warnings = 0;
|
|
38
|
+
const inferSchemaFromExamplePayload = (examplePayload, metadata) => {
|
|
39
|
+
const inference = (0, schema_infer_1.inferSchema)(examplePayload);
|
|
40
|
+
// build a copy of the payload and apply overrides based on the webhook name
|
|
41
|
+
const overridesPayload = (0, lodash_1.cloneDeep)(examplePayload);
|
|
42
|
+
for (const [matcher, override] of overrides) {
|
|
43
|
+
if (matcher.test(metadata.name)) {
|
|
44
|
+
for (const [key, value] of Object.entries(override)) {
|
|
45
|
+
if (key in overridesPayload && (0, lodash_1.isNull)(overridesPayload[key])) {
|
|
46
|
+
overridesPayload[key] = value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
inference.infer(overridesPayload);
|
|
52
|
+
const schema = {
|
|
53
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
54
|
+
...inference.toJSONSchema()
|
|
55
|
+
};
|
|
56
|
+
for (const [key, value] of Object.entries(schema.properties)) {
|
|
57
|
+
if ((0, lodash_1.isEqual)(value, { type: "null" })) {
|
|
58
|
+
warnings += 1;
|
|
59
|
+
console.log(`schema warning: null value found in example payload for ${metadata.name} at key ${key}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return schema;
|
|
63
|
+
};
|
|
64
|
+
const main = async () => {
|
|
65
|
+
const rootDir = (0, src_1.getPackageRootDir)();
|
|
66
|
+
const rootPage = await loadRailsData(docsWebhooksPageForVersion(startVersion));
|
|
67
|
+
const versions = (0, lodash_1.uniq)([startVersion, ...rootPage.api.selectable_versions]).filter((version) => version != "unstable");
|
|
68
|
+
for (const version of versions) {
|
|
69
|
+
const page = await loadRailsData(docsWebhooksPageForVersion(version));
|
|
70
|
+
const webhooks = assert(page.api.rest_resource.info["x-description-list"]["items"]);
|
|
71
|
+
console.log(`Loaded ${webhooks.length} webhooks for version ${version}`);
|
|
72
|
+
for (const webhook of webhooks) {
|
|
73
|
+
webhook.response = JSON.parse(webhook.response);
|
|
74
|
+
const metadataFile = path_1.default.join(rootDir, 'metadatas', version, webhook.name + ".json");
|
|
75
|
+
await fs_1.promises.mkdir(path_1.default.dirname(metadataFile), { recursive: true });
|
|
76
|
+
await fs_1.promises.writeFile(metadataFile, JSON.stringify(webhook, null, 2), "utf-8");
|
|
77
|
+
const schema = inferSchemaFromExamplePayload(webhook.response, webhook);
|
|
78
|
+
const schemaFile = path_1.default.join(rootDir, 'schemas', version, webhook.name + ".json");
|
|
79
|
+
await fs_1.promises.mkdir(path_1.default.dirname(schemaFile), { recursive: true });
|
|
80
|
+
await fs_1.promises.writeFile(schemaFile, JSON.stringify(schema, null, 2), "utf-8");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (warnings > 0) {
|
|
84
|
+
console.log(`Done with ${warnings} warnings`);
|
|
85
|
+
process.exitCode = 1;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
console.log(`Done`);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
void main();
|
|
92
|
+
const overrides = [
|
|
93
|
+
[/.+/, {
|
|
94
|
+
admin_graphql_api_id: "gid://shopify/Something/1234567890",
|
|
95
|
+
admin_graphql_api_job_id: "gid://shopify/Job/1234567890",
|
|
96
|
+
created_at: "2021-12-30T19:00:00-05:00",
|
|
97
|
+
updated_at: "2021-12-30T19:00:00-05:00",
|
|
98
|
+
address2: "Apt 123",
|
|
99
|
+
latitude: 10.1,
|
|
100
|
+
longitude: 10.1,
|
|
101
|
+
location_id: 111111,
|
|
102
|
+
}],
|
|
103
|
+
[/(app|shop)\/.+/, {
|
|
104
|
+
domain: "example.com",
|
|
105
|
+
source: "example source",
|
|
106
|
+
myshopify_domain: "example.myshopify.com",
|
|
107
|
+
google_apps_domain: "example.com",
|
|
108
|
+
google_apps_login_enabled: true,
|
|
109
|
+
password_enabled: true,
|
|
110
|
+
taxes_included: true,
|
|
111
|
+
tax_shipping: true,
|
|
112
|
+
iana_timezone: "America/New_York",
|
|
113
|
+
auto_configure_tax_inclusivity: true,
|
|
114
|
+
county_taxes: true,
|
|
115
|
+
}],
|
|
116
|
+
[/bulk_operations\/.+/, {
|
|
117
|
+
error_code: "SOME_ERROR_ENUM"
|
|
118
|
+
}],
|
|
119
|
+
[/carts\/.+/, {
|
|
120
|
+
note: "some cart note string"
|
|
121
|
+
}],
|
|
122
|
+
[/(checkouts|orders)\/.+/, {
|
|
123
|
+
gateway: "shopify_payments",
|
|
124
|
+
landing_site: "https://example.com",
|
|
125
|
+
note: "some order note",
|
|
126
|
+
referring_site: "https://example.com",
|
|
127
|
+
completed_at: "2021-12-30T19:00:00-05:00",
|
|
128
|
+
closed_at: "2021-12-30T19:00:00-05:00",
|
|
129
|
+
user_id: 11111111,
|
|
130
|
+
location_id: 22222222,
|
|
131
|
+
source_identifier: "some_source_identifier",
|
|
132
|
+
source_url: "https://example.com",
|
|
133
|
+
device_id: "some_device_id",
|
|
134
|
+
phone: "+1 (123) 456 7890",
|
|
135
|
+
sms_marketing_phone: "+1 (123) 456 7890",
|
|
136
|
+
customer_locale: "en",
|
|
137
|
+
source: "some_source",
|
|
138
|
+
total_duties: 10.11,
|
|
139
|
+
app_id: 12345,
|
|
140
|
+
browser_ip: "10.0.0.1",
|
|
141
|
+
cart_token: "some_cart_token",
|
|
142
|
+
checkout_id: 12345,
|
|
143
|
+
client_details: {
|
|
144
|
+
"accept_language": "en-US,en;q=0.9",
|
|
145
|
+
"browser_height": 800,
|
|
146
|
+
},
|
|
147
|
+
confirmation_number: "some_confirmation_number",
|
|
148
|
+
current_total_additional_fees_set: {
|
|
149
|
+
"shop_money": {
|
|
150
|
+
"amount": "0.00",
|
|
151
|
+
"currency_code": "USD"
|
|
152
|
+
},
|
|
153
|
+
"presentment_money": {
|
|
154
|
+
"amount": "0.00",
|
|
155
|
+
"currency_code": "USD"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
current_total_duties_set: {
|
|
159
|
+
"shop_money": {
|
|
160
|
+
"amount": "0.00",
|
|
161
|
+
"currency_code": "USD"
|
|
162
|
+
},
|
|
163
|
+
"presentment_money": {
|
|
164
|
+
"amount": "0.00",
|
|
165
|
+
"currency_code": "USD"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
original_total_additional_fees_set: {
|
|
169
|
+
"shop_money": {
|
|
170
|
+
"amount": "0.00",
|
|
171
|
+
"currency_code": "USD"
|
|
172
|
+
},
|
|
173
|
+
"presentment_money": {
|
|
174
|
+
"amount": "0.00",
|
|
175
|
+
"currency_code": "USD"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
original_total_duties_set: {
|
|
179
|
+
"shop_money": {
|
|
180
|
+
"amount": "0.00",
|
|
181
|
+
"currency_code": "USD"
|
|
182
|
+
},
|
|
183
|
+
"presentment_money": {
|
|
184
|
+
"amount": "0.00",
|
|
185
|
+
"currency_code": "USD"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
checkout_token: "some_checkout_token",
|
|
189
|
+
landing_site_ref: "https://example.com",
|
|
190
|
+
merchant_of_record_app_id: 12345,
|
|
191
|
+
po_number: "some_po_number",
|
|
192
|
+
processed_at: "2021-12-30T19:00:00-05:00",
|
|
193
|
+
reference: "some_reference",
|
|
194
|
+
payment_terms: "some_payment_terms",
|
|
195
|
+
reservation_token: "some_reservation_token",
|
|
196
|
+
}],
|
|
197
|
+
[/collections\/.+/, {
|
|
198
|
+
sort_order: "manual",
|
|
199
|
+
template_suffix: "some_template_suffix",
|
|
200
|
+
}],
|
|
201
|
+
[/company_locations\/.+/, {
|
|
202
|
+
buyer_experience_configuration: { pay_now_only: true }
|
|
203
|
+
}],
|
|
204
|
+
[/customers\/.+/, {
|
|
205
|
+
last_order_id: 12345,
|
|
206
|
+
multipass_identifier: "some_multipass_identifier",
|
|
207
|
+
last_order_name: "Foobar",
|
|
208
|
+
phone: "+1 (123) 456 7890",
|
|
209
|
+
sms_marketing_consent: false,
|
|
210
|
+
email_marketing_consent: false,
|
|
211
|
+
accepts_marketing_updated_at: "2021-12-30T19:00:00-05:00",
|
|
212
|
+
marketing_opt_in_level: "single_opt_in",
|
|
213
|
+
}],
|
|
214
|
+
[/customer_account_settings\/.+/, {
|
|
215
|
+
url: "https://example.com",
|
|
216
|
+
}],
|
|
217
|
+
[/customer.+consent\/.+/, {
|
|
218
|
+
phone: "+1 (123) 456 7890",
|
|
219
|
+
email_address: "test@test.com"
|
|
220
|
+
}],
|
|
221
|
+
[/disputes\/.+/, {
|
|
222
|
+
evidence_sent_on: "2021-12-30T19:00:00-05:00",
|
|
223
|
+
finalized_on: "2021-12-30T19:00:00-05:00",
|
|
224
|
+
}],
|
|
225
|
+
[/draft_orders\/.+/, {
|
|
226
|
+
invoice_sent_at: "2021-12-30T19:00:00-05:00",
|
|
227
|
+
order_id: 12345,
|
|
228
|
+
}],
|
|
229
|
+
[/fulfillment_events\/.+/, {
|
|
230
|
+
city: "Ottawa",
|
|
231
|
+
province: "ON",
|
|
232
|
+
zip: "K1P1J1",
|
|
233
|
+
address1: "150 Elgin St",
|
|
234
|
+
estimated_delivery_at: "2021-12-30T19:00:00-05:00",
|
|
235
|
+
}],
|
|
236
|
+
[/fulfillment_orders\/.+/, {
|
|
237
|
+
remaining_fulfillment_order: {
|
|
238
|
+
"id": 5859333242902,
|
|
239
|
+
"shop_id": 20978040854,
|
|
240
|
+
"order_id": 4804938989590,
|
|
241
|
+
"assigned_location_id": 67794436118,
|
|
242
|
+
"request_status": "unsubmitted",
|
|
243
|
+
"status": "open",
|
|
244
|
+
"supported_actions": [
|
|
245
|
+
"request_fulfillment",
|
|
246
|
+
"hold",
|
|
247
|
+
"move"
|
|
248
|
+
],
|
|
249
|
+
"destination": {
|
|
250
|
+
"id": 5479404371990,
|
|
251
|
+
"address1": "23 Hassall Street",
|
|
252
|
+
"address2": "",
|
|
253
|
+
"city": "Parramatta",
|
|
254
|
+
"company": null,
|
|
255
|
+
"country": "Australia",
|
|
256
|
+
"email": "",
|
|
257
|
+
"first_name": "Tyler",
|
|
258
|
+
"last_name": "Kelleher",
|
|
259
|
+
"phone": null,
|
|
260
|
+
"province": "New South Wales",
|
|
261
|
+
"zip": "2150"
|
|
262
|
+
},
|
|
263
|
+
"line_items": [
|
|
264
|
+
{
|
|
265
|
+
"id": 12675478814742,
|
|
266
|
+
"shop_id": 20978040854,
|
|
267
|
+
"fulfillment_order_id": 5859333242902,
|
|
268
|
+
"quantity": 1,
|
|
269
|
+
"line_item_id": 12553770336278,
|
|
270
|
+
"inventory_item_id": 44276125368342,
|
|
271
|
+
"fulfillable_quantity": 1,
|
|
272
|
+
"variant_id": 42182036422678
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"fulfill_at": "2022-10-13T13:00:00-04:00",
|
|
276
|
+
"fulfill_by": null,
|
|
277
|
+
"international_duties": {
|
|
278
|
+
"incoterm": "DAP"
|
|
279
|
+
},
|
|
280
|
+
"fulfillment_holds": [],
|
|
281
|
+
"delivery_method": {
|
|
282
|
+
"id": 140816351254,
|
|
283
|
+
"method_type": "shipping",
|
|
284
|
+
"min_delivery_date_time": null,
|
|
285
|
+
"max_delivery_date_time": null
|
|
286
|
+
},
|
|
287
|
+
"assigned_location": {
|
|
288
|
+
"address1": null,
|
|
289
|
+
"address2": null,
|
|
290
|
+
"city": null,
|
|
291
|
+
"country_code": "CA",
|
|
292
|
+
"location_id": 67794436118,
|
|
293
|
+
"name": "test-created-via-api-2",
|
|
294
|
+
"phone": null,
|
|
295
|
+
"province": null,
|
|
296
|
+
"zip": null
|
|
297
|
+
},
|
|
298
|
+
}
|
|
299
|
+
}],
|
|
300
|
+
[/fulfillments\/.+/, {
|
|
301
|
+
service: "manual",
|
|
302
|
+
shipment_status: "confirmed",
|
|
303
|
+
origin_address: {
|
|
304
|
+
"first_name": "Steve",
|
|
305
|
+
"address1": "123 Shipping Street",
|
|
306
|
+
"phone": "555-555-SHIP",
|
|
307
|
+
"city": "Shippington",
|
|
308
|
+
"zip": "40003",
|
|
309
|
+
"province": "Kentucky",
|
|
310
|
+
"country": "United States",
|
|
311
|
+
"last_name": "Shipper",
|
|
312
|
+
"address2": null,
|
|
313
|
+
"company": "Shipping Company",
|
|
314
|
+
"latitude": null,
|
|
315
|
+
"longitude": null,
|
|
316
|
+
"name": "Steve Shipper",
|
|
317
|
+
"country_code": "US",
|
|
318
|
+
"province_code": "KY"
|
|
319
|
+
}
|
|
320
|
+
}],
|
|
321
|
+
[/inventory_items\/.+/, {
|
|
322
|
+
cost: 10.11,
|
|
323
|
+
country_code_of_origin: "CA",
|
|
324
|
+
province_code_of_origin: "CA",
|
|
325
|
+
harmonized_system_code: "1234567890",
|
|
326
|
+
}],
|
|
327
|
+
[/inventory_levels\/.+/, {
|
|
328
|
+
available: 10,
|
|
329
|
+
}],
|
|
330
|
+
[/order_transactions\/.+/, {
|
|
331
|
+
message: "some message from the gateway",
|
|
332
|
+
user_id: 12345,
|
|
333
|
+
parent_id: 12345,
|
|
334
|
+
processed_at: "2021-12-30T19:00:00-05:00",
|
|
335
|
+
device_id: "some_device_id",
|
|
336
|
+
error_code: "SOME_ERROR_ENUM",
|
|
337
|
+
}],
|
|
338
|
+
[/orders\/risk_assessment.+/, {
|
|
339
|
+
provider_id: 12345,
|
|
340
|
+
provider_title: "whatever",
|
|
341
|
+
}],
|
|
342
|
+
[/products\/.+/, {
|
|
343
|
+
template_suffix: "something",
|
|
344
|
+
image: "gid://shopify/ProductImage/1234567890",
|
|
345
|
+
}],
|
|
346
|
+
[/refunds\/.+/, {
|
|
347
|
+
return: "unknown",
|
|
348
|
+
}],
|
|
349
|
+
[/selling_plan_groups\/.+/, {
|
|
350
|
+
app_id: 12345,
|
|
351
|
+
description: "some description",
|
|
352
|
+
position: 1
|
|
353
|
+
}],
|
|
354
|
+
[/subscription_billing_attempts\/.+/, {
|
|
355
|
+
id: 12345,
|
|
356
|
+
error_message: "some error message",
|
|
357
|
+
error_code: "some error copde",
|
|
358
|
+
}],
|
|
359
|
+
[/subscription_billing_cycle.+/, {
|
|
360
|
+
contract_edit: "some contract edit",
|
|
361
|
+
}],
|
|
362
|
+
[/tender_transactions\/.+/, {
|
|
363
|
+
user_id: 12345,
|
|
364
|
+
processed_at: "2021-12-30T19:00:00-05:00",
|
|
365
|
+
payment_details: { something: "true" },
|
|
366
|
+
}],
|
|
367
|
+
];
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shopify-webhook-schemas",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"type": "commonjs",
|
|
6
7
|
"files": [
|
|
7
8
|
"Readme.md",
|
|
8
|
-
"dist/
|
|
9
|
+
"dist/src/*",
|
|
9
10
|
"metadatas/**/*",
|
|
10
11
|
"schemas/**/*"
|
|
11
12
|
],
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
"author": "Harry Brundage",
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"devDependencies": {
|
|
17
|
+
"@arethetypeswrong/cli": "^0.15.3",
|
|
16
18
|
"@gadgetinc/eslint-config": "^0.6.1",
|
|
17
19
|
"@gadgetinc/prettier-config": "^0.4.0",
|
|
18
20
|
"@jsonhero/schema-infer": "^0.1.5",
|
|
@@ -25,6 +27,7 @@
|
|
|
25
27
|
"inflected": "^2.1.0",
|
|
26
28
|
"lodash": "^4.17.21",
|
|
27
29
|
"prettier": "^2.8.8",
|
|
30
|
+
"publint": "^0.2.7",
|
|
28
31
|
"tsx": "^4.7.3",
|
|
29
32
|
"typescript": "^5.4.5"
|
|
30
33
|
},
|
|
@@ -35,6 +38,7 @@
|
|
|
35
38
|
"typecheck": "tsc --noEmit",
|
|
36
39
|
"test": "node --import tsx --test test/*.test.ts",
|
|
37
40
|
"lint": "pnpm run lint:prettier && pnpm run lint:eslint",
|
|
41
|
+
"publint": "publint && attw --pack",
|
|
38
42
|
"lint:prettier": "prettier --check \"{spec,src}/**/*.{js,ts}\"",
|
|
39
43
|
"lint:eslint": "eslint --quiet --ext ts,tsx spec src",
|
|
40
44
|
"lint:fix": "prettier --write --check \"{spec,src}/**/*.{js,ts}\"; eslint --ext ts --fix spec src",
|