chore(deps): upgrade dependencies (#2732)
Upgrades project dependencies. See details in workflow run.
Automatically created by projen via the “upgrade-main” workflow
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Overview
jsiiallows code in any language to naturally interact with JavaScript classes. It is the technology that enables the AWS Cloud Development Kit to deliver polyglot libraries from a single codebase!A class library written in TypeScript can be used in projects authored in TypeScript or Javascript (as usual), but also in Python, Java, C# (and other languages from the .NET family), …
:gear: Support & Maintenance
Head over to our documentation website!
Our Maintenance & Support policy can be reviewed in SUPPORT.md. The current status of
jsiicompiler releases is:6.0.x5.9.x⬆️ Upgrading to jsii 6.0
jsii6.0 adopts TypeScript 6.0. The actions below are driven by TypeScript 6.0’s new defaults and deprecations; see the TypeScript 6.0 announcement and the Node Target Mapping notes for the upstream details.If jsii generates your
tsconfig.jsonThis is the default. After upgrading, work through the following:
package.json"type"field.moduleis nownode20, so TypeScript decides whether each file is CommonJS or ESM from"type". Leave it unset (or"commonjs") to keep CommonJS output; only set"type": "module"if you intend to ship ESM. Then fix any new per-file module errors this surfaces — this is the most impactful change.esModuleInteropis always enabled now, so update namespace imports that were used as a default — e.g. changeimport * as express from "express"toimport express from "express".noUncheckedSideEffectImportsis enabled, so a side-effect-only import — one with no bindings, e.g.import "./register-handlers"— now errors if its path does not resolve. Correct the path or remove the import (previously a misspelled path was accepted silently).declareto redeclared properties. With theES2023target/lib, class fields use define semantics; if a subclass restates a property from its base, mark itdeclare(or give it an initializer).typesdefaults to["*"], so ambient globals such asprocesskeep working with no action. For faster, more predictable builds, set an explicit list viajsii.tsc.typesinpackage.json(e.g.["node"]).If you provide your own
tsconfig.jsonWhen you provide your own
tsconfig.json, jsii uses it verbatim and does not merge in the compiler options it would otherwise generate for you, so TypeScript 6.0’s new defaults apply directly. jsii also validates your config against the rule set selected by--validate-tsconfig(strictby default), which now rejects the options TypeScript 6.0 deprecates. Make these changes both to satisfy TypeScript 6.0 and to pass validation:esModuleInterop: true(or remove thefalse) — TypeScript 6.0 errors on the deprecated value.typesarray (e.g.["node", "jest"]) — TypeScript 6.0 defaultstypesto[], which otherwise drops ambient globals likeprocessand test framework declarations.baseUrlwith relativepathsentries, and changemoduleResolution: node(a.k.a.node10) tonode16,nodenext, orbundler.strictandgeneratedrule sets now reject everything TypeScript 6.0 deprecates:esModuleInterop: false,allowSyntheticDefaultImports: false,alwaysStrict: false,target: es5,modulevaluesamd/umd/systemjs/none,moduleResolutionvaluesnode/node10/classic,downlevelIteration,outFile, andbaseUrl.jsii.tsc.baseUrlIf you set
jsii.tsc.baseUrlinpackage.json, move the prefix into yourjsii.tsc.pathsentries — it is no longer read (baseUrlis deprecated in TypeScript 6.0).TypeScript 7.0
TypeScript 7.0 (the native port) is not yet supported. We are waiting on a finalized API proposal from the TypeScript maintainers; until then,
jsiiwill remain on TypeScript 6.0.Head over to our documentation website for a comprehensive documentation for all things jsii! The jsii toolchain is spread out on multiple repositories:
jsiicompiler is maintainedjsii-rosettasample code transliteration tool is maintainedjsii-pacmakand languageruntimesHere’s a collection of blog posts (in chronological order) related to
jsii:When you provide your own
tsconfig.json(via--tsconfig),jsiivalidates itscompilerOptionsagainst a rule set (strictby default). Two commands let you inspect those rule sets and validate a configuration file directly, without running a full compilation.jsii rulesPrints the validation rules for a rule set, so you can see exactly what each setting enforces:
The output lists, per
compilerOptionsfield, whether it must be present and what values are allowed (or disallowed), and whether unknown options are rejected for that rule set.jsii validate-tsconfigValidates an existing TypeScript configuration file against a rule set and reports any violations. It exits with a non-zero status when validation fails, which makes it suitable for use in CI or pre-commit checks:
The available rule sets are
strict,generated,minimal, andoff. They behave exactly as the--validate-tsconfigoption does during compilation; see Upgrading to jsii 6.0 for guidance on the rules each set enforces.🔇 Silencing Warnings
The
--silence-warningsoption allows you to suppress specific warnings from the compiler output. Silenced warnings are still emitted internally (e.g. they are still part of the assembly), but are not printed to the console. When--fail-on-warnings(--Werr) is set, silenced warnings are not treated as errors.Warnings can be identified by JSII code, number, or diagnostic name:
Inline Suppression
Individual warnings can be suppressed directly in source code using the
@jsii suppressdirective. This is useful when you want--fail-on-warningsenabled globally but need to allow specific instances of a warning.Each directive accepts a single warning identifier using the same formats as
--silence-warnings. An optional text after the identifier is treated as an explanation comment. Use multiple directives to suppress multiple warnings:The suppression applies to the annotated declaration and all of its members. For example, a
@jsii suppressdirective on a class will suppress matching warnings on all methods and properties within that class.Only warnings that reference a source code location can be suppressed inline. Warnings not tied to a specific node (e.g.
JSII0003for a missing README) are not affected.:balance_scale: License
jsii is distributed under the Apache License, Version 2.0.
See LICENSE and NOTICE for more information.
:gear: Contributing
See CONTRIBUTING for contribution guidelines