@dereekb/firebase 13.12.3 → 13.12.5

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.
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@dereekb/firebase/eslint",
3
- "version": "13.12.3",
3
+ "version": "13.12.5",
4
4
  "peerDependencies": {
5
- "@dereekb/util": "13.12.3",
5
+ "@dereekb/util": "13.12.5",
6
6
  "@marcbachmann/cel-js": "^7.6.1",
7
7
  "@typescript-eslint/parser": "8.59.3",
8
8
  "@typescript-eslint/utils": "8.59.3"
9
9
  },
10
10
  "devDependencies": {
11
- "@dereekb/firebase": "13.12.3",
11
+ "@dereekb/firebase": "13.12.5",
12
12
  "eslint": "10.4.0",
13
13
  "firebase": "^12.12.1"
14
14
  },
@@ -11,6 +11,8 @@ export { FIREBASE_REQUIRE_FIRESTORE_RULE_FOR_SERVICE_MODEL_RULE, DEFAULT_FIRESTO
11
11
  export { FIREBASE_REQUIRE_DBX_MODEL_SERVICE_FACTORY_TAG_RULE, FIREBASE_MODEL_SERVICE_FACTORY_NAME, FIREBASE_MODEL_SERVICE_FACTORY_MODULE, DBX_MODEL_SERVICE_FACTORY_TAG, type FirebaseRequireDbxModelServiceFactoryTagRuleOptions, type FirebaseRequireDbxModelServiceFactoryTagRuleDefinition } from './require-dbx-model-service-factory-tag.rule';
12
12
  export { FIREBASE_REQUIRE_SERVICE_FACTORY_FOR_DBX_MODEL_RULE, DEFAULT_FACTORY_SEARCH_ROOTS, DEFAULT_MODEL_MARKER_TAG, DEFAULT_FACTORY_TAG, type FirebaseRequireServiceFactoryForDbxModelRuleOptions, type FirebaseRequireServiceFactoryForDbxModelRuleDefinition } from './require-service-factory-for-dbx-model.rule';
13
13
  export { FIREBASE_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE, type FirebaseRequireDbxModelCompanionTagsRuleOptions, type FirebaseRequireDbxModelCompanionTagsRuleDefinition } from './require-dbx-model-companion-tags.rule';
14
+ export { FIREBASE_REQUIRE_CANONICAL_API_SPEC_FILENAME_RULE, DEFAULT_FUNCTION_DIR_SEGMENT, type FirebaseRequireCanonicalApiSpecFilenameRuleOptions, type FirebaseRequireCanonicalApiSpecFilenameRuleDefinition } from './require-canonical-api-spec-filename.rule';
15
+ export { FIREBASE_REQUIRE_API_CRUD_SPEC_FOR_GROUP_RULE, type FirebaseRequireApiCrudSpecForGroupRuleOptions, type FirebaseRequireApiCrudSpecForGroupRuleDefinition } from './require-api-crud-spec-for-group.rule';
14
16
  export { parseStorageRules, MIRRORS_POLICY_KEY_MARKER_REGEX, type ParsedRuleBranch, type ParsedStorageRulesBlock } from './storage-rules-parser';
15
17
  export { parseFirestoreRules, type ParsedFirestoreMatchBlock } from './firestore-rules-parser';
16
18
  export { FIREBASE_ESLINT_PLUGIN, firebaseESLintPlugin, type FirebaseEslintPlugin } from './plugin';
@@ -11,6 +11,8 @@ import { FIREBASE_REQUIRE_FIRESTORE_RULE_FOR_SERVICE_MODEL_RULE } from './requir
11
11
  import { FIREBASE_REQUIRE_DBX_MODEL_SERVICE_FACTORY_TAG_RULE } from './require-dbx-model-service-factory-tag.rule';
12
12
  import { FIREBASE_REQUIRE_SERVICE_FACTORY_FOR_DBX_MODEL_RULE } from './require-service-factory-for-dbx-model.rule';
13
13
  import { FIREBASE_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE } from './require-dbx-model-companion-tags.rule';
14
+ import { FIREBASE_REQUIRE_CANONICAL_API_SPEC_FILENAME_RULE } from './require-canonical-api-spec-filename.rule';
15
+ import { FIREBASE_REQUIRE_API_CRUD_SPEC_FOR_GROUP_RULE } from './require-api-crud-spec-for-group.rule';
14
16
  /**
15
17
  * ESLint plugin interface for `@dereekb/firebase` rules.
16
18
  */
@@ -29,6 +31,8 @@ export interface FirebaseEslintPlugin {
29
31
  readonly 'require-dbx-model-service-factory-tag': typeof FIREBASE_REQUIRE_DBX_MODEL_SERVICE_FACTORY_TAG_RULE;
30
32
  readonly 'require-service-factory-for-dbx-model': typeof FIREBASE_REQUIRE_SERVICE_FACTORY_FOR_DBX_MODEL_RULE;
31
33
  readonly 'require-dbx-model-companion-tags': typeof FIREBASE_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE;
34
+ readonly 'require-canonical-api-spec-filename': typeof FIREBASE_REQUIRE_CANONICAL_API_SPEC_FILENAME_RULE;
35
+ readonly 'require-api-crud-spec-for-group': typeof FIREBASE_REQUIRE_API_CRUD_SPEC_FOR_GROUP_RULE;
32
36
  };
33
37
  }
34
38
  /**
@@ -0,0 +1,47 @@
1
+ import { type AstNode } from './util';
2
+ /**
3
+ * Options for the require-api-crud-spec-for-group rule.
4
+ */
5
+ export interface FirebaseRequireApiCrudSpecForGroupRuleOptions {
6
+ /**
7
+ * Path-suffix marker that anchors the rule to API function folders.
8
+ * Defaults to `'src/app/function'`. Files outside this segment are ignored.
9
+ */
10
+ readonly functionDirSegment?: string;
11
+ }
12
+ /**
13
+ * ESLint rule definition for require-api-crud-spec-for-group.
14
+ */
15
+ export interface FirebaseRequireApiCrudSpecForGroupRuleDefinition {
16
+ readonly meta: {
17
+ readonly type: 'suggestion';
18
+ readonly fixable: undefined;
19
+ readonly docs: {
20
+ readonly description: string;
21
+ readonly recommended: boolean;
22
+ };
23
+ readonly messages: Readonly<Record<string, string>>;
24
+ readonly schema: readonly object[];
25
+ };
26
+ create(context: {
27
+ options: FirebaseRequireApiCrudSpecForGroupRuleOptions[];
28
+ filename: string;
29
+ report: (descriptor: {
30
+ node: AstNode;
31
+ messageId: string;
32
+ data?: Record<string, string>;
33
+ }) => void;
34
+ }): Record<string, (node: AstNode) => void>;
35
+ }
36
+ /**
37
+ * ESLint rule that fires on every `<apiDir>/src/app/function/<group>/index.ts`
38
+ * (the canonical anchor file for a Firebase Functions group) and verifies
39
+ * that the same folder contains a `<group>.crud.spec.ts` (or any
40
+ * `<group>.crud.<sub>.spec.ts` variant) sibling. Mirrors the coverage check
41
+ * in `dbx_model_test_validate_app` so editor + CI lint flag missing CRUD
42
+ * coverage without needing the MCP audit.
43
+ *
44
+ * Not auto-fixable: creating a spec file shell with sensible test cases is
45
+ * outside the safe scope of an ESLint autofix.
46
+ */
47
+ export declare const FIREBASE_REQUIRE_API_CRUD_SPEC_FOR_GROUP_RULE: FirebaseRequireApiCrudSpecForGroupRuleDefinition;
@@ -0,0 +1,55 @@
1
+ import { type AstNode } from './util';
2
+ /**
3
+ * Default subpath segment (relative to an app source root) below which the
4
+ * rule expects model-group function folders. Matches the convention used by
5
+ * `<apiDir>/src/app/function/<group>/`.
6
+ */
7
+ export declare const DEFAULT_FUNCTION_DIR_SEGMENT = "src/app/function";
8
+ /**
9
+ * Options for the require-canonical-api-spec-filename rule.
10
+ */
11
+ export interface FirebaseRequireCanonicalApiSpecFilenameRuleOptions {
12
+ /**
13
+ * Path-suffix marker that anchors the rule to API function folders.
14
+ * Defaults to `'src/app/function'`. Any `.spec.ts` whose path contains
15
+ * `<marker>/<group>/<filename>` is classified; everything else is ignored.
16
+ */
17
+ readonly functionDirSegment?: string;
18
+ }
19
+ /**
20
+ * ESLint rule definition for require-canonical-api-spec-filename.
21
+ */
22
+ export interface FirebaseRequireCanonicalApiSpecFilenameRuleDefinition {
23
+ readonly meta: {
24
+ readonly type: 'suggestion';
25
+ readonly fixable: undefined;
26
+ readonly docs: {
27
+ readonly description: string;
28
+ readonly recommended: boolean;
29
+ };
30
+ readonly messages: Readonly<Record<string, string>>;
31
+ readonly schema: readonly object[];
32
+ };
33
+ create(context: {
34
+ options: FirebaseRequireCanonicalApiSpecFilenameRuleOptions[];
35
+ filename: string;
36
+ report: (descriptor: {
37
+ node: AstNode;
38
+ messageId: string;
39
+ data?: Record<string, string>;
40
+ }) => void;
41
+ }): Record<string, (node: AstNode) => void>;
42
+ }
43
+ /**
44
+ * ESLint rule that enforces the canonical naming convention for Firebase
45
+ * Functions API spec files: every `.spec.ts` under
46
+ * `<apiDir>/src/app/function/<group>/` must be `<group>.crud[.<sub>...].spec.ts`
47
+ * or `<group>.scenario[.<sub>...].spec.ts`. Drift forms surface a rename
48
+ * suggestion derived from the shared `classifySpecFile` classifier in
49
+ * `@dereekb/util`, so this rule and the `dbx_model_test_validate_app` MCP
50
+ * tool never diverge.
51
+ *
52
+ * Not auto-fixable: renaming files (and updating any imports/snapshots they
53
+ * carry) is outside the safe scope of an ESLint autofix.
54
+ */
55
+ export declare const FIREBASE_REQUIRE_CANONICAL_API_SPEC_FILENAME_RULE: FirebaseRequireCanonicalApiSpecFilenameRuleDefinition;
@@ -7,7 +7,7 @@ import { type AstNode } from './util';
7
7
  export declare const MODEL_FIREBASE_CRUD_FUNCTION_CONFIG_MAP_TYPE_NAME = "ModelFirebaseCrudFunctionConfigMap";
8
8
  /**
9
9
  * CRUD verb names supported by `ModelFirebaseCrudFunctionConfigMap`. Mirrors the
10
- * `create | read | update | delete | query` verbs in the type definition at
10
+ * `create | read | update | delete | query | invoke` verbs in the type definition at
11
11
  * `packages/firebase/src/lib/client/function/model.function.factory.ts`.
12
12
  */
13
13
  export declare const DEFAULT_CRUD_VERB_NAMES: readonly string[];