@devvit/cli 0.11.15-next-2025-05-07-2e2ff6ed9.0 → 0.11.15
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/commands/playtest.js +1 -1
- package/dist/commands/products/add.d.ts.map +1 -1
- package/dist/commands/products/add.js +6 -7
- package/dist/util/AppVersionUploader.d.ts.map +1 -1
- package/dist/util/AppVersionUploader.js +1 -2
- package/dist/util/payments/paymentsConfig.d.ts.map +1 -1
- package/dist/util/payments/paymentsConfig.js +2 -2
- package/dist/util/payments/paymentsConfig.test.js +0 -1
- package/package.json +9 -9
|
@@ -396,7 +396,7 @@ export default Playtest;
|
|
|
396
396
|
export function modifyBundleVersions(bundles, version) {
|
|
397
397
|
var _b;
|
|
398
398
|
for (const bundle of bundles) {
|
|
399
|
-
bundle.dependencies ?? (bundle.dependencies = { hostname: '', provides: [], uses: []
|
|
399
|
+
bundle.dependencies ?? (bundle.dependencies = { hostname: '', provides: [], uses: [] });
|
|
400
400
|
(_b = bundle.dependencies).actor ?? (_b.actor = { name: '', owner: '', version: '' });
|
|
401
401
|
bundle.dependencies.actor.version = version.toString();
|
|
402
402
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/products/add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/commands/products/add.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAmCvE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,cAAc;;IACpD,OAAgB,WAAW,SAAmC;IAE9D,OAAgB,QAAQ,WAItB;IAEF,OAAgB,IAAI;;MAET;IAEX,OAAgB,KAAK;;;;;;MAoCV;IAEX,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAEK,GAAG;CAkJV"}
|
|
@@ -5,7 +5,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _AddProduct_instances, _a, _AddProduct_prompt, _AddProduct_getProductsConfig, _AddProduct_getAvailableAssets;
|
|
7
7
|
import { readdir, writeFile } from 'node:fs/promises';
|
|
8
|
-
import { PRODUCTS_JSON_FILE } from '@devvit/shared-types/constants.js';
|
|
9
8
|
import { AccountingType } from '@devvit/shared-types/payments/Product.js';
|
|
10
9
|
import { Args, Flags, ux } from '@oclif/core';
|
|
11
10
|
import chalk from 'chalk';
|
|
@@ -13,7 +12,7 @@ import inquirer from 'inquirer';
|
|
|
13
12
|
import * as path from 'path';
|
|
14
13
|
import { ProjectCommand } from '../../util/commands/ProjectCommand.js';
|
|
15
14
|
import { readProducts } from '../../util/payments/paymentsConfig.js';
|
|
16
|
-
// TODO: Import these from the products.json
|
|
15
|
+
// TODO: Import these from the products.schema.json file
|
|
17
16
|
const ALLOWED_PRICES = [5, 25, 50, 100, 150, 250, 500, 1000, 2500];
|
|
18
17
|
const ACCOUNTING_TYPE_TO_LABEL = {
|
|
19
18
|
INSTANT: `Instant: ${chalk.dim('Is used immediately and disappears.')}`,
|
|
@@ -34,7 +33,7 @@ class AddProduct extends ProjectCommand {
|
|
|
34
33
|
_AddProduct_instances.add(this);
|
|
35
34
|
}
|
|
36
35
|
get productsFilePath() {
|
|
37
|
-
return path.join(this.projectRoot, 'src',
|
|
36
|
+
return path.join(this.projectRoot, 'src', 'products.json');
|
|
38
37
|
}
|
|
39
38
|
async run() {
|
|
40
39
|
const { args, flags } = await this.parse(_a);
|
|
@@ -74,7 +73,7 @@ class AddProduct extends ProjectCommand {
|
|
|
74
73
|
this.log(`Go to ${chalk.underline('https://developers.reddit.com/docs/payments/payments_add#complete-the-payment-flow')} to integrate the product into your app.`);
|
|
75
74
|
}
|
|
76
75
|
catch (error) {
|
|
77
|
-
this.error(`Failed to write
|
|
76
|
+
this.error(`Failed to write products.json:\n${error}`);
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
}
|
|
@@ -153,14 +152,14 @@ _a = AddProduct, _AddProduct_instances = new WeakSet(), _AddProduct_prompt = asy
|
|
|
153
152
|
$schema: 'https://developers.reddit.com/schema/products.json',
|
|
154
153
|
products: [],
|
|
155
154
|
};
|
|
156
|
-
ux.action.start(
|
|
155
|
+
ux.action.start('Reading products.json');
|
|
157
156
|
const products = await readProducts(this.projectRoot);
|
|
158
157
|
if (products) {
|
|
159
|
-
ux.action.stop(
|
|
158
|
+
ux.action.stop(`products.json read successfully. Found ${products.length} products.`);
|
|
160
159
|
productsJSON.products = products;
|
|
161
160
|
}
|
|
162
161
|
else {
|
|
163
|
-
ux.action.stop(
|
|
162
|
+
ux.action.stop('No products.json found. A new one will be created.');
|
|
164
163
|
}
|
|
165
164
|
return productsJSON;
|
|
166
165
|
}, _AddProduct_getAvailableAssets = async function _AddProduct_getAvailableAssets() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppVersionUploader.d.ts","sourceRoot":"","sources":["../../src/util/AppVersionUploader.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"AppVersionUploader.d.ts","sourceRoot":"","sources":["../../src/util/AppVersionUploader.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAMrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,qBAAa,kBAAkB;;gBAMjB,GAAG,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;IAK5D,aAAa,CACjB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,aAAa,CAAC;QACzB,UAAU,EAAE,iBAAiB,CAAC;KAC/B,EACD,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,cAAc,CAAC;CAgG3B"}
|
|
@@ -13,7 +13,6 @@ var _AppVersionUploader_instances, _AppVersionUploader_cmd, _AppVersionUploader_
|
|
|
13
13
|
import fsp from 'node:fs/promises';
|
|
14
14
|
import path from 'node:path';
|
|
15
15
|
import { InstallationType, } from '@devvit/protos/community.js';
|
|
16
|
-
import { PRODUCTS_JSON_FILE } from '@devvit/shared-types/constants.js';
|
|
17
16
|
import { StringUtil } from '@devvit/shared-types/StringUtil.js';
|
|
18
17
|
import { ux } from '@oclif/core';
|
|
19
18
|
import { default as glob } from 'tiny-glob';
|
|
@@ -41,7 +40,7 @@ export class AppVersionUploader {
|
|
|
41
40
|
products = await readProducts(__classPrivateFieldGet(this, _AppVersionUploader_cmd, "f").projectRoot);
|
|
42
41
|
}
|
|
43
42
|
catch (err) {
|
|
44
|
-
throw new Error(`An error occurred when reading and validating
|
|
43
|
+
throw new Error(`An error occurred when reading and validating products.json:
|
|
45
44
|
|
|
46
45
|
${StringUtil.caughtToString(err, 'message')}
|
|
47
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentsConfig.d.ts","sourceRoot":"","sources":["../../../src/util/payments/paymentsConfig.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EACf,MAAM,kEAAkE,CAAC;
|
|
1
|
+
{"version":3,"file":"paymentsConfig.d.ts","sourceRoot":"","sources":["../../../src/util/payments/paymentsConfig.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EACf,MAAM,kEAAkE,CAAC;AAI1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0CAA0C,CAAC;AAUxE,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AAEzF;;;GAGG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,CAU1F;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EACxB,QAAQ,EAAE,WAAW,EAAE,EACvB,sBAAsB,GAAE,OAAc,GACrC,cAAc,CAGhB;AAkGD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,GAAG,cAAc,CAkBpF;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAyB3D"}
|
|
@@ -3,9 +3,9 @@ import path from 'node:path';
|
|
|
3
3
|
import { Currency, Environment, PaymentProcessorDefinition, PaymentsServiceDefinition, } from '@devvit/protos/payments.js';
|
|
4
4
|
import { ASSET_DIRNAME } from '@devvit/shared-types/Assets.js';
|
|
5
5
|
import { ACTOR_SRC_DIR, PRODUCTS_JSON_FILE } from '@devvit/shared-types/constants.js';
|
|
6
|
-
import { mapAccountingTypeToProto } from '@devvit/shared-types/payments/
|
|
6
|
+
import { mapAccountingTypeToProto } from '@devvit/shared-types/payments/index.js';
|
|
7
|
+
import { validateProductsJSON } from '@devvit/shared-types/payments/productSchemaJSONValidator.js';
|
|
7
8
|
import { filterToReservedDevvitMetadataKeys } from '@devvit/shared-types/reservedDevvitMetadataKeys.js';
|
|
8
|
-
import { validateProductsJSON } from '@devvit/shared-types/schemas/productsSchemaJSONValidator.js';
|
|
9
9
|
import { imageSize } from 'image-size';
|
|
10
10
|
/**
|
|
11
11
|
* Reads Products from src/products.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/cli",
|
|
3
|
-
"version": "0.11.15
|
|
3
|
+
"version": "0.11.15",
|
|
4
4
|
"description": "Reddit's Dev Platform CLI Tool",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"author": "@reddit/dev-platform",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
},
|
|
43
43
|
"types": "dist/index.d.ts",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@devvit/build-pack": "0.11.15
|
|
45
|
+
"@devvit/build-pack": "0.11.15",
|
|
46
46
|
"@devvit/play": "0.0.45",
|
|
47
|
-
"@devvit/protos": "0.11.15
|
|
48
|
-
"@devvit/public-api": "0.11.15
|
|
49
|
-
"@devvit/shared-types": "0.11.15
|
|
47
|
+
"@devvit/protos": "0.11.15",
|
|
48
|
+
"@devvit/public-api": "0.11.15",
|
|
49
|
+
"@devvit/shared-types": "0.11.15",
|
|
50
50
|
"@improbable-eng/grpc-web": "0.15.0",
|
|
51
51
|
"@improbable-eng/grpc-web-node-http-transport": "0.15.0",
|
|
52
52
|
"@oclif/core": "2.9.4",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"date-fns": "2.29.3",
|
|
61
61
|
"file-type": "18.2.1",
|
|
62
62
|
"get-port": "6.1.2",
|
|
63
|
-
"image-size": "1.
|
|
63
|
+
"image-size": "1.1.1",
|
|
64
64
|
"inquirer": "9.1.4",
|
|
65
65
|
"isomorphic-git": "1.21.0",
|
|
66
66
|
"js-yaml": "4.1.0",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"ws": "8.18.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@devvit/repo-tools": "0.11.15
|
|
82
|
-
"@devvit/tsconfig": "0.11.15
|
|
81
|
+
"@devvit/repo-tools": "0.11.15",
|
|
82
|
+
"@devvit/tsconfig": "0.11.15",
|
|
83
83
|
"@types/file-type": "10.9.1",
|
|
84
84
|
"@types/inquirer": "9.0.3",
|
|
85
85
|
"@types/js-yaml": "4.0.5",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
]
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "df8f436b870f709549e2ede0f421a186331bb508"
|
|
124
124
|
}
|