@knapsack/renderer-twig 4.69.9--canary.4745.99a87d9.0 → 4.69.9--canary.4739.3a8c6f1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +0 -12
- package/dist/renderer-twig.d.ts +7 -6
- package/dist/renderer-twig.d.ts.map +1 -1
- package/dist/renderer-twig.js +132 -132
- package/dist/renderer-twig.js.map +1 -1
- package/package.json +11 -9
package/CHANGELOG.md
CHANGED
@@ -1,15 +1,3 @@
|
|
1
|
-
# v4.69.8 (Thu Sep 12 2024)
|
2
|
-
|
3
|
-
#### 🐛 Bug Fix
|
4
|
-
|
5
|
-
- refactor Renderers for cleaner types [#4746](https://github.com/knapsack-labs/app-monorepo/pull/4746) ([@EvanLovely](https://github.com/EvanLovely))
|
6
|
-
|
7
|
-
#### Authors: 1
|
8
|
-
|
9
|
-
- Evan Lovely ([@EvanLovely](https://github.com/EvanLovely))
|
10
|
-
|
11
|
-
---
|
12
|
-
|
13
1
|
# v4.69.7 (Wed Sep 11 2024)
|
14
2
|
|
15
3
|
#### 🐛 Bug Fix
|
package/dist/renderer-twig.d.ts
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
import {
|
1
|
+
import { KnapsackRendererBase } from '@knapsack/app';
|
2
|
+
import type { KnapsackRenderParams, KnapsackTemplateRenderer, KnapsackTemplateRendererResults } from '@knapsack/app/types';
|
2
3
|
import TwigRenderer, { type TwigRendererConfig } from '@basalt/twig-renderer';
|
3
|
-
export declare class KnapsackTwigRenderer extends
|
4
|
+
export declare class KnapsackTwigRenderer extends KnapsackRendererBase implements KnapsackTemplateRenderer {
|
4
5
|
#private;
|
5
6
|
twigRenderer: TwigRenderer;
|
6
7
|
constructor(config: TwigRendererConfig);
|
7
|
-
render:
|
8
|
-
getUsage:
|
9
|
-
getTemplateSuggestions:
|
10
|
-
getMeta:
|
8
|
+
render(opt: KnapsackRenderParams): Promise<KnapsackTemplateRendererResults>;
|
9
|
+
getUsage(opt: KnapsackRenderParams): Promise<string>;
|
10
|
+
getTemplateSuggestions(): ReturnType<KnapsackTemplateRenderer['getTemplateSuggestions']>;
|
11
|
+
getMeta: KnapsackTemplateRenderer['getMeta'];
|
11
12
|
}
|
12
13
|
//# sourceMappingURL=renderer-twig.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-twig.d.ts","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"renderer-twig.d.ts","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAO,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,YAAY,EAAE,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAqB9E,qBAAa,oBACX,SAAQ,oBACR,YAAW,wBAAwB;;IAEnC,YAAY,EAAE,YAAY,CAAC;gBAGf,MAAM,EAAE,kBAAkB;IAwBhC,MAAM,CACV,GAAG,EAAE,oBAAoB,GACxB,OAAO,CAAC,+BAA+B,CAAC;IAOrC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IA2HpD,sBAAsB,IAAI,UAAU,CACxC,wBAAwB,CAAC,wBAAwB,CAAC,CACnD;IAsCD,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CA4BzC;CACJ"}
|
package/dist/renderer-twig.js
CHANGED
@@ -17,18 +17,20 @@ var _KnapsackTwigRenderer_src;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
18
18
|
exports.KnapsackTwigRenderer = void 0;
|
19
19
|
const app_1 = require("@knapsack/app");
|
20
|
-
const renderers_1 = require("@knapsack/app/renderers");
|
21
20
|
const types_1 = require("@knapsack/types");
|
22
21
|
const twig_renderer_1 = __importDefault(require("@basalt/twig-renderer"));
|
23
22
|
const path_1 = require("path");
|
23
|
+
const fs_extra_1 = require("fs-extra");
|
24
24
|
const file_utils_1 = require("@knapsack/file-utils");
|
25
25
|
const utils_1 = require("./utils");
|
26
|
-
const pkg = JSON.parse((0,
|
26
|
+
const pkg = JSON.parse((0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../package.json'), 'utf-8'));
|
27
27
|
app_1.log.setupUpdateNotifier(pkg);
|
28
|
+
// static methods only
|
29
|
+
const { createSlotOptionsHtmlTags } = app_1.KnapsackRendererBase;
|
28
30
|
const protoTemplatePath = (0, path_1.join)(__dirname, '../prototype-template/prototype-template.twig');
|
29
31
|
(0, file_utils_1.assertFileExists)(protoTemplatePath);
|
30
32
|
const protoTwigNamespace = 'knapsack-renderer-twig-prototype-template';
|
31
|
-
class KnapsackTwigRenderer extends
|
33
|
+
class KnapsackTwigRenderer extends app_1.KnapsackRendererBase {
|
32
34
|
constructor(config) {
|
33
35
|
super({
|
34
36
|
id: types_1.rendererIds.twig,
|
@@ -36,135 +38,6 @@ class KnapsackTwigRenderer extends renderers_1.RendererBase {
|
|
36
38
|
extension: '.twig',
|
37
39
|
});
|
38
40
|
_KnapsackTwigRenderer_src.set(this, void 0);
|
39
|
-
this.render = async (opt) => {
|
40
|
-
const usage = await this.getUsage(opt);
|
41
|
-
const results = await this.twigRenderer.renderString(usage);
|
42
|
-
return { ...results, usage, templateLanguage: this.language };
|
43
|
-
// return this.twigRenderer.render(template.alias, data);
|
44
|
-
};
|
45
|
-
this.getUsage = async (opt) => {
|
46
|
-
const { pattern, template, demo,
|
47
|
-
/**
|
48
|
-
* The Patterns class
|
49
|
-
*/
|
50
|
-
patternManifest, } = opt;
|
51
|
-
if (!demo) {
|
52
|
-
return `{% include "${template.alias}" only %}`;
|
53
|
-
}
|
54
|
-
switch (demo.type) {
|
55
|
-
case 'template': {
|
56
|
-
const { absolutePath: templateDemoPath, exists } = await (0, file_utils_1.resolvePath)({
|
57
|
-
path: demo.templateInfo.path,
|
58
|
-
resolveFromDir: this.dataDir,
|
59
|
-
});
|
60
|
-
if (!exists) {
|
61
|
-
throw new Error(`Could not find template demo file at ${templateDemoPath}`);
|
62
|
-
}
|
63
|
-
return (0, file_utils_1.readFile)(templateDemoPath);
|
64
|
-
}
|
65
|
-
case 'data': {
|
66
|
-
const { data: { props, slots, slotsOptionsComputed }, } = demo;
|
67
|
-
if (!slots) {
|
68
|
-
return (0, utils_1.getTwigUsage)({
|
69
|
-
templateName: template.alias,
|
70
|
-
props,
|
71
|
-
});
|
72
|
-
}
|
73
|
-
{
|
74
|
-
const slotProps = {};
|
75
|
-
await Promise.all(Object.keys(slots).map(async (slotName) => {
|
76
|
-
const slottedTemplates = slots[slotName];
|
77
|
-
slotProps[slotName] = await Promise.all(slottedTemplates.map(async (slottedTemplate) => {
|
78
|
-
if (slottedTemplate.type === 'text') {
|
79
|
-
return ` ${slottedTemplate.text}`;
|
80
|
-
}
|
81
|
-
if (slottedTemplate.type === 'template-reference') {
|
82
|
-
throw new Error(`Cannot handle slotted template references in ${JSON.stringify({
|
83
|
-
patternId: pattern.id,
|
84
|
-
templateId: template.id,
|
85
|
-
demoId: demo.id,
|
86
|
-
slottedTemplate,
|
87
|
-
})}`);
|
88
|
-
}
|
89
|
-
const thisPattern = patternManifest.getPattern(slottedTemplate.patternId);
|
90
|
-
const thisTemplate = thisPattern.templates.find((t) => t.id === slottedTemplate.templateId);
|
91
|
-
const usage = await this.getUsage({
|
92
|
-
pattern: thisPattern,
|
93
|
-
template: thisTemplate,
|
94
|
-
patternManifest,
|
95
|
-
demo: slottedTemplate.demo ||
|
96
|
-
this.patterns.demosById[slottedTemplate.demoId],
|
97
|
-
});
|
98
|
-
// indenting 2 spaces since it will be in a `{% set slotName %}` block
|
99
|
-
return usage
|
100
|
-
.split('\n')
|
101
|
-
.map((line) => ` ${line}`)
|
102
|
-
.join('\n');
|
103
|
-
}));
|
104
|
-
}));
|
105
|
-
const extraProps = [];
|
106
|
-
const slotIncludes = Object.keys(slotProps).map((slotName) => {
|
107
|
-
extraProps.push({
|
108
|
-
key: slotName,
|
109
|
-
value: slotName,
|
110
|
-
});
|
111
|
-
const slotCodes = slotProps[slotName];
|
112
|
-
const slotOptionsComputed = slotsOptionsComputed === null || slotsOptionsComputed === void 0 ? void 0 : slotsOptionsComputed[slotName];
|
113
|
-
const { openTag, closeTag } = (0, renderers_1.createSlotOptionsHtmlTags)({
|
114
|
-
slotOptionsComputed,
|
115
|
-
classAttributeName: 'class',
|
116
|
-
stylesValueType: 'string',
|
117
|
-
});
|
118
|
-
return `
|
119
|
-
{% set ${slotName} %}
|
120
|
-
${[openTag, ...slotCodes, closeTag].filter(Boolean).join('\n')}
|
121
|
-
{% endset %}
|
122
|
-
`.trim();
|
123
|
-
});
|
124
|
-
const usage = await (0, utils_1.getTwigUsage)({
|
125
|
-
templateName: template.alias,
|
126
|
-
props,
|
127
|
-
before: slotIncludes.join('\n\n'),
|
128
|
-
extraProps,
|
129
|
-
});
|
130
|
-
return usage;
|
131
|
-
}
|
132
|
-
}
|
133
|
-
default:
|
134
|
-
throw new Error(`Must pass in a demo.type`);
|
135
|
-
}
|
136
|
-
};
|
137
|
-
this.getTemplateSuggestions = async () => {
|
138
|
-
var _a, _b;
|
139
|
-
const { unusedPaths } = await this.getUnusedTemplatePaths({
|
140
|
-
globPaths: __classPrivateFieldGet(this, _KnapsackTwigRenderer_src, "f").roots.map((root) => (0, path_1.join)(root, '**/*.twig')),
|
141
|
-
cwd: this.userConfigDir,
|
142
|
-
});
|
143
|
-
const namespaces = (_b = (_a = __classPrivateFieldGet(this, _KnapsackTwigRenderer_src, "f").namespaces) === null || _a === void 0 ? void 0 : _a.map(({ id, paths }) => {
|
144
|
-
const absPaths = paths.map((path) => (0, path_1.isAbsolute)(path) ? path : (0, path_1.join)(this.userConfigDir, path));
|
145
|
-
return {
|
146
|
-
id,
|
147
|
-
paths: absPaths,
|
148
|
-
};
|
149
|
-
})) !== null && _b !== void 0 ? _b : [];
|
150
|
-
const suggestions = unusedPaths.map((twigPath) => {
|
151
|
-
const namespace = namespaces.find(({ paths }) => paths.some((path) => twigPath.startsWith(path)));
|
152
|
-
let alias;
|
153
|
-
if (namespace) {
|
154
|
-
namespace.paths.forEach((path) => {
|
155
|
-
if (twigPath.startsWith(path)) {
|
156
|
-
const subPath = (0, path_1.relative)(path, twigPath);
|
157
|
-
alias = `@${namespace.id}/${subPath}`;
|
158
|
-
}
|
159
|
-
});
|
160
|
-
}
|
161
|
-
return {
|
162
|
-
path: twigPath,
|
163
|
-
alias,
|
164
|
-
};
|
165
|
-
});
|
166
|
-
return { suggestions };
|
167
|
-
};
|
168
41
|
this.getMeta = () => ({
|
169
42
|
id: this.id,
|
170
43
|
title: 'Twig',
|
@@ -210,6 +83,133 @@ ${[openTag, ...slotCodes, closeTag].filter(Boolean).join('\n')}
|
|
210
83
|
},
|
211
84
|
});
|
212
85
|
}
|
86
|
+
async render(opt) {
|
87
|
+
const usage = await this.getUsage(opt);
|
88
|
+
const results = await this.twigRenderer.renderString(usage);
|
89
|
+
return { ...results, usage, templateLanguage: this.language };
|
90
|
+
// return this.twigRenderer.render(template.alias, data);
|
91
|
+
}
|
92
|
+
async getUsage(opt) {
|
93
|
+
const { pattern, template, demo,
|
94
|
+
/**
|
95
|
+
* The Patterns class
|
96
|
+
*/
|
97
|
+
patternManifest, } = opt;
|
98
|
+
if (!demo) {
|
99
|
+
return `{% include "${template.alias}" only %}`;
|
100
|
+
}
|
101
|
+
switch (demo.type) {
|
102
|
+
case 'template': {
|
103
|
+
const templateDemoPath = patternManifest.getTemplateDemoAbsolutePath({
|
104
|
+
patternId: pattern.id,
|
105
|
+
templateId: template.id,
|
106
|
+
demoId: demo.id,
|
107
|
+
});
|
108
|
+
return (0, fs_extra_1.readFile)(templateDemoPath, 'utf8');
|
109
|
+
}
|
110
|
+
case 'data': {
|
111
|
+
const { data: { props, slots, slotsOptionsComputed }, } = demo;
|
112
|
+
if (!slots) {
|
113
|
+
return (0, utils_1.getTwigUsage)({
|
114
|
+
templateName: template.alias,
|
115
|
+
props,
|
116
|
+
});
|
117
|
+
}
|
118
|
+
{
|
119
|
+
const slotProps = {};
|
120
|
+
await Promise.all(Object.keys(slots).map(async (slotName) => {
|
121
|
+
const slottedTemplates = slots[slotName];
|
122
|
+
slotProps[slotName] = await Promise.all(slottedTemplates.map(async (slottedTemplate) => {
|
123
|
+
if (app_1.KnapsackRendererBase.isSlottedText(slottedTemplate)) {
|
124
|
+
return ` ${slottedTemplate.text}`;
|
125
|
+
}
|
126
|
+
if (app_1.KnapsackRendererBase.isSlottedTemplateReference(slottedTemplate)) {
|
127
|
+
throw new Error(`Cannot handle slotted template references in ${JSON.stringify({
|
128
|
+
patternId: pattern.id,
|
129
|
+
templateId: template.id,
|
130
|
+
demoId: demo.id,
|
131
|
+
slottedTemplate,
|
132
|
+
})}`);
|
133
|
+
}
|
134
|
+
const thisPattern = patternManifest.getPattern(slottedTemplate.patternId);
|
135
|
+
const thisTemplate = thisPattern.templates.find((t) => t.id === slottedTemplate.templateId);
|
136
|
+
const usage = await this.getUsage({
|
137
|
+
pattern: thisPattern,
|
138
|
+
template: thisTemplate,
|
139
|
+
patternManifest,
|
140
|
+
demo: slottedTemplate.demo ||
|
141
|
+
this.patterns.demosById[slottedTemplate.demoId],
|
142
|
+
});
|
143
|
+
// indenting 2 spaces since it will be in a `{% set slotName %}` block
|
144
|
+
return usage
|
145
|
+
.split('\n')
|
146
|
+
.map((line) => ` ${line}`)
|
147
|
+
.join('\n');
|
148
|
+
}));
|
149
|
+
}));
|
150
|
+
const extraProps = [];
|
151
|
+
const slotIncludes = Object.keys(slotProps).map((slotName) => {
|
152
|
+
extraProps.push({
|
153
|
+
key: slotName,
|
154
|
+
value: slotName,
|
155
|
+
});
|
156
|
+
const slotCodes = slotProps[slotName];
|
157
|
+
const slotOptionsComputed = slotsOptionsComputed === null || slotsOptionsComputed === void 0 ? void 0 : slotsOptionsComputed[slotName];
|
158
|
+
const { openTag, closeTag } = createSlotOptionsHtmlTags({
|
159
|
+
slotOptionsComputed,
|
160
|
+
classAttributeName: 'class',
|
161
|
+
stylesValueType: 'string',
|
162
|
+
});
|
163
|
+
return `
|
164
|
+
{% set ${slotName} %}
|
165
|
+
${[openTag, ...slotCodes, closeTag].filter(Boolean).join('\n')}
|
166
|
+
{% endset %}
|
167
|
+
`.trim();
|
168
|
+
});
|
169
|
+
const usage = await (0, utils_1.getTwigUsage)({
|
170
|
+
templateName: template.alias,
|
171
|
+
props,
|
172
|
+
before: slotIncludes.join('\n\n'),
|
173
|
+
extraProps,
|
174
|
+
});
|
175
|
+
return usage;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
default:
|
179
|
+
throw new Error(`Must pass in a demo.type`);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
async getTemplateSuggestions() {
|
183
|
+
var _a, _b;
|
184
|
+
const { unusedPaths } = await this.getUnusedTemplatePaths({
|
185
|
+
globPaths: __classPrivateFieldGet(this, _KnapsackTwigRenderer_src, "f").roots.map((root) => (0, path_1.join)(root, '**/*.twig')),
|
186
|
+
cwd: this.userConfigDir,
|
187
|
+
});
|
188
|
+
const namespaces = (_b = (_a = __classPrivateFieldGet(this, _KnapsackTwigRenderer_src, "f").namespaces) === null || _a === void 0 ? void 0 : _a.map(({ id, paths }) => {
|
189
|
+
const absPaths = paths.map((path) => (0, path_1.isAbsolute)(path) ? path : (0, path_1.join)(this.userConfigDir, path));
|
190
|
+
return {
|
191
|
+
id,
|
192
|
+
paths: absPaths,
|
193
|
+
};
|
194
|
+
})) !== null && _b !== void 0 ? _b : [];
|
195
|
+
const suggestions = unusedPaths.map((twigPath) => {
|
196
|
+
const namespace = namespaces.find(({ paths }) => paths.some((path) => twigPath.startsWith(path)));
|
197
|
+
let alias;
|
198
|
+
if (namespace) {
|
199
|
+
namespace.paths.forEach((path) => {
|
200
|
+
if (twigPath.startsWith(path)) {
|
201
|
+
const subPath = (0, path_1.relative)(path, twigPath);
|
202
|
+
alias = `@${namespace.id}/${subPath}`;
|
203
|
+
}
|
204
|
+
});
|
205
|
+
}
|
206
|
+
return {
|
207
|
+
path: twigPath,
|
208
|
+
alias,
|
209
|
+
};
|
210
|
+
});
|
211
|
+
return { suggestions };
|
212
|
+
}
|
213
213
|
}
|
214
214
|
exports.KnapsackTwigRenderer = KnapsackTwigRenderer;
|
215
215
|
_KnapsackTwigRenderer_src = new WeakMap();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-twig.js","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"renderer-twig.js","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA0D;AAM1D,2CAAuE;AACvE,0EAA8E;AAC9E,+BAAqE;AACrE,uCAAkD;AAClD,qDAAwD;AACxD,mCAAuC;AAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,IAAA,uBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;AACF,SAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAE7B,sBAAsB;AACtB,MAAM,EAAE,yBAAyB,EAAE,GAAG,0BAAoB,CAAC;AAE3D,MAAM,iBAAiB,GAAG,IAAA,WAAI,EAC5B,SAAS,EACT,+CAA+C,CAChD,CAAC;AACF,IAAA,6BAAgB,EAAC,iBAAiB,CAAC,CAAC;AACpC,MAAM,kBAAkB,GAAG,2CAA2C,CAAC;AAEvE,MAAa,oBACX,SAAQ,0BAAoB;IAM5B,YAAY,MAA0B;QACpC,KAAK,CAAC;YACJ,EAAE,EAAE,mBAAW,CAAC,IAAI;YACpB,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,OAAO;SACnB,CAAC,CAAC;QAPL,4CAAgC;QAsMhC,YAAO,GAAwC,GAAG,EAAE,CAAC,CAAC;YACpD,EAA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AE,QAAQ,CAAC,CAAC;wBACzC,KAAK,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC;oBACxC,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,KAAK;aACN,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC;CA+BF;AAxOD,oDAwOC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@knapsack/renderer-twig",
|
3
3
|
"description": "Render Twig",
|
4
|
-
"version": "4.69.9--canary.
|
4
|
+
"version": "4.69.9--canary.4739.3a8c6f1.0",
|
5
5
|
"main": "index.js",
|
6
6
|
"types": "index.d.ts",
|
7
7
|
"exports": {
|
@@ -25,15 +25,17 @@
|
|
25
25
|
"author": "Knapsack (https://www.knapsack.cloud)",
|
26
26
|
"dependencies": {
|
27
27
|
"@basalt/twig-renderer": "^3.2.2",
|
28
|
-
"@knapsack/app": "4.69.9--canary.
|
29
|
-
"@knapsack/file-utils": "4.69.9--canary.
|
30
|
-
"@knapsack/types": "4.69.9--canary.
|
31
|
-
"ejs": "^3.1.10"
|
28
|
+
"@knapsack/app": "4.69.9--canary.4739.3a8c6f1.0",
|
29
|
+
"@knapsack/file-utils": "4.69.9--canary.4739.3a8c6f1.0",
|
30
|
+
"@knapsack/types": "4.69.9--canary.4739.3a8c6f1.0",
|
31
|
+
"ejs": "^3.1.10",
|
32
|
+
"fs-extra": "^11.2.0"
|
32
33
|
},
|
33
34
|
"devDependencies": {
|
34
|
-
"@knapsack/eslint-config-starter": "4.69.9--canary.
|
35
|
-
"@knapsack/test-ava": "4.69.9--canary.
|
36
|
-
"@knapsack/typescript-config-starter": "4.69.9--canary.
|
35
|
+
"@knapsack/eslint-config-starter": "4.69.9--canary.4739.3a8c6f1.0",
|
36
|
+
"@knapsack/test-ava": "4.69.9--canary.4739.3a8c6f1.0",
|
37
|
+
"@knapsack/typescript-config-starter": "4.69.9--canary.4739.3a8c6f1.0",
|
38
|
+
"@types/fs-extra": "^11.0.4",
|
37
39
|
"ava": "^6.1.3",
|
38
40
|
"eslint": "^8.57.0",
|
39
41
|
"typescript": "^5.5.4"
|
@@ -46,5 +48,5 @@
|
|
46
48
|
"directory": "apps/client/renderers/renderer-twig",
|
47
49
|
"type": "git"
|
48
50
|
},
|
49
|
-
"gitHead": "
|
51
|
+
"gitHead": "3a8c6f18de1986c14fe426336bcefb1ca8c8ca21"
|
50
52
|
}
|