@shrkcrft/generator 0.1.0-alpha.14 → 0.1.0-alpha.16
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/file-change.d.ts +1 -1
- package/dist/file-change.d.ts.map +1 -1
- package/dist/operations.d.ts +141 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +5 -0
- package/dist/planned-change.d.ts +2 -137
- package/dist/planned-change.d.ts.map +1 -1
- package/dist/planned-change.js +5 -0
- package/package.json +5 -5
package/dist/file-change.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-change.d.ts","sourceRoot":"","sources":["../src/file-change.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"file-change.d.ts","sourceRoot":"","sources":["../src/file-change.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,2EAA2E;IAC3E,MAAM,WAAW;IACjB,yDAAyD;IACzD,MAAM,WAAW;IACjB,0EAA0E;IAC1E,WAAW,iBAAiB;IAC5B,2EAA2E;IAC3E,YAAY,kBAAkB;IAC9B,oDAAoD;IACpD,OAAO,YAAY;IACnB,+DAA+D;IAC/D,MAAM,WAAW;IACjB,iEAAiE;IACjE,YAAY,kBAAkB;IAC9B,4DAA4D;IAC5D,YAAY,kBAAkB;IAC9B,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operation union — declared by templates, persisted in saved plans.
|
|
3
|
+
* Part of the v2 generation model.
|
|
4
|
+
*/
|
|
5
|
+
export type PlannedOperationKind = 'create' | 'append' | 'insert-after' | 'insert-before' | 'replace' | 'export' | 'ensure-import' | 'insert-enum-entry' | 'insert-object-entry' | 'insert-array-entry' | 'insert-before-closing-brace' | 'insert-between-anchors';
|
|
6
|
+
export interface ICreateOperation {
|
|
7
|
+
kind: 'create';
|
|
8
|
+
content: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IAppendOperation {
|
|
12
|
+
kind: 'append';
|
|
13
|
+
/**
|
|
14
|
+
* The snippet to append at the end of the file. The engine adds a single
|
|
15
|
+
* `\n` separator between the existing trailing content and the snippet if
|
|
16
|
+
* the existing file does not already end with a newline.
|
|
17
|
+
*/
|
|
18
|
+
snippet: string;
|
|
19
|
+
/**
|
|
20
|
+
* Optional idempotency marker. If the existing file already contains this
|
|
21
|
+
* string anywhere, the operation is skipped (already applied).
|
|
22
|
+
*/
|
|
23
|
+
ifMissing?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface IInsertAfterOperation {
|
|
27
|
+
kind: 'insert-after';
|
|
28
|
+
/** Literal substring that must appear exactly once in the file. */
|
|
29
|
+
anchor: string;
|
|
30
|
+
/** The snippet to insert immediately after `anchor`. */
|
|
31
|
+
snippet: string;
|
|
32
|
+
/** Idempotency check; default = `snippet`. */
|
|
33
|
+
ifMissing?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface IInsertBeforeOperation {
|
|
37
|
+
kind: 'insert-before';
|
|
38
|
+
anchor: string;
|
|
39
|
+
snippet: string;
|
|
40
|
+
ifMissing?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface IReplaceOperation {
|
|
44
|
+
kind: 'replace';
|
|
45
|
+
/** Literal substring to find. */
|
|
46
|
+
find: string;
|
|
47
|
+
/** Replacement text. */
|
|
48
|
+
replaceWith: string;
|
|
49
|
+
/**
|
|
50
|
+
* If provided, the engine requires exactly this many matches; otherwise the
|
|
51
|
+
* default is exactly 1. Multiple matches without an explicit `expectMatches`
|
|
52
|
+
* is a conflict (ambiguous replace).
|
|
53
|
+
*/
|
|
54
|
+
expectMatches?: number;
|
|
55
|
+
description?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface IExportOperation {
|
|
58
|
+
kind: 'export';
|
|
59
|
+
/** The symbol/path to re-export. */
|
|
60
|
+
from: string;
|
|
61
|
+
/** Optional named symbols. When omitted, emits `export * from`. */
|
|
62
|
+
symbols?: readonly string[];
|
|
63
|
+
/** Idempotency check; default = computed export line. */
|
|
64
|
+
ifMissing?: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface IEnsureImportOperation {
|
|
68
|
+
kind: 'ensure-import';
|
|
69
|
+
/** Module specifier, e.g. `'./events'` or `'@app/plugin-core'`. */
|
|
70
|
+
from: string;
|
|
71
|
+
/**
|
|
72
|
+
* Named symbols to ensure. The op is a NO-OP for symbols already imported
|
|
73
|
+
* from `from`. Default import (`type: 'default'`) and namespace import
|
|
74
|
+
* (`type: 'namespace'`) are also supported via dedicated fields below.
|
|
75
|
+
*/
|
|
76
|
+
symbols?: readonly string[];
|
|
77
|
+
/** Treat the import as `import type { ... }` instead of value import. */
|
|
78
|
+
typeOnly?: boolean;
|
|
79
|
+
/** Default import binding (e.g. `import Foo from 'foo'`). */
|
|
80
|
+
defaultBinding?: string;
|
|
81
|
+
/** Namespace import binding (e.g. `import * as foo from 'foo'`). */
|
|
82
|
+
namespaceBinding?: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface IInsertEnumEntryOperation {
|
|
86
|
+
kind: 'insert-enum-entry';
|
|
87
|
+
/** Enum identifier, e.g. `PaginationEventType`. */
|
|
88
|
+
enumName: string;
|
|
89
|
+
/** Identifier of the new enum member, e.g. `ITEM_SELECTED`. */
|
|
90
|
+
entryName: string;
|
|
91
|
+
/** Literal string value to assign, e.g. `'pagination.itemSelected'`. */
|
|
92
|
+
entryValue: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface IInsertObjectEntryOperation {
|
|
96
|
+
kind: 'insert-object-entry';
|
|
97
|
+
/** Object identifier, e.g. `ROUTE_KEYS`. */
|
|
98
|
+
objectName: string;
|
|
99
|
+
/** Key to add. */
|
|
100
|
+
entryKey: string;
|
|
101
|
+
/** Value literal (already source-formatted). */
|
|
102
|
+
entryValue: string;
|
|
103
|
+
/** When `true`, allow shorthand entries; default `false`. */
|
|
104
|
+
shorthand?: boolean;
|
|
105
|
+
description?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface IInsertArrayEntryOperation {
|
|
108
|
+
kind: 'insert-array-entry';
|
|
109
|
+
/**
|
|
110
|
+
* Array identifier — a `const`/`let`/`var` bound to an array literal,
|
|
111
|
+
* e.g. `editorScopeEntries` or `DEFAULT_PANELS`. The element is inserted
|
|
112
|
+
* before the array's matching closing bracket.
|
|
113
|
+
*/
|
|
114
|
+
arrayName: string;
|
|
115
|
+
/** Element source text to add (already source-formatted, no trailing comma). */
|
|
116
|
+
entryValue: string;
|
|
117
|
+
/** Optional idempotency marker (default = `entryValue`). */
|
|
118
|
+
ifMissing?: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface IInsertBeforeClosingBraceOperation {
|
|
122
|
+
kind: 'insert-before-closing-brace';
|
|
123
|
+
/** Container identifier, e.g. an interface/class/enum name. */
|
|
124
|
+
containerName: string;
|
|
125
|
+
/** Snippet inserted immediately before the matching closing brace. */
|
|
126
|
+
snippet: string;
|
|
127
|
+
/** Optional idempotency marker (default = `snippet`). */
|
|
128
|
+
ifMissing?: string;
|
|
129
|
+
description?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface IInsertBetweenAnchorsOperation {
|
|
132
|
+
kind: 'insert-between-anchors';
|
|
133
|
+
beginAnchor: string;
|
|
134
|
+
endAnchor: string;
|
|
135
|
+
snippet: string;
|
|
136
|
+
/** Optional idempotency marker (default = `snippet`). */
|
|
137
|
+
ifMissing?: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
}
|
|
140
|
+
export type IPlannedOperation = ICreateOperation | IAppendOperation | IInsertAfterOperation | IInsertBeforeOperation | IReplaceOperation | IExportOperation | IEnsureImportOperation | IInsertEnumEntryOperation | IInsertObjectEntryOperation | IInsertArrayEntryOperation | IInsertBeforeClosingBraceOperation | IInsertBetweenAnchorsOperation;
|
|
141
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,eAAe,GACf,SAAS,GACT,QAAQ,GACR,eAAe,GACf,mBAAmB,GACnB,qBAAqB,GACrB,oBAAoB,GACpB,6BAA6B,GAC7B,wBAAwB,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAA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GACzB,gBAAgB,GAChB,gBAAgB,GAChB,qBAAqB,GACrB,sBAAsB,GACtB,iBAAiB,GACjB,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,2BAA2B,GAC3B,0BAA0B,GAC1B,kCAAkC,GAClC,8BAA8B,CAAC"}
|
package/dist/planned-change.d.ts
CHANGED
|
@@ -21,142 +21,8 @@
|
|
|
21
21
|
* - MCP stays read-only — this module is pure logic.
|
|
22
22
|
*/
|
|
23
23
|
import { FileChangeType, type IFileChange } from './file-change.js';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
kind: 'create';
|
|
27
|
-
content: string;
|
|
28
|
-
description?: string;
|
|
29
|
-
}
|
|
30
|
-
interface IAppendOperation {
|
|
31
|
-
kind: 'append';
|
|
32
|
-
/**
|
|
33
|
-
* The snippet to append at the end of the file. The engine adds a single
|
|
34
|
-
* `\n` separator between the existing trailing content and the snippet if
|
|
35
|
-
* the existing file does not already end with a newline.
|
|
36
|
-
*/
|
|
37
|
-
snippet: string;
|
|
38
|
-
/**
|
|
39
|
-
* Optional idempotency marker. If the existing file already contains this
|
|
40
|
-
* string anywhere, the operation is skipped (already applied).
|
|
41
|
-
*/
|
|
42
|
-
ifMissing?: string;
|
|
43
|
-
description?: string;
|
|
44
|
-
}
|
|
45
|
-
interface IInsertAfterOperation {
|
|
46
|
-
kind: 'insert-after';
|
|
47
|
-
/** Literal substring that must appear exactly once in the file. */
|
|
48
|
-
anchor: string;
|
|
49
|
-
/** The snippet to insert immediately after `anchor`. */
|
|
50
|
-
snippet: string;
|
|
51
|
-
/** Idempotency check; default = `snippet`. */
|
|
52
|
-
ifMissing?: string;
|
|
53
|
-
description?: string;
|
|
54
|
-
}
|
|
55
|
-
interface IInsertBeforeOperation {
|
|
56
|
-
kind: 'insert-before';
|
|
57
|
-
anchor: string;
|
|
58
|
-
snippet: string;
|
|
59
|
-
ifMissing?: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
}
|
|
62
|
-
interface IReplaceOperation {
|
|
63
|
-
kind: 'replace';
|
|
64
|
-
/** Literal substring to find. */
|
|
65
|
-
find: string;
|
|
66
|
-
/** Replacement text. */
|
|
67
|
-
replaceWith: string;
|
|
68
|
-
/**
|
|
69
|
-
* If provided, the engine requires exactly this many matches; otherwise the
|
|
70
|
-
* default is exactly 1. Multiple matches without an explicit `expectMatches`
|
|
71
|
-
* is a conflict (ambiguous replace).
|
|
72
|
-
*/
|
|
73
|
-
expectMatches?: number;
|
|
74
|
-
description?: string;
|
|
75
|
-
}
|
|
76
|
-
interface IExportOperation {
|
|
77
|
-
kind: 'export';
|
|
78
|
-
/** The symbol/path to re-export. */
|
|
79
|
-
from: string;
|
|
80
|
-
/** Optional named symbols. When omitted, emits `export * from`. */
|
|
81
|
-
symbols?: readonly string[];
|
|
82
|
-
/** Idempotency check; default = computed export line. */
|
|
83
|
-
ifMissing?: string;
|
|
84
|
-
description?: string;
|
|
85
|
-
}
|
|
86
|
-
interface IEnsureImportOperation {
|
|
87
|
-
kind: 'ensure-import';
|
|
88
|
-
/** Module specifier, e.g. `'./events'` or `'@app/plugin-core'`. */
|
|
89
|
-
from: string;
|
|
90
|
-
/**
|
|
91
|
-
* Named symbols to ensure. The op is a NO-OP for symbols already imported
|
|
92
|
-
* from `from`. Default import (`type: 'default'`) and namespace import
|
|
93
|
-
* (`type: 'namespace'`) are also supported via dedicated fields below.
|
|
94
|
-
*/
|
|
95
|
-
symbols?: readonly string[];
|
|
96
|
-
/** Treat the import as `import type { ... }` instead of value import. */
|
|
97
|
-
typeOnly?: boolean;
|
|
98
|
-
/** Default import binding (e.g. `import Foo from 'foo'`). */
|
|
99
|
-
defaultBinding?: string;
|
|
100
|
-
/** Namespace import binding (e.g. `import * as foo from 'foo'`). */
|
|
101
|
-
namespaceBinding?: string;
|
|
102
|
-
description?: string;
|
|
103
|
-
}
|
|
104
|
-
interface IInsertEnumEntryOperation {
|
|
105
|
-
kind: 'insert-enum-entry';
|
|
106
|
-
/** Enum identifier, e.g. `PaginationEventType`. */
|
|
107
|
-
enumName: string;
|
|
108
|
-
/** Identifier of the new enum member, e.g. `ITEM_SELECTED`. */
|
|
109
|
-
entryName: string;
|
|
110
|
-
/** Literal string value to assign, e.g. `'pagination.itemSelected'`. */
|
|
111
|
-
entryValue: string;
|
|
112
|
-
description?: string;
|
|
113
|
-
}
|
|
114
|
-
interface IInsertObjectEntryOperation {
|
|
115
|
-
kind: 'insert-object-entry';
|
|
116
|
-
/** Object identifier, e.g. `ROUTE_KEYS`. */
|
|
117
|
-
objectName: string;
|
|
118
|
-
/** Key to add. */
|
|
119
|
-
entryKey: string;
|
|
120
|
-
/** Value literal (already source-formatted). */
|
|
121
|
-
entryValue: string;
|
|
122
|
-
/** When `true`, allow shorthand entries; default `false`. */
|
|
123
|
-
shorthand?: boolean;
|
|
124
|
-
description?: string;
|
|
125
|
-
}
|
|
126
|
-
interface IInsertArrayEntryOperation {
|
|
127
|
-
kind: 'insert-array-entry';
|
|
128
|
-
/**
|
|
129
|
-
* Array identifier — a `const`/`let`/`var` bound to an array literal,
|
|
130
|
-
* e.g. `editorScopeEntries` or `DEFAULT_PANELS`. The element is inserted
|
|
131
|
-
* before the array's matching closing bracket.
|
|
132
|
-
*/
|
|
133
|
-
arrayName: string;
|
|
134
|
-
/** Element source text to add (already source-formatted, no trailing comma). */
|
|
135
|
-
entryValue: string;
|
|
136
|
-
/** Optional idempotency marker (default = `entryValue`). */
|
|
137
|
-
ifMissing?: string;
|
|
138
|
-
description?: string;
|
|
139
|
-
}
|
|
140
|
-
interface IInsertBeforeClosingBraceOperation {
|
|
141
|
-
kind: 'insert-before-closing-brace';
|
|
142
|
-
/** Container identifier, e.g. an interface/class/enum name. */
|
|
143
|
-
containerName: string;
|
|
144
|
-
/** Snippet inserted immediately before the matching closing brace. */
|
|
145
|
-
snippet: string;
|
|
146
|
-
/** Optional idempotency marker (default = `snippet`). */
|
|
147
|
-
ifMissing?: string;
|
|
148
|
-
description?: string;
|
|
149
|
-
}
|
|
150
|
-
interface IInsertBetweenAnchorsOperation {
|
|
151
|
-
kind: 'insert-between-anchors';
|
|
152
|
-
beginAnchor: string;
|
|
153
|
-
endAnchor: string;
|
|
154
|
-
snippet: string;
|
|
155
|
-
/** Optional idempotency marker (default = `snippet`). */
|
|
156
|
-
ifMissing?: string;
|
|
157
|
-
description?: string;
|
|
158
|
-
}
|
|
159
|
-
export type IPlannedOperation = ICreateOperation | IAppendOperation | IInsertAfterOperation | IInsertBeforeOperation | IReplaceOperation | IExportOperation | IEnsureImportOperation | IInsertEnumEntryOperation | IInsertObjectEntryOperation | IInsertArrayEntryOperation | IInsertBeforeClosingBraceOperation | IInsertBetweenAnchorsOperation;
|
|
24
|
+
import { type IPlannedOperation } from './operations.js';
|
|
25
|
+
export * from './operations.js';
|
|
160
26
|
export interface IPlannedChange {
|
|
161
27
|
/** Final file path relative to project root. */
|
|
162
28
|
targetPath: string;
|
|
@@ -177,5 +43,4 @@ export declare function evaluatePlannedChange(input: IEvaluateInput): IFileChang
|
|
|
177
43
|
* update-like in the v2 sense.
|
|
178
44
|
*/
|
|
179
45
|
export declare function isUpdateLike(type: FileChangeType): boolean;
|
|
180
|
-
export {};
|
|
181
46
|
//# sourceMappingURL=planned-change.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planned-change.d.ts","sourceRoot":"","sources":["../src/planned-change.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"planned-change.d.ts","sourceRoot":"","sources":["../src/planned-change.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,KAAK,iBAAiB,EAOvB,MAAM,iBAAiB,CAAC;AAMzB,cAAc,iBAAiB,CAAC;AAIhC,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAMD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG,WAAW,CA8BxE;AA8SD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAQ1D"}
|
package/dist/planned-change.js
CHANGED
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* - MCP stays read-only — this module is pure logic.
|
|
22
22
|
*/
|
|
23
23
|
import { FileChangeType } from "./file-change.js";
|
|
24
|
+
// The operation model lives in ./operations.ts. Re-export it from here — this
|
|
25
|
+
// module is the public face of the planned-change pipeline, and its consumers
|
|
26
|
+
// (dry-run, saved-plan, synthetic-plan, and the @shrkcrft/generator barrel)
|
|
27
|
+
// import the operation types from this path.
|
|
28
|
+
export * from "./operations.js";
|
|
24
29
|
export function evaluatePlannedChange(input) {
|
|
25
30
|
const { change, absolutePath, relativePath, existing } = input;
|
|
26
31
|
const op = change.operation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shrkcrft/generator",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.16",
|
|
4
4
|
"description": "SharkCraft plan-first generator: GenerationPlan, FileChange, dry-run, safe writes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SharkCraft contributors",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@shrkcrft/core": "^0.1.0-alpha.
|
|
47
|
-
"@shrkcrft/templates": "^0.1.0-alpha.
|
|
48
|
-
"@shrkcrft/rules": "^0.1.0-alpha.
|
|
49
|
-
"@shrkcrft/paths": "^0.1.0-alpha.
|
|
46
|
+
"@shrkcrft/core": "^0.1.0-alpha.16",
|
|
47
|
+
"@shrkcrft/templates": "^0.1.0-alpha.16",
|
|
48
|
+
"@shrkcrft/rules": "^0.1.0-alpha.16",
|
|
49
|
+
"@shrkcrft/paths": "^0.1.0-alpha.16"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|