@devvit/cli 0.11.19-next-2025-07-22-23-31-05-5dbdec031.0 → 0.11.19
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/init.d.ts.map +1 -1
- package/dist/commands/init.js +21 -9
- package/dist/util/AssetUploader.d.ts +0 -1
- package/dist/util/AssetUploader.d.ts.map +1 -1
- package/dist/util/AssetUploader.js +0 -44
- package/dist/util/AssetUploader.test.js +1 -34
- package/dist/util/Cutter.d.ts.map +1 -1
- package/dist/util/Cutter.js +10 -12
- package/dist/util/auth.d.ts.map +1 -1
- package/dist/util/auth.js +3 -3
- package/dist/util/clientGenerators.d.ts +0 -1
- package/dist/util/clientGenerators.d.ts.map +1 -1
- package/dist/util/clientGenerators.js +1 -1
- package/dist/util/payments/paymentsConfig.d.ts.map +1 -1
- package/dist/util/payments/paymentsConfig.js +1 -3
- package/dist/util/project.d.ts.map +1 -1
- package/dist/util/project.js +1 -2
- package/dist/util/template-resolvers/ProjectTemplateResolver.d.ts.map +1 -1
- package/dist/util/template-resolvers/ProjectTemplateResolver.js +1 -4
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAsBlE,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,aAAa;;IAC7C,OAAgB,WAAW,SAA0B;IAErD,OAAgB,QAAQ,WAA6C;IAErE,OAAgB,IAAI;;MAMT;IAgBI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqTpC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -17,8 +17,8 @@ import { createRequire } from 'node:module';
|
|
|
17
17
|
import path from 'node:path';
|
|
18
18
|
import querystring from 'node:querystring';
|
|
19
19
|
import util from 'node:util';
|
|
20
|
-
import { InitAppResponse } from '@devvit/protos/types/devvit/cli/init.js';
|
|
21
20
|
import { isDevvitDependency } from '@devvit/shared-types/isDevvitDependency.js';
|
|
21
|
+
import { isObject } from '@devvit/shared-types/isObject.js';
|
|
22
22
|
import { Args } from '@oclif/core';
|
|
23
23
|
import chalk from 'chalk';
|
|
24
24
|
import inquirer from 'inquirer';
|
|
@@ -141,18 +141,30 @@ _Init_initAppParams = new WeakMap(), _Init_instances = new WeakSet(), _Init_proj
|
|
|
141
141
|
// Else, we're using the app slug as the dir name
|
|
142
142
|
return path.join(process.cwd(), __classPrivateFieldGet(this, _Init_initAppParams, "f").appName);
|
|
143
143
|
}, _Init_unpackCode = function _Init_unpackCode(base64code) {
|
|
144
|
+
let token;
|
|
144
145
|
try {
|
|
145
|
-
|
|
146
|
-
const message = InitAppResponse.decode(bytes);
|
|
147
|
-
// Basic validation
|
|
148
|
-
if (!message.appName) {
|
|
149
|
-
return undefined;
|
|
150
|
-
}
|
|
151
|
-
return message;
|
|
146
|
+
token = JSON.parse(Buffer.from(base64code, 'base64').toString('utf8'));
|
|
152
147
|
}
|
|
153
148
|
catch {
|
|
154
149
|
return undefined;
|
|
155
150
|
}
|
|
151
|
+
if (!isObject(token)) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
if (!token.authCode || typeof token.authCode !== 'string') {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
if (typeof token.appName !== 'string') {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
if (typeof token.templateName !== 'string' && token.templateName !== undefined) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
authCode: token.authCode,
|
|
165
|
+
appName: token.appName,
|
|
166
|
+
templateName: token.templateName,
|
|
167
|
+
};
|
|
156
168
|
}, _Init_getCodeThroughCopyPaste = async function _Init_getCodeThroughCopyPaste() {
|
|
157
169
|
const queryParams = {
|
|
158
170
|
source: getPlatformFromEnvironment(),
|
|
@@ -205,7 +217,7 @@ _Init_initAppParams = new WeakMap(), _Init_instances = new WeakSet(), _Init_proj
|
|
|
205
217
|
}
|
|
206
218
|
return localCodeServer({
|
|
207
219
|
serverListeningCallback: ({ port, state }) => {
|
|
208
|
-
const redirectUrl = new URL(`
|
|
220
|
+
const redirectUrl = new URL(`https://localhost:${port}`);
|
|
209
221
|
redirectUrl.searchParams.set(`state`, state);
|
|
210
222
|
queryParams.redirect_url = redirectUrl.toString();
|
|
211
223
|
const creationWizardUrl = `${DEVVIT_PORTAL_URL}/new?${querystring.stringify(queryParams)}`;
|
|
@@ -21,7 +21,6 @@ export declare class AssetUploader {
|
|
|
21
21
|
* the asset map.
|
|
22
22
|
*/
|
|
23
23
|
syncAssets(): Promise<SyncAssetsResult>;
|
|
24
|
-
assertAssetCanBeAnIcon(data: Buffer): Promise<void>;
|
|
25
24
|
}
|
|
26
25
|
export declare function transformHTMLBuffer(buf: Buffer, clientVersionNum: string | undefined): Buffer;
|
|
27
26
|
export declare function transformHTML(str: string, clientVersionNum: string | undefined): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetUploader.d.ts","sourceRoot":"","sources":["../../src/util/AssetUploader.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"AssetUploader.d.ts","sourceRoot":"","sources":["../../src/util/AssetUploader.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,gCAAgC,CAAC;AASxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,eAAO,MAAM,aAAa,wDAAwD,CAAC;AACnF,eAAO,MAAM,cAAc,eAAe,CAAC;AAM3C,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,aAAa;;gBAQZ,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;IAMlF;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;CA2Q9C;AA8DD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI7F;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAuBvF"}
|
|
@@ -18,8 +18,6 @@ import { ASSET_HASHING_ALGO, ASSET_UPLOAD_BATCH_SIZE } from '@devvit/shared-type
|
|
|
18
18
|
import { clientVersionQueryParam } from '@devvit/shared-types/web-view-scripts-constants.js';
|
|
19
19
|
import { ux } from '@oclif/core';
|
|
20
20
|
import { createHash } from 'crypto';
|
|
21
|
-
import { fileTypeFromBuffer } from 'file-type';
|
|
22
|
-
import { imageSize } from 'image-size';
|
|
23
21
|
import { JSDOM } from 'jsdom';
|
|
24
22
|
import { default as tinyglob } from 'tiny-glob';
|
|
25
23
|
import { createAppClient } from './clientGenerators.js';
|
|
@@ -68,7 +66,6 @@ export class AssetUploader {
|
|
|
68
66
|
const iconAssetContents = await fsp.readFile(iconAssetFullPath);
|
|
69
67
|
const iconAssetSize = Buffer.byteLength(iconAssetContents);
|
|
70
68
|
const iconAssetHash = createHash(ASSET_HASHING_ALGO).update(iconAssetContents).digest('hex');
|
|
71
|
-
this.assertAssetCanBeAnIcon(iconAssetContents);
|
|
72
69
|
iconAssetDetails = {
|
|
73
70
|
filePath: ICON_FILE_PATH, // Use a placeholder path for the icon asset
|
|
74
71
|
size: iconAssetSize,
|
|
@@ -99,47 +96,6 @@ export class AssetUploader {
|
|
|
99
96
|
}
|
|
100
97
|
return retval;
|
|
101
98
|
}
|
|
102
|
-
async assertAssetCanBeAnIcon(data) {
|
|
103
|
-
// Verify the icon. It *must*:
|
|
104
|
-
// - NOT be a GIF
|
|
105
|
-
// - be square in shape
|
|
106
|
-
// - be at least 256x256 pixels
|
|
107
|
-
// - be at most 1024x1024 pixels
|
|
108
|
-
// If it doesn't meet these requirements, we throw an error.
|
|
109
|
-
// Also, we should warn the user in any of these cases:
|
|
110
|
-
// - if the icon isn't a PNG
|
|
111
|
-
// - if the icon is smaller than 1024x1024 pixels
|
|
112
|
-
const fileTypeResult = await fileTypeFromBuffer(data);
|
|
113
|
-
if (!fileTypeResult) {
|
|
114
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").error(`Icon asset is not a valid image.`);
|
|
115
|
-
}
|
|
116
|
-
if (fileTypeResult.mime === 'image/gif') {
|
|
117
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").error(`Icon asset cannot be a GIF.`);
|
|
118
|
-
}
|
|
119
|
-
const sizeResult = imageSize(data);
|
|
120
|
-
if (!sizeResult) {
|
|
121
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").error(`Icon asset is not a valid image.`);
|
|
122
|
-
}
|
|
123
|
-
if (sizeResult.width !== sizeResult.height) {
|
|
124
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").error(`Icon asset must be square, but it is ${sizeResult.width}x${sizeResult.height}.`);
|
|
125
|
-
}
|
|
126
|
-
if (sizeResult.width < 256) {
|
|
127
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").error(`Icon asset must be at least 256x256 pixels, but it is ${sizeResult.width}x${sizeResult.height}.`);
|
|
128
|
-
}
|
|
129
|
-
if (sizeResult.width > 1024) {
|
|
130
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").error(`Icon asset can be at most 1024x1024 pixels, but it is ${sizeResult.width}x${sizeResult.height}.`);
|
|
131
|
-
}
|
|
132
|
-
// It's acceptable, but check if there's any warnings we should give the user
|
|
133
|
-
if (fileTypeResult.mime !== 'image/png') {
|
|
134
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").warn(`Icon asset is not a PNG, but it will still be uploaded.`);
|
|
135
|
-
}
|
|
136
|
-
if (sizeResult.width < 1024) {
|
|
137
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").warn(`Icon asset is smaller than 1024x1024 pixels. Consider using a larger icon for better quality.`);
|
|
138
|
-
}
|
|
139
|
-
if (![1024, 512, 256].includes(sizeResult.width)) {
|
|
140
|
-
__classPrivateFieldGet(this, _AssetUploader_cmd, "f").warn(`Icon asset is ${sizeResult.width}x${sizeResult.height}. Consider using a standard size (preferably 1024x1024) for better compatibility.`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
99
|
}
|
|
144
100
|
_AssetUploader_cmd = new WeakMap(), _AssetUploader_verbose = new WeakMap(), _AssetUploader_appClient = new WeakMap(), _AssetUploader_appSlug = new WeakMap(), _AssetUploader_instances = new WeakSet(), _AssetUploader_processRegularAssets = async function _AssetUploader_processRegularAssets(assets) {
|
|
145
101
|
// early out to avoid logging if empty
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
1
|
import { clientVersionQueryParam } from '@devvit/shared-types/web-view-scripts-constants.js';
|
|
4
2
|
import { JSDOM } from 'jsdom';
|
|
5
3
|
import { describe, expect, it } from 'vitest';
|
|
6
|
-
import {
|
|
4
|
+
import { DEVVIT_JS_URL, transformHTML } from './AssetUploader.js';
|
|
7
5
|
describe('HTML Transformation', () => {
|
|
8
6
|
describe('transformHTML', () => {
|
|
9
7
|
it('should add script tag to head when head exists', () => {
|
|
@@ -103,37 +101,6 @@ describe('HTML Transformation', () => {
|
|
|
103
101
|
});
|
|
104
102
|
});
|
|
105
103
|
});
|
|
106
|
-
describe('assertAssetCanBeAnIcon', () => {
|
|
107
|
-
const TEST_IMAGE_FILES = [
|
|
108
|
-
'1024x1024.gif',
|
|
109
|
-
'1024x1024.jpg',
|
|
110
|
-
'1024x1024.png',
|
|
111
|
-
'256x256.png',
|
|
112
|
-
'256x512.png',
|
|
113
|
-
'420x420.png',
|
|
114
|
-
'512x512.png',
|
|
115
|
-
'notAnImage.txt',
|
|
116
|
-
];
|
|
117
|
-
for (const fileName of TEST_IMAGE_FILES) {
|
|
118
|
-
it(`should match the snapshot for image file: ${fileName}`, async () => {
|
|
119
|
-
const cmd = {
|
|
120
|
-
error: vi.fn(() => {
|
|
121
|
-
throw new Error('Mocked error');
|
|
122
|
-
}),
|
|
123
|
-
warn: vi.fn(),
|
|
124
|
-
};
|
|
125
|
-
const assetUploader = new AssetUploader(cmd, 'some-slug', {
|
|
126
|
-
verbose: false,
|
|
127
|
-
});
|
|
128
|
-
const filePath = `../../testing-images/${fileName}`;
|
|
129
|
-
const fileContent = fs.readFileSync(path.join(__dirname, filePath));
|
|
130
|
-
// Don't care if this resolves or rejects, just want to test the error handling
|
|
131
|
-
await Promise.allSettled([assetUploader.assertAssetCanBeAnIcon(fileContent)]);
|
|
132
|
-
expect(cmd.error.mock.calls).toMatchSnapshot(`${fileName}-err`);
|
|
133
|
-
expect(cmd.warn.mock.calls).toMatchSnapshot(`${fileName}-warn`);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
104
|
function selectScript(document) {
|
|
138
105
|
return document.querySelector(`head script[src="${DEVVIT_JS_URL}?${clientVersionQueryParam}=1.2.3"]`);
|
|
139
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cutter.d.ts","sourceRoot":"","sources":["../../src/util/Cutter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Cutter.d.ts","sourceRoot":"","sources":["../../src/util/Cutter.ts"],"names":[],"mappings":"AAsBA,oDAAoD;AACpD,MAAM,CAAC,OAAO,OAAO,MAAM;;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,SAAS,EAAE,MAAM;IAIvB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAgFnE"}
|
package/dist/util/Cutter.js
CHANGED
|
@@ -19,10 +19,8 @@ const RAW_FILE_MIME_TYPES = [
|
|
|
19
19
|
'font/',
|
|
20
20
|
'model/',
|
|
21
21
|
];
|
|
22
|
-
// Use custom Mustache delimiters that won't conflict with JSX/TSX curly braces.
|
|
23
|
-
const MUSTACHE_TAGS = ['<%', '%>'];
|
|
24
22
|
function m(template, mustacheContext) {
|
|
25
|
-
return Mustache.render(template, mustacheContext
|
|
23
|
+
return Mustache.render(template, mustacheContext);
|
|
26
24
|
}
|
|
27
25
|
/** Render a template directly to the filesystem. */
|
|
28
26
|
class Cutter {
|
|
@@ -48,15 +46,15 @@ _Cutter_instances = new WeakSet(), _Cutter_fetchAndExtract = async function _Cut
|
|
|
48
46
|
const buffer = await response.arrayBuffer();
|
|
49
47
|
// Extract the buffer to the temporary directory using jszip
|
|
50
48
|
const zip = await JSZip.loadAsync(buffer);
|
|
51
|
-
await Promise.all(Object.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
await Promise.all(Object.entries(zip.files).map(async ([fileName, file]) => {
|
|
50
|
+
// Write this file to the temporary directory
|
|
51
|
+
const filePath = path.join(tmpdir, fileName);
|
|
52
|
+
if (file.dir) {
|
|
53
|
+
// If it's a directory, create it
|
|
54
|
+
await fsp.mkdir(filePath, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// If it's a file, write its content
|
|
60
58
|
const content = await file.async('nodebuffer');
|
|
61
59
|
await fsp.writeFile(filePath, content);
|
|
62
60
|
}
|
package/dist/util/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/util/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/util/auth.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,KAAK,gCAAgC,EACtC,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAsB9D,eAAO,MAAM,WAAW,GAAI,OAAO,WAAW,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAKrE,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,gCAAgC,CAAC,MAAM,CAWhE,CAAC;AAIF,wBAAgB,WAAW,IAAI,0BAA0B,CAQxD;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAmBvE;AAED,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,WAAW,GAAG,aAAa,GAClC,OAAO,CAAC,WAAW,CAAC,CAKtB"}
|
package/dist/util/auth.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { REDDIT_OAUTH_COPY_PASTE_CLIENT_ID } from '@devvit/shared-types/constants.js';
|
|
2
1
|
import { HEADER_USER_AGENT } from '../constants/Headers.js';
|
|
3
2
|
import { NodeFSAuthenticationPlugin, } from '../lib/auth/NodeFSAuthenticationPlugin.js';
|
|
4
3
|
import { DOT_DEVVIT_DIR_FILENAME, REDDIT_DOT_COM } from '../lib/config.js';
|
|
@@ -7,6 +6,7 @@ const PORT = 65010; // Has to match exactly to our oauth app settings
|
|
|
7
6
|
const CLIENT_ID = 'Bep8X2RRjuoyuxkKsKxFuQ';
|
|
8
7
|
const TOKEN_DURATION = 'permanent';
|
|
9
8
|
const API_V1_URL = `${REDDIT_DOT_COM}/api/v1`;
|
|
9
|
+
const COPY_PASTE_CLIENT_ID = 'TWTsqXa53CexlrYGBWaesQ';
|
|
10
10
|
const COPY_PASTE_REDIRECT_URI = `${DEVVIT_PORTAL_URL}/cli-login`;
|
|
11
11
|
const DEVVIT_OAUTH_CLIENT_HEADERS = {
|
|
12
12
|
'User-Agent': 'devvit-cli',
|
|
@@ -14,7 +14,7 @@ const DEVVIT_OAUTH_CLIENT_HEADERS = {
|
|
|
14
14
|
};
|
|
15
15
|
const COPY_PASTE_OAUTH_CLIENT_HEADERS = {
|
|
16
16
|
'User-Agent': 'devvit-cli',
|
|
17
|
-
Authorization: `Basic ${Buffer.from(`${
|
|
17
|
+
Authorization: `Basic ${Buffer.from(`${COPY_PASTE_CLIENT_ID}:`).toString('base64')}`,
|
|
18
18
|
};
|
|
19
19
|
const getRedirectURI = (port) => `http://localhost:${port}/authorize_callback`;
|
|
20
20
|
export const authHeaders = (token) => {
|
|
@@ -30,7 +30,7 @@ export const AUTH_CONFIG = {
|
|
|
30
30
|
clientId: CLIENT_ID,
|
|
31
31
|
devvitOAuthClientHeaders: DEVVIT_OAUTH_CLIENT_HEADERS,
|
|
32
32
|
copyPasteRedirectUri: COPY_PASTE_REDIRECT_URI,
|
|
33
|
-
copyPasteClientId:
|
|
33
|
+
copyPasteClientId: COPY_PASTE_CLIENT_ID,
|
|
34
34
|
copyPasteClientHeaders: COPY_PASTE_OAUTH_CLIENT_HEADERS,
|
|
35
35
|
scopes: '*',
|
|
36
36
|
tokenDuration: TOKEN_DURATION,
|
|
@@ -12,5 +12,4 @@ export declare function createDeveloperAccountClient(): DeveloperAccountClient;
|
|
|
12
12
|
export declare function createEventsClient(): EventsClient;
|
|
13
13
|
export declare function createAppPublishRequestClient(): DevPortalAppPublishRequestClient;
|
|
14
14
|
export declare function createDeveloperSettingsClient(): DevPortalDeveloperSettingsClient;
|
|
15
|
-
export declare function getHeaders(): Headers;
|
|
16
15
|
//# sourceMappingURL=clientGenerators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientGenerators.d.ts","sourceRoot":"","sources":["../../src/util/clientGenerators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,cAAc,EACf,MAAM,6BAA6B,CAAC;AAYrC,OAAO,KAAK,EACV,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,mEAAmE,CAAC;AAE3E,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,4DAA4D,CAAC;AAsDpE,wBAAgB,eAAe,IAAI,SAAS,CAW3C;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAWzD;AAED,wBAAgB,uBAAuB,IAAI,0BAA0B,CAUpE;AAED,wBAAgB,yBAAyB,IAAI,mBAAmB,CAU/D;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAUrD;AAED,wBAAgB,wBAAwB,IAAI,iBAAiB,CAQ5D;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAUrD;AACD,wBAAgB,4BAA4B,IAAI,sBAAsB,CAUrE;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAWjD;AAED,wBAAgB,6BAA6B,IAAI,gCAAgC,CAUhF;AAED,wBAAgB,6BAA6B,IAAI,gCAAgC,CAUhF
|
|
1
|
+
{"version":3,"file":"clientGenerators.d.ts","sourceRoot":"","sources":["../../src/util/clientGenerators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,cAAc,EACf,MAAM,6BAA6B,CAAC;AAYrC,OAAO,KAAK,EACV,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,mEAAmE,CAAC;AAE3E,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,4DAA4D,CAAC;AAsDpE,wBAAgB,eAAe,IAAI,SAAS,CAW3C;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAWzD;AAED,wBAAgB,uBAAuB,IAAI,0BAA0B,CAUpE;AAED,wBAAgB,yBAAyB,IAAI,mBAAmB,CAU/D;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAUrD;AAED,wBAAgB,wBAAwB,IAAI,iBAAiB,CAQ5D;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAUrD;AACD,wBAAgB,4BAA4B,IAAI,sBAAsB,CAUrE;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAWjD;AAED,wBAAgB,6BAA6B,IAAI,gCAAgC,CAUhF;AAED,wBAAgB,6BAA6B,IAAI,gCAAgC,CAUhF"}
|
|
@@ -125,7 +125,7 @@ export function createDeveloperSettingsClient() {
|
|
|
125
125
|
headers: getHeaders(),
|
|
126
126
|
})));
|
|
127
127
|
}
|
|
128
|
-
|
|
128
|
+
function getHeaders() {
|
|
129
129
|
const headers = new Headers();
|
|
130
130
|
headers.set(...HEADER_USER_AGENT());
|
|
131
131
|
headers.set(...HEADER_DEVVIT_CLI());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentsConfig.d.ts","sourceRoot":"","sources":["../../../src/util/payments/paymentsConfig.ts"],"names":[],"mappings":"
|
|
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;AAE1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0CAA0C,CAAC;AAWxE,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,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EACxB,QAAQ,EAAE,WAAW,EAAE,EACvB,sBAAsB,GAAE,OAAc,GACrC,cAAc,CAGhB;AAmGD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,GAAG,cAAc,CAkBpF;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAyB3D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
1
|
import { access, readFile } from 'node:fs/promises';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { Currency, Environment, PaymentProcessorDefinition, PaymentsServiceDefinition, } from '@devvit/protos/payments.js';
|
|
@@ -117,10 +116,9 @@ export function makePaymentsConfig(products) {
|
|
|
117
116
|
return { products: formattedProducts };
|
|
118
117
|
}
|
|
119
118
|
export function validateProductIcon(assetPath) {
|
|
120
|
-
const file = fs.readFileSync(assetPath);
|
|
121
119
|
let size;
|
|
122
120
|
try {
|
|
123
|
-
size = imageSize(
|
|
121
|
+
size = imageSize(assetPath);
|
|
124
122
|
}
|
|
125
123
|
catch {
|
|
126
124
|
throw new Error(`Product icon ${assetPath} is not a valid image`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/util/project.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/util/project.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EAAE,S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|
var _Project_config, _Project_packageConfig;
|
|
20
20
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
21
|
-
import { apiPathPrefix } from '@devvit/shared-types/
|
|
22
|
-
import { parseAppConfig, } from '@devvit/shared-types/schemas/config-file.v1.js';
|
|
21
|
+
import { apiPathPrefix, parseAppConfig, } from '@devvit/shared-types/schemas/config-file.v1.js';
|
|
23
22
|
import path from 'path';
|
|
24
23
|
import { DEVVIT_SUBREDDIT } from '../constants/Environment.js';
|
|
25
24
|
import { findUpDirContaining, isFile } from './file-util.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectTemplateResolver.d.ts","sourceRoot":"","sources":["../../../src/util/template-resolvers/ProjectTemplateResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"ProjectTemplateResolver.d.ts","sourceRoot":"","sources":["../../../src/util/template-resolvers/ProjectTemplateResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAIvF,qBAAa,uBAAuB;;IAGlC,IAAI,OAAO,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAG5C;IAEK,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAsBnD,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAOrE"}
|
|
@@ -10,7 +10,6 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
12
|
var _ProjectTemplateResolver_instances, _ProjectTemplateResolver_options, _ProjectTemplateResolver_fetchOptions;
|
|
13
|
-
import { getHeaders } from '../clientGenerators.js';
|
|
14
13
|
import { DEVVIT_PORTAL_URL } from '../config.js';
|
|
15
14
|
export class ProjectTemplateResolver {
|
|
16
15
|
constructor() {
|
|
@@ -37,9 +36,7 @@ export class ProjectTemplateResolver {
|
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
_ProjectTemplateResolver_options = new WeakMap(), _ProjectTemplateResolver_instances = new WeakSet(), _ProjectTemplateResolver_fetchOptions = async function _ProjectTemplateResolver_fetchOptions() {
|
|
40
|
-
const response = await fetch(DEVVIT_PORTAL_URL + '/templates.json'
|
|
41
|
-
headers: getHeaders(),
|
|
42
|
-
});
|
|
39
|
+
const response = await fetch(DEVVIT_PORTAL_URL + '/templates.json');
|
|
43
40
|
if (!response.ok) {
|
|
44
41
|
throw new Error(`Failed to fetch templates: ${response.statusText}`);
|
|
45
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/cli",
|
|
3
|
-
"version": "0.11.19
|
|
3
|
+
"version": "0.11.19",
|
|
4
4
|
"description": "Reddit's Dev Platform CLI Tool",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"author": "@reddit/dev-platform",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
},
|
|
42
42
|
"types": "dist/index.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@devvit/build-pack": "0.11.19
|
|
44
|
+
"@devvit/build-pack": "0.11.19",
|
|
45
45
|
"@devvit/play": "0.0.45",
|
|
46
|
-
"@devvit/protos": "0.11.19
|
|
47
|
-
"@devvit/public-api": "0.11.19
|
|
48
|
-
"@devvit/shared-types": "0.11.19
|
|
46
|
+
"@devvit/protos": "0.11.19",
|
|
47
|
+
"@devvit/public-api": "0.11.19",
|
|
48
|
+
"@devvit/shared-types": "0.11.19",
|
|
49
49
|
"@improbable-eng/grpc-web": "0.15.0",
|
|
50
50
|
"@improbable-eng/grpc-web-node-http-transport": "0.15.0",
|
|
51
51
|
"@oclif/core": "2.9.4",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"date-fns": "2.29.3",
|
|
60
60
|
"dotenv": "16.5.0",
|
|
61
61
|
"file-type": "18.2.1",
|
|
62
|
-
"image-size": "2.
|
|
62
|
+
"image-size": "1.2.1",
|
|
63
63
|
"inquirer": "9.1.4",
|
|
64
64
|
"isomorphic-git": "1.21.0",
|
|
65
65
|
"js-yaml": "4.1.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"ws": "8.18.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@devvit/repo-tools": "0.11.19
|
|
79
|
-
"@devvit/tsconfig": "0.11.19
|
|
78
|
+
"@devvit/repo-tools": "0.11.19",
|
|
79
|
+
"@devvit/tsconfig": "0.11.19",
|
|
80
80
|
"@types/file-type": "10.9.1",
|
|
81
81
|
"@types/inquirer": "9.0.3",
|
|
82
82
|
"@types/js-yaml": "4.0.5",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
]
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "f730f695127ca675c4c651e691b9475e35e91ca2"
|
|
117
117
|
}
|