@devvit/public-api 0.11.0-next-2024-08-12-bfcda6888.0 → 0.11.0-next-2024-08-13-f04661130.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  import { Header } from '@devvit/shared-types/Header.js';
2
2
  import { assertNonNull } from '@devvit/shared-types/NonNull.js';
3
- import pkg from '../../version.json' with { type: 'json' };
3
+ import { PUBLIC_API_VERSION } from './public-api-version.js';
4
4
  export function getContextFromMetadata(metadata, postId, commentId) {
5
5
  const subredditId = metadata[Header.Subreddit]?.values[0];
6
6
  assertNonNull(subredditId, 'subreddit is missing from Context');
@@ -66,7 +66,7 @@ export function parseDebug(meta) {
66
66
  }
67
67
  // @devvit/public-api v1.2.3 emitSnapshots=true foo=bar
68
68
  if (meta[Header.Debug])
69
- console.info(`[api] @devvit/public-api v${pkg.version} ${Object.entries(debug)
69
+ console.info(`[api] @devvit/public-api v${PUBLIC_API_VERSION} ${Object.entries(debug)
70
70
  .map(([k, v]) => `${k}=${v}`)
71
71
  .join(' ')}`);
72
72
  return { ...debug, metadata: meta };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @devvit/public-api version. Eg, '1.2.3', '0.11.0-dev',
3
+ * '0.10.23-next-2024-07-30-8bdb131a7.0'. This is a user input and may be
4
+ * invalid.
5
+ *
6
+ * Defined by ESBuildPack. to-do: replace with JSON import once Node.js v18
7
+ * support is dropped:
8
+ *
9
+ * // version.json is a symlink to public-api/package.json.
10
+ * import pkg from '../../version.json' with { type: 'json' };
11
+ */
12
+ export declare const PUBLIC_API_VERSION: string;
13
+ //# sourceMappingURL=public-api-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api-version.d.ts","sourceRoot":"","sources":["../../../src/devvit/internals/public-api-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAsB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @devvit/public-api version. Eg, '1.2.3', '0.11.0-dev',
3
+ * '0.10.23-next-2024-07-30-8bdb131a7.0'. This is a user input and may be
4
+ * invalid.
5
+ *
6
+ * Defined by ESBuildPack. to-do: replace with JSON import once Node.js v18
7
+ * support is dropped:
8
+ *
9
+ * // version.json is a symlink to public-api/package.json.
10
+ * import pkg from '../../version.json' with { type: 'json' };
11
+ */
12
+ export const PUBLIC_API_VERSION = '{{version}}';
package/meta.json CHANGED
@@ -11660,16 +11660,13 @@
11660
11660
  ],
11661
11661
  "format": "esm"
11662
11662
  },
11663
- "package.json": {
11664
- "bytes": 2834,
11663
+ "src/devvit/internals/public-api-version.ts": {
11664
+ "bytes": 441,
11665
11665
  "imports": [],
11666
- "format": "esm",
11667
- "with": {
11668
- "type": "json"
11669
- }
11666
+ "format": "esm"
11670
11667
  },
11671
11668
  "src/devvit/internals/context.ts": {
11672
- "bytes": 2699,
11669
+ "bytes": 2708,
11673
11670
  "imports": [
11674
11671
  {
11675
11672
  "path": "../shared-types/dist/Header.js",
@@ -11682,12 +11679,9 @@
11682
11679
  "original": "@devvit/shared-types/NonNull.js"
11683
11680
  },
11684
11681
  {
11685
- "path": "package.json",
11682
+ "path": "src/devvit/internals/public-api-version.ts",
11686
11683
  "kind": "import-statement",
11687
- "original": "../../version.json",
11688
- "with": {
11689
- "type": "json"
11690
- }
11684
+ "original": "./public-api-version.js"
11691
11685
  }
11692
11686
  ],
11693
11687
  "format": "esm"
@@ -14346,11 +14340,11 @@
14346
14340
  "src/apis/makeAPIClients.ts": {
14347
14341
  "bytesInOutput": 1973
14348
14342
  },
14349
- "package.json": {
14350
- "bytesInOutput": 2945
14343
+ "src/devvit/internals/public-api-version.ts": {
14344
+ "bytesInOutput": 42
14351
14345
  },
14352
14346
  "src/devvit/internals/context.ts": {
14353
- "bytesInOutput": 1704
14347
+ "bytesInOutput": 1699
14354
14348
  },
14355
14349
  "src/devvit/internals/helpers/settingsUtils.ts": {
14356
14350
  "bytesInOutput": 1316
@@ -14530,7 +14524,7 @@
14530
14524
  "bytesInOutput": 370
14531
14525
  }
14532
14526
  },
14533
- "bytes": 14836461
14527
+ "bytes": 14828563
14534
14528
  }
14535
14529
  }
14536
14530
  }
package/meta.min.json CHANGED
@@ -2989,16 +2989,13 @@
2989
2989
  ],
2990
2990
  "format": "esm"
2991
2991
  },
2992
- "package.json": {
2993
- "bytes": 2834,
2992
+ "src/devvit/internals/public-api-version.ts": {
2993
+ "bytes": 441,
2994
2994
  "imports": [],
2995
- "format": "esm",
2996
- "with": {
2997
- "type": "json"
2998
- }
2995
+ "format": "esm"
2999
2996
  },
3000
2997
  "src/devvit/internals/context.ts": {
3001
- "bytes": 2699,
2998
+ "bytes": 2708,
3002
2999
  "imports": [
3003
3000
  {
3004
3001
  "path": "../shared-types/dist/Header.js",
@@ -3011,12 +3008,9 @@
3011
3008
  "original": "@devvit/shared-types/NonNull.js"
3012
3009
  },
3013
3010
  {
3014
- "path": "package.json",
3011
+ "path": "src/devvit/internals/public-api-version.ts",
3015
3012
  "kind": "import-statement",
3016
- "original": "../../version.json",
3017
- "with": {
3018
- "type": "json"
3019
- }
3013
+ "original": "./public-api-version.js"
3020
3014
  }
3021
3015
  ],
3022
3016
  "format": "esm"
@@ -4738,7 +4732,7 @@
4738
4732
  "imports": [],
4739
4733
  "exports": [],
4740
4734
  "inputs": {},
4741
- "bytes": 1206098
4735
+ "bytes": 1202680
4742
4736
  },
4743
4737
  "dist/public-api.min.js": {
4744
4738
  "imports": [
@@ -5375,11 +5369,11 @@
5375
5369
  "src/apis/makeAPIClients.ts": {
5376
5370
  "bytesInOutput": 848
5377
5371
  },
5378
- "package.json": {
5379
- "bytesInOutput": 2392
5372
+ "src/devvit/internals/public-api-version.ts": {
5373
+ "bytesInOutput": 21
5380
5374
  },
5381
5375
  "src/devvit/internals/context.ts": {
5382
- "bytesInOutput": 914
5376
+ "bytesInOutput": 906
5383
5377
  },
5384
5378
  "src/devvit/internals/custom-post.ts": {
5385
5379
  "bytesInOutput": 389
@@ -5550,7 +5544,7 @@
5550
5544
  "bytesInOutput": 178
5551
5545
  }
5552
5546
  },
5553
- "bytes": 258206
5547
+ "bytes": 255827
5554
5548
  }
5555
5549
  }
5556
5550
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/public-api",
3
- "version": "0.11.0-next-2024-08-12-bfcda6888.0",
3
+ "version": "0.11.0-next-2024-08-13-f04661130.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "types": "./index.d.ts",
32
32
  "dependencies": {
33
- "@devvit/protos": "0.11.0-next-2024-08-12-bfcda6888.0",
34
- "@devvit/shared-types": "0.11.0-next-2024-08-12-bfcda6888.0",
33
+ "@devvit/protos": "0.11.0-next-2024-08-13-f04661130.0",
34
+ "@devvit/shared-types": "0.11.0-next-2024-08-13-f04661130.0",
35
35
  "base64-js": "1.5.1",
36
36
  "clone-deep": "4.0.1",
37
37
  "core-js": "3.27.2",
@@ -39,9 +39,9 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@ampproject/filesize": "4.3.0",
42
- "@devvit/eslint-config": "0.11.0-next-2024-08-12-bfcda6888.0",
43
- "@devvit/repo-tools": "0.11.0-next-2024-08-12-bfcda6888.0",
44
- "@devvit/tsconfig": "0.11.0-next-2024-08-12-bfcda6888.0",
42
+ "@devvit/eslint-config": "0.11.0-next-2024-08-13-f04661130.0",
43
+ "@devvit/repo-tools": "0.11.0-next-2024-08-13-f04661130.0",
44
+ "@devvit/tsconfig": "0.11.0-next-2024-08-13-f04661130.0",
45
45
  "@microsoft/api-extractor": "7.41.0",
46
46
  "@reddit/faceplate-ui": "16.1.0",
47
47
  "@types/clone-deep": "4.0.1",
@@ -64,5 +64,5 @@
64
64
  }
65
65
  },
66
66
  "source": "./src/index.ts",
67
- "gitHead": "5a00c9f7b91465873baddabe3835cb1b675632dd"
67
+ "gitHead": "32273fae81308ee0cdccf9e0d975e93da2f79b76"
68
68
  }
package/public-api.d.ts CHANGED
@@ -5452,6 +5452,19 @@ declare interface CompileParams {
5452
5452
  * This **MAY** be supported for various languages/implementations, and the
5453
5453
  * rsync-like protocol is left as an exercise for the build pack
5454
5454
  * implementor.
5455
+ *
5456
+ * Eg, whatever dot is below (preferred, offers access to the entire
5457
+ * project):
5458
+ *
5459
+ * .
5460
+ * package.json
5461
+ * src/
5462
+ * foo.ts
5463
+ * main.tsx
5464
+ *
5465
+ * Also supported:
5466
+ * .
5467
+ * main.ts
5455
5468
  */
5456
5469
  filename?: string | undefined;
5457
5470
  minify: Minify;