@seedcord/core 0.0.1 → 0.1.0-next.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/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  //#region src/index.ts
4
4
  /** Package version */
5
- const version = "0.0.1";
5
+ const version = "0.1.0-next.0";
6
6
 
7
7
  //#endregion
8
8
  exports.version = version;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/** Package version */\nexport const version = process.env.PACKAGE_VERSION ?? '0.0.0';\n"],"mappings":";;;;AACA,MAAa"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export type * from './registries/ContextMenuRegistry';\nexport type * from './registries/SlashOptionRegistry';\n\n/** Package version */\nexport const version = process.env.PACKAGE_VERSION ?? '0.0.0';\n"],"mappings":";;;;AAIA,MAAa"}
package/dist/index.d.mts CHANGED
@@ -1,6 +1,64 @@
1
+ //#region src/registries/ContextMenuRegistry.d.ts
2
+ /**
3
+ * Maps each user context-menu command name to a presence marker. Populated by `seedcord codegen`, which
4
+ * reads every command's `toJSON()` and emits a `declare module 'seedcord'` augmentation, so
5
+ * `keyof UserContextMenuRegistry` is the compile-time union of every registered user context-menu name.
6
+ * Do not augment it by hand, run `seedcord codegen`.
7
+ *
8
+ * Kept separate from {@link MessageContextMenuRegistry} because Discord allows a user command and a message
9
+ * command to share a name, so a single name-keyed registry would collapse a legal pair.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * // seedcord-gen.d.ts (emitted, committed)
14
+ * declare module 'seedcord' {
15
+ * interface UserContextMenuRegistry {
16
+ * 'View Profile': true;
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ interface UserContextMenuRegistry {}
22
+ /**
23
+ * Maps each message context-menu command name to a presence marker. Populated by `seedcord codegen`, so
24
+ * `keyof MessageContextMenuRegistry` is the compile-time union of every registered message context-menu
25
+ * name. Do not augment it by hand, run `seedcord codegen`.
26
+ *
27
+ * Kept separate from {@link UserContextMenuRegistry}, see that interface for why.
28
+ */
29
+ interface MessageContextMenuRegistry {}
30
+ //#endregion
31
+ //#region src/registries/SlashOptionRegistry.d.ts
32
+ /** A slash option kind, named for the registry rather than the raw discord.js `ApplicationCommandOptionType` int. */
33
+ type OptionKind = 'string' | 'integer' | 'number' | 'boolean' | 'user' | 'channel' | 'role' | 'mentionable' | 'attachment';
34
+ /** The type-relevant shape of one slash option, as emitted by `seedcord codegen` into a registry row. */
35
+ interface SlashOption {
36
+ kind: OptionKind;
37
+ required: boolean;
38
+ choices?: readonly (string | number)[];
39
+ autocomplete?: true;
40
+ }
41
+ /**
42
+ * Maps each slash route string to its option table. Populated by `seedcord codegen`, which reads every
43
+ * command's `toJSON()` and emits a `declare module 'seedcord'` augmentation, so `keyof SlashOptionRegistry`
44
+ * is the compile-time union of every registered route. Do not augment it by hand, run `seedcord codegen`.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * // seedcord-gen.d.ts (emitted, committed)
49
+ * declare module 'seedcord' {
50
+ * interface SlashOptionRegistry {
51
+ * ban: { target: { kind: 'user'; required: true }; reason: { kind: 'string'; required: false } };
52
+ * 'demo/setup': { channel: { kind: 'channel'; required: true } };
53
+ * }
54
+ * }
55
+ * ```
56
+ */
57
+ interface SlashOptionRegistry {}
58
+ //#endregion
1
59
  //#region src/index.d.ts
2
60
  /** Package version */
3
61
  declare const version: string;
4
62
  //#endregion
5
- export { version };
63
+ export { type MessageContextMenuRegistry, type OptionKind, type SlashOption, type SlashOptionRegistry, type UserContextMenuRegistry, version };
6
64
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region src/index.ts
2
2
  /** Package version */
3
- const version = "0.0.1";
3
+ const version = "0.1.0-next.0";
4
4
 
5
5
  //#endregion
6
6
  export { version };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/** Package version */\nexport const version = process.env.PACKAGE_VERSION ?? '0.0.0';\n"],"mappings":";;AACA,MAAa"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export type * from './registries/ContextMenuRegistry';\nexport type * from './registries/SlashOptionRegistry';\n\n/** Package version */\nexport const version = process.env.PACKAGE_VERSION ?? '0.0.0';\n"],"mappings":";;AAIA,MAAa"}
package/package.json CHANGED
@@ -1,64 +1,65 @@
1
1
  {
2
- "name": "@seedcord/core",
3
- "type": "module",
4
- "version": "0.0.1",
5
- "description": "Transport-agnostic core for Seedcord bots",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/seedcord/seedcord.git",
9
- "directory": "packages/core"
2
+ "name": "@seedcord/core",
3
+ "type": "module",
4
+ "version": "0.1.0-next.0",
5
+ "description": "Transport-agnostic core for Seedcord bots",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/seedcord/seedcord.git",
9
+ "directory": "packages/core"
10
+ },
11
+ "types": "./dist/index.d.mts",
12
+ "exports": {
13
+ ".": {
14
+ "import": {
15
+ "types": "./dist/index.d.mts",
16
+ "default": "./dist/index.mjs"
17
+ },
18
+ "require": {
19
+ "types": "./dist/index.d.cts",
20
+ "default": "./dist/index.cjs"
21
+ }
10
22
  },
11
- "types": "./dist/index.d.mts",
12
- "exports": {
13
- ".": {
14
- "import": {
15
- "types": "./dist/index.d.mts",
16
- "default": "./dist/index.mjs"
17
- },
18
- "require": {
19
- "types": "./dist/index.d.cts",
20
- "default": "./dist/index.cjs"
21
- }
22
- },
23
- "./internal": {
24
- "import": {
25
- "types": "./dist/internal.index.d.mts",
26
- "default": "./dist/internal.index.mjs"
27
- },
28
- "require": {
29
- "types": "./dist/internal.index.d.cts",
30
- "default": "./dist/internal.index.cjs"
31
- }
32
- }
33
- },
34
- "files": [
35
- "dist",
36
- "package.json",
37
- "README.md",
38
- "LICENSE"
39
- ],
40
- "scripts": {
41
- "build": "tsdown",
42
- "clean": "rm -rf dist",
43
- "lint": "eslint 'src/**/*.{ts,tsx}' 'tests/**/*.{ts,tsx}' --cache",
44
- "lint:fix": "eslint 'src/**/*.{ts,tsx}' 'tests/**/*.{ts,tsx}' --fix --cache",
45
- "fmt": "prettier --write 'src/**/*.{ts,tsx,json,md}' 'tests/**/*.{ts,tsx,json,md}' --cache",
46
- "fmt:check": "prettier --check 'src/**/*.{ts,tsx,json,md}' 'tests/**/*.{ts,tsx,json,md}' --cache",
47
- "tc": "tsc --noEmit",
48
- "test": "vitest run",
49
- "test:watch": "vitest dev",
50
- "coverage": "vitest run --coverage"
51
- },
52
- "peerDependencies": {
53
- "typescript": "catalog:peer"
54
- },
55
- "devDependencies": {
56
- "@seedcord/eslint-config": "workspace:*",
57
- "@seedcord/tsconfig": "workspace:*",
58
- "@seedcord/tsdown-config": "workspace:*"
59
- },
60
- "publishConfig": {
61
- "access": "public",
62
- "provenance": true
23
+ "./internal": {
24
+ "import": {
25
+ "types": "./dist/internal.index.d.mts",
26
+ "default": "./dist/internal.index.mjs"
27
+ },
28
+ "require": {
29
+ "types": "./dist/internal.index.d.cts",
30
+ "default": "./dist/internal.index.cjs"
31
+ }
63
32
  }
64
- }
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "package.json",
37
+ "README.md",
38
+ "LICENSE"
39
+ ],
40
+ "peerDependencies": {
41
+ "typescript": "^6.0.3"
42
+ },
43
+ "devDependencies": {
44
+ "@seedcord/eslint-config": "1.5.0-next.0",
45
+ "@seedcord/tsconfig": "2.0.1",
46
+ "@seedcord/tsdown-config": "2.0.1"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public",
50
+ "provenance": true
51
+ },
52
+ "scripts": {
53
+ "build": "tsdown",
54
+ "clean": "rm -rf dist",
55
+ "lint": "eslint 'src/**/*.{ts,tsx}' 'tests/**/*.{ts,tsx}' --cache",
56
+ "lint:fix": "eslint 'src/**/*.{ts,tsx}' 'tests/**/*.{ts,tsx}' --fix --cache",
57
+ "fmt": "prettier --write 'src/**/*.{ts,tsx,json,md}' 'tests/**/*.{ts,tsx,json,md}' --cache",
58
+ "fmt:check": "prettier --check 'src/**/*.{ts,tsx,json,md}' 'tests/**/*.{ts,tsx,json,md}' --cache",
59
+ "tc": "tsgo --noEmit",
60
+ "test": "vitest run",
61
+ "test:watch": "vitest dev",
62
+ "coverage": "vitest run --coverage"
63
+ },
64
+ "readme": "<p align=\"center\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://cdn.seedcord.org/assets/wordmark-dark.webp\" />\n <img src=\"https://cdn.seedcord.org/assets/wordmark-light.webp\" alt=\"seedcord\" width=\"440\" />\n </picture>\n</p>\n\n# @seedcord/core\n\nTransport-agnostic core for Seedcord bots\n\nPart of the [seedcord](https://github.com/seedcord/seedcord) framework. Until a major v1.0.0 release, expect breaking changes in minor versions.\n"
65
+ }