@nikovirtala/projen-constructs 0.3.66 → 0.3.67
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/.jsii +3 -3
- package/lib/components/bundle-lambda-function-code.js +3 -3
- package/lib/components/colima.js +1 -1
- package/lib/components/homebrew.js +1 -1
- package/lib/components/lambda-function-construct-generator.js +1 -1
- package/lib/components/localstack.js +1 -1
- package/lib/components/mise.js +1 -1
- package/lib/components/typedoc.js +1 -1
- package/lib/components/vitest.js +1 -1
- package/lib/project-generator.js +1 -1
- package/lib/projects/awscdk-construct-library.generated.js +1 -1
- package/lib/projects/awscdk-typescript-app.generated.js +1 -1
- package/lib/projects/jsii.generated.js +1 -1
- package/lib/projects/typescript.generated.js +1 -1
- package/lib/versions.json +1 -1
- package/node_modules/@jsii/spec/lib/assembly-utils.js +39 -1
- package/node_modules/@jsii/spec/package.json +3 -3
- package/package.json +7 -7
package/.jsii
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@mrgrain/cdk-esbuild": "^5.8.5",
|
|
15
15
|
"constructs": "^10.8.1",
|
|
16
|
-
"projen": "^0.104.
|
|
16
|
+
"projen": "^0.104.10"
|
|
17
17
|
},
|
|
18
18
|
"dependencyClosure": {
|
|
19
19
|
"@aws-cdk/asset-awscli-v1": {
|
|
@@ -20946,6 +20946,6 @@
|
|
|
20946
20946
|
"symbolId": "src/components/vitest:VitestOptions"
|
|
20947
20947
|
}
|
|
20948
20948
|
},
|
|
20949
|
-
"version": "0.3.
|
|
20950
|
-
"fingerprint": "
|
|
20949
|
+
"version": "0.3.67",
|
|
20950
|
+
"fingerprint": "kB1yEkk/VIcgeyCG5GOdE7v4ucglrar8CSD3A3NpNdA="
|
|
20951
20951
|
}
|
|
@@ -55,7 +55,7 @@ function convertToPosixPath(p) {
|
|
|
55
55
|
return p.split(node_path_1.sep).join(node_path_1.posix.sep);
|
|
56
56
|
}
|
|
57
57
|
class Bundler extends projen_1.Component {
|
|
58
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Bundler", version: "0.3.
|
|
58
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Bundler", version: "0.3.67" };
|
|
59
59
|
static of(project) {
|
|
60
60
|
const isBundler = (o) => o instanceof Bundler;
|
|
61
61
|
return project.components.find(isBundler);
|
|
@@ -157,7 +157,7 @@ class Bundler extends projen_1.Component {
|
|
|
157
157
|
}
|
|
158
158
|
exports.Bundler = Bundler;
|
|
159
159
|
class LambdaFunctionCodeBundle extends projen_1.Component {
|
|
160
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LambdaFunctionCodeBundle", version: "0.3.
|
|
160
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LambdaFunctionCodeBundle", version: "0.3.67" };
|
|
161
161
|
constructor(project, options) {
|
|
162
162
|
super(project);
|
|
163
163
|
const bundler = Bundler.of(project);
|
|
@@ -200,7 +200,7 @@ class LambdaFunctionCodeBundle extends projen_1.Component {
|
|
|
200
200
|
}
|
|
201
201
|
exports.LambdaFunctionCodeBundle = LambdaFunctionCodeBundle;
|
|
202
202
|
class LambdaFunctionCodeBundler extends projen_1.Component {
|
|
203
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LambdaFunctionCodeBundler", version: "0.3.
|
|
203
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LambdaFunctionCodeBundler", version: "0.3.67" };
|
|
204
204
|
constructor(project, options) {
|
|
205
205
|
super(project);
|
|
206
206
|
const entrypoints = [];
|
package/lib/components/colima.js
CHANGED
|
@@ -6,7 +6,7 @@ const component_1 = require("projen/lib/component");
|
|
|
6
6
|
const task_shell_1 = require("projen/lib/task-shell");
|
|
7
7
|
const homebrew_1 = require("./homebrew");
|
|
8
8
|
class Colima extends component_1.Component {
|
|
9
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Colima", version: "0.3.
|
|
9
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Colima", version: "0.3.67" };
|
|
10
10
|
constructor(scope) {
|
|
11
11
|
super(scope);
|
|
12
12
|
const project = this.project;
|
|
@@ -6,7 +6,7 @@ const component_1 = require("projen/lib/component");
|
|
|
6
6
|
const task_shell_1 = require("projen/lib/task-shell");
|
|
7
7
|
const textfile_1 = require("projen/lib/textfile");
|
|
8
8
|
class Homebrew extends component_1.Component {
|
|
9
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Homebrew", version: "0.3.
|
|
9
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Homebrew", version: "0.3.67" };
|
|
10
10
|
static of(project) {
|
|
11
11
|
const isHomebrew = (c) => c instanceof Homebrew;
|
|
12
12
|
return project.components.find(isHomebrew);
|
|
@@ -39,7 +39,7 @@ const path = __importStar(require("node:path"));
|
|
|
39
39
|
const projen_1 = require("projen");
|
|
40
40
|
const utils_1 = require("../utils");
|
|
41
41
|
class LambdaFunctionConstructGenerator extends projen_1.Component {
|
|
42
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LambdaFunctionConstructGenerator", version: "0.3.
|
|
42
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LambdaFunctionConstructGenerator", version: "0.3.67" };
|
|
43
43
|
sourceDir;
|
|
44
44
|
outputDir;
|
|
45
45
|
filePattern;
|
|
@@ -7,7 +7,7 @@ const javascript_1 = require("projen/lib/javascript");
|
|
|
7
7
|
const colima_1 = require("./colima");
|
|
8
8
|
const homebrew_1 = require("./homebrew");
|
|
9
9
|
class LocalStack extends component_1.Component {
|
|
10
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LocalStack", version: "0.3.
|
|
10
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.LocalStack", version: "0.3.67" };
|
|
11
11
|
constructor(scope, options = {}) {
|
|
12
12
|
super(scope);
|
|
13
13
|
const project = javascript_1.NodeProject.of(this);
|
package/lib/components/mise.js
CHANGED
|
@@ -7,7 +7,7 @@ const component_1 = require("projen/lib/component");
|
|
|
7
7
|
const textfile_1 = require("projen/lib/textfile");
|
|
8
8
|
const homebrew_1 = require("./homebrew");
|
|
9
9
|
class Mise extends component_1.Component {
|
|
10
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Mise", version: "0.3.
|
|
10
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Mise", version: "0.3.67" };
|
|
11
11
|
static of(project) {
|
|
12
12
|
const isMise = (c) => c instanceof Mise;
|
|
13
13
|
return project.components.find(isMise);
|
|
@@ -34,7 +34,7 @@ const DEFAULT_CONFIG = {
|
|
|
34
34
|
* TypeDoc component for projen projects
|
|
35
35
|
*/
|
|
36
36
|
class TypeDoc extends component_1.Component {
|
|
37
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.TypeDoc", version: "0.3.
|
|
37
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.TypeDoc", version: "0.3.67" };
|
|
38
38
|
static of(project) {
|
|
39
39
|
const isTypeDoc = (c) => c instanceof TypeDoc;
|
|
40
40
|
return project.components.find(isTypeDoc);
|
package/lib/components/vitest.js
CHANGED
|
@@ -140,7 +140,7 @@ var CoverageReporter;
|
|
|
140
140
|
CoverageReporter["TEXT"] = "text";
|
|
141
141
|
})(CoverageReporter || (exports.CoverageReporter = CoverageReporter = {}));
|
|
142
142
|
class Vitest extends component_1.Component {
|
|
143
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Vitest", version: "0.3.
|
|
143
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.Vitest", version: "0.3.67" };
|
|
144
144
|
static of(project) {
|
|
145
145
|
const isVitest = (c) => c instanceof Vitest;
|
|
146
146
|
return project.components.find(isVitest);
|
package/lib/project-generator.js
CHANGED
|
@@ -422,7 +422,7 @@ class TypeScriptClassRenderer {
|
|
|
422
422
|
*/
|
|
423
423
|
class ProjectGenerator extends projen.Component {
|
|
424
424
|
options;
|
|
425
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.ProjectGenerator", version: "0.3.
|
|
425
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.ProjectGenerator", version: "0.3.67" };
|
|
426
426
|
renderer;
|
|
427
427
|
static enumGenerated = false;
|
|
428
428
|
/**
|
|
@@ -15,7 +15,7 @@ const utils_1 = require("../utils");
|
|
|
15
15
|
* Extends Projen's base class with opinionated defaults and automatic component setup.
|
|
16
16
|
*/
|
|
17
17
|
class AwsCdkConstructLibraryProject extends projen_1.awscdk.AwsCdkConstructLibrary {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.AwsCdkConstructLibraryProject", version: "0.3.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.AwsCdkConstructLibraryProject", version: "0.3.67" };
|
|
19
19
|
/**
|
|
20
20
|
* @param options - Project configuration
|
|
21
21
|
*/
|
|
@@ -15,7 +15,7 @@ const utils_1 = require("../utils");
|
|
|
15
15
|
* Extends Projen's base class with opinionated defaults and automatic component setup.
|
|
16
16
|
*/
|
|
17
17
|
class AwsCdkTypeScriptAppProject extends projen_1.awscdk.AwsCdkTypeScriptApp {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.AwsCdkTypeScriptAppProject", version: "0.3.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.AwsCdkTypeScriptAppProject", version: "0.3.67" };
|
|
19
19
|
/**
|
|
20
20
|
* @param options - Project configuration
|
|
21
21
|
*/
|
|
@@ -16,7 +16,7 @@ const utils_1 = require("../utils");
|
|
|
16
16
|
* Extends Projen's base class with opinionated defaults and automatic component setup.
|
|
17
17
|
*/
|
|
18
18
|
class JsiiProject extends projen_1.cdk.JsiiProject {
|
|
19
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.JsiiProject", version: "0.3.
|
|
19
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.JsiiProject", version: "0.3.67" };
|
|
20
20
|
/**
|
|
21
21
|
* @param options - Project configuration
|
|
22
22
|
*/
|
|
@@ -15,7 +15,7 @@ const utils_1 = require("../utils");
|
|
|
15
15
|
* Extends Projen's base class with opinionated defaults and automatic component setup.
|
|
16
16
|
*/
|
|
17
17
|
class TypeScriptProject extends projen_1.typescript.TypeScriptProject {
|
|
18
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.TypeScriptProject", version: "0.3.
|
|
18
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@nikovirtala/projen-constructs.TypeScriptProject", version: "0.3.67" };
|
|
19
19
|
/**
|
|
20
20
|
* @param options - Project configuration
|
|
21
21
|
*/
|
package/lib/versions.json
CHANGED
|
@@ -114,6 +114,12 @@ function writeAssembly(directory, assembly, { compress = false } = {}) {
|
|
|
114
114
|
}
|
|
115
115
|
return compress;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* The maximum number of `jsii/file-redirect` hops followed when loading an
|
|
119
|
+
* assembly. The jsii compiler only ever emits a single redirect (to the
|
|
120
|
+
* compressed assembly), so this leaves ample headroom while preventing loops.
|
|
121
|
+
*/
|
|
122
|
+
const MAX_ASSEMBLY_REDIRECTS = 5;
|
|
117
123
|
const failNoReadfileProvided = (filename) => {
|
|
118
124
|
throw new Error(`Unable to load assembly support file ${JSON.stringify(filename)}: no readFile callback provided!`);
|
|
119
125
|
};
|
|
@@ -129,7 +135,11 @@ const failNoReadfileProvided = (filename) => {
|
|
|
129
135
|
function loadAssemblyFromBuffer(assemblyBuffer, readFile = failNoReadfileProvided, validate = true, supportedFeatures = []) {
|
|
130
136
|
let contents = JSON.parse(assemblyBuffer.toString('utf-8'));
|
|
131
137
|
// check if the file holds instructions to the actual assembly file
|
|
138
|
+
let redirects = 0;
|
|
132
139
|
while ((0, redirect_1.isAssemblyRedirect)(contents)) {
|
|
140
|
+
if (++redirects > MAX_ASSEMBLY_REDIRECTS) {
|
|
141
|
+
throw new Error(`Too many assembly redirects (more than ${MAX_ASSEMBLY_REDIRECTS})`);
|
|
142
|
+
}
|
|
133
143
|
contents = followRedirect(contents, readFile);
|
|
134
144
|
}
|
|
135
145
|
// Do feature checking *before* validating using JSONSchema, and do it always.
|
|
@@ -166,15 +176,43 @@ function loadAssemblyFromPath(directory, validate = true, supportedFeatures) {
|
|
|
166
176
|
function loadAssemblyFromFile(pathToFile, validate = true, supportedFeatures) {
|
|
167
177
|
const data = fs.readFileSync(pathToFile);
|
|
168
178
|
try {
|
|
169
|
-
return loadAssemblyFromBuffer(data, (filename) =>
|
|
179
|
+
return loadAssemblyFromBuffer(data, (filename) => readSupportFile(path.dirname(pathToFile), filename), validate, supportedFeatures);
|
|
170
180
|
}
|
|
171
181
|
catch (e) {
|
|
172
182
|
throw new Error(`Error loading assembly from file ${pathToFile}:\n${e}`);
|
|
173
183
|
}
|
|
174
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Reads an assembly support file, making sure it is located inside `directory`
|
|
187
|
+
* (after resolving any symbolic links).
|
|
188
|
+
*/
|
|
189
|
+
function readSupportFile(directory, filename) {
|
|
190
|
+
const realDir = fs.realpathSync(directory);
|
|
191
|
+
const realFile = fs.realpathSync(path.resolve(realDir, filename));
|
|
192
|
+
const relative = path.relative(realDir, realFile);
|
|
193
|
+
if (relative === '' ||
|
|
194
|
+
relative === '..' ||
|
|
195
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
196
|
+
path.isAbsolute(relative)) {
|
|
197
|
+
throw new Error(`Assembly redirect target ${JSON.stringify(filename)} resolves outside of ${directory}`);
|
|
198
|
+
}
|
|
199
|
+
return fs.readFileSync(realFile);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Lexically checks that a redirect `filename` is a relative path that does not
|
|
203
|
+
* escape the directory containing the redirect.
|
|
204
|
+
*/
|
|
205
|
+
function assertRelativeRedirectFilename(filename) {
|
|
206
|
+
if (path.posix.isAbsolute(filename) ||
|
|
207
|
+
path.win32.isAbsolute(filename) ||
|
|
208
|
+
filename.split(/[\\/]/).includes('..')) {
|
|
209
|
+
throw new Error(`Invalid assembly redirect filename ${JSON.stringify(filename)}: must be a relative path inside the package`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
175
212
|
function followRedirect(assemblyRedirect, readFile) {
|
|
176
213
|
// Validating the schema, this is cheap (the schema is small).
|
|
177
214
|
(0, redirect_1.validateAssemblyRedirect)(assemblyRedirect);
|
|
215
|
+
assertRelativeRedirectFilename(assemblyRedirect.filename);
|
|
178
216
|
let data = readFile(assemblyRedirect.filename);
|
|
179
217
|
switch (assemblyRedirect.compression) {
|
|
180
218
|
case 'gzip':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsii/spec",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.142.0",
|
|
4
4
|
"description": "Specification for jsii assemblies",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"ajv": "^8.20.0",
|
|
35
35
|
"esbuild": "^0.28.2",
|
|
36
36
|
"eslint": "^9.39.5",
|
|
37
|
-
"jest": "^30.5.
|
|
38
|
-
"jsii-build-tools": "^1.
|
|
37
|
+
"jest": "^30.5.2",
|
|
38
|
+
"jsii-build-tools": "^1.142.0",
|
|
39
39
|
"typescript": "6.x",
|
|
40
40
|
"typescript-json-schema": "^0.68.0"
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@biomejs/biome": "^2.5",
|
|
15
|
-
"@jsii/spec": "^1.
|
|
15
|
+
"@jsii/spec": "^1.142.0",
|
|
16
16
|
"@mrgrain/cdk-esbuild": "5.8.5",
|
|
17
17
|
"@types/node": "^24",
|
|
18
18
|
"@vitest/coverage-v8": "^4",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"constructs": "^10.8.1",
|
|
21
21
|
"esbuild": "^0.28.2",
|
|
22
22
|
"jsii": "~6.0.3",
|
|
23
|
-
"jsii-diff": "^1.
|
|
23
|
+
"jsii-diff": "^1.142.0",
|
|
24
24
|
"jsii-docgen": "^10.5.0",
|
|
25
|
-
"jsii-pacmak": "^1.
|
|
25
|
+
"jsii-pacmak": "^1.142.0",
|
|
26
26
|
"jsii-rosetta": "~6.0.3",
|
|
27
|
-
"projen": "^0.104.
|
|
27
|
+
"projen": "^0.104.10",
|
|
28
28
|
"tsx": "^4.23.15",
|
|
29
29
|
"typedoc": "^0.28",
|
|
30
30
|
"typescript": "6.0.3",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@mrgrain/cdk-esbuild": "^5.8.5",
|
|
35
35
|
"constructs": "^10.8.1",
|
|
36
|
-
"projen": "^0.104.
|
|
36
|
+
"projen": "^0.104.10"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@mrgrain/jsii-struct-builder": "^0.7.64",
|
|
40
40
|
"case": "^1.6.3",
|
|
41
|
-
"projen": "^0.104.
|
|
41
|
+
"projen": "^0.104.10"
|
|
42
42
|
},
|
|
43
43
|
"bundledDependencies": [
|
|
44
44
|
"@mrgrain/jsii-struct-builder",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
|
-
"version": "0.3.
|
|
63
|
+
"version": "0.3.67",
|
|
64
64
|
"types": "lib/index.d.ts",
|
|
65
65
|
"jsii": {
|
|
66
66
|
"outdir": "dist",
|