@shrkcrft/importer 0.1.0-alpha.2 → 0.1.0-alpha.4

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.
@@ -4,6 +4,12 @@ import type { IImportedEntry } from '../model/imported-entry.js';
4
4
  * base. The output is a self-contained, deterministic source file callers can
5
5
  * write into their `sharkcraft/` folder.
6
6
  *
7
+ * Emitted files are intentionally free of `@shrkcrft/*` imports — the
8
+ * knowledge loader is shape-agnostic, so the generated file declares its
9
+ * own helpers + enum-like constants. This lets `shrk import` produce a
10
+ * scaffolding file that works in a brand-new downstream repo where no
11
+ * SharkCraft packages are installed beyond the CLI.
12
+ *
7
13
  * The emitter avoids exotic escaping: it serializes each entry through
8
14
  * JSON.stringify with re-indentation and a final `as const` cast.
9
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"emit-knowledge-ts.d.ts","sourceRoot":"","sources":["../../src/emit/emit-knowledge-ts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAc9F"}
1
+ {"version":3,"file":"emit-knowledge-ts.d.ts","sourceRoot":"","sources":["../../src/emit/emit-knowledge-ts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAsCD,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAc9F"}
@@ -1,3 +1,38 @@
1
+ const LOCAL_HELPERS = `// Local helpers — keep this file self-contained (no @shrkcrft/* imports).
2
+ const KnowledgePriority = {
3
+ Critical: 'critical',
4
+ High: 'high',
5
+ Medium: 'medium',
6
+ Low: 'low',
7
+ } as const;
8
+
9
+ const KnowledgeType = {
10
+ Rule: 'rule',
11
+ Path: 'path',
12
+ Template: 'template',
13
+ Architecture: 'architecture',
14
+ Technical: 'technical',
15
+ Business: 'business',
16
+ Command: 'command',
17
+ Environment: 'environment',
18
+ Dependency: 'dependency',
19
+ Feature: 'feature',
20
+ Task: 'task',
21
+ Warning: 'warning',
22
+ Decision: 'decision',
23
+ Convention: 'convention',
24
+ Workflow: 'workflow',
25
+ Testing: 'testing',
26
+ Security: 'security',
27
+ Deployment: 'deployment',
28
+ Integration: 'integration',
29
+ Custom: 'custom',
30
+ } as const;
31
+
32
+ function defineKnowledgeEntry<T>(entry: T): T {
33
+ return entry;
34
+ }
35
+ `;
1
36
  export function emitKnowledgeTs(entries, opts) {
2
37
  const exportName = opts.exportName ?? 'importedKnowledge';
3
38
  const items = entries.map(serializeEntry).join(',\n');
@@ -5,8 +40,8 @@ export function emitKnowledgeTs(entries, opts) {
5
40
  '// Auto-generated by `shrk import`.',
6
41
  `// Source: ${opts.sourceLabel}`,
7
42
  '// Review every entry — the importer is best-effort and types/priorities are inferred.',
8
- "import { defineKnowledgeEntry, KnowledgePriority, KnowledgeType } from '@shrkcrft/knowledge';",
9
43
  '',
44
+ LOCAL_HELPERS,
10
45
  `export const ${exportName} = [`,
11
46
  items,
12
47
  '];',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrkcrft/importer",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.4",
4
4
  "description": "SharkCraft importer: parse AGENTS.md / CLAUDE.md / .cursor/rules into structured knowledge entries.",
5
5
  "license": "MIT",
6
6
  "author": "SharkCraft contributors",
@@ -44,8 +44,8 @@
44
44
  "typecheck": "tsc --noEmit -p tsconfig.json"
45
45
  },
46
46
  "dependencies": {
47
- "@shrkcrft/core": "^0.1.0-alpha.2",
48
- "@shrkcrft/knowledge": "^0.1.0-alpha.2"
47
+ "@shrkcrft/core": "^0.1.0-alpha.4",
48
+ "@shrkcrft/knowledge": "^0.1.0-alpha.4"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"