Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .backportrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 0 additions & 59 deletions .github/workflows/auto-tag-dev-v5.7.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/auto-tag-dev-v5.8.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 0 additions & 59 deletions .github/workflows/auto-tag-releases-v5.7.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/auto-tag-releases-v5.8.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 0 additions & 98 deletions .github/workflows/upgrade-maintenance-v5.7.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/assembler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class Assembler implements Emitter {
private readonly mainFile: string;
private readonly tscRootDir?: string;
private readonly compressAssembly?: boolean;
private readonly usedFeatures = new Set<spec.JsiiFeature>();

private readonly _typeChecker: ts.TypeChecker;

Expand Down Expand Up @@ -119,6 +120,9 @@ export class Assembler implements Emitter {

this.mainFile = path.resolve(projectInfo.projectRoot, mainFile);
this.runtimeTypeInfoInjector = new RuntimeTypeInfoInjector(projectInfo.version);

// Always enabled features
// this.usedFeatures.add('class-covariant-overrides' as any);
}

public get customTransformers(): ts.CustomTransformers {
Expand Down Expand Up @@ -220,6 +224,7 @@ export class Assembler implements Emitter {
jsiiVersion,
bin: this.projectInfo.bin,
fingerprint: '<TBD>',
usedFeatures: this.usedFeatures.size > 0 ? Array.from(this.usedFeatures).sort() : undefined,
};

if (this.deprecatedRemover) {
Expand Down Expand Up @@ -1834,13 +1839,13 @@ export class Assembler implements Emitter {
const baseMembers = memberNames(base);
for (const memberName of names) {
if (baseMembers.includes(memberName)) {
this._diagnostics.push(
JsiiDiagnostic.JSII_5015_REDECLARED_INTERFACE_MEMBER.create(
type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],
memberName,
jsiiType,
),
);
// this._diagnostics.push(
// JsiiDiagnostic.JSII_5015_REDECLARED_INTERFACE_MEMBER.create(
// type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],
// memberName,
// jsiiType,
// ),
// );
}
}
// Recurse upwards
Expand Down
7 changes: 6 additions & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export type MultipleSourceFiles = {
[name: string]: string;
};

/**
* Assembly features supported by this compiler
*/
export const ASSEMBLY_FEATURES_SUPPORTED: spec.JsiiFeature[] = ['class-covariant-overrides' as any];

/**
* Compile a piece of source and return the JSII assembly for it
*
Expand Down Expand Up @@ -115,7 +120,7 @@ export function compileJsiiForTest(
if (errors.length > 0 || emitResult.emitSkipped) {
throw new JsiiError('There were compiler errors');
}
const assembly = loadAssemblyFromPath(process.cwd(), false);
const assembly = loadAssemblyFromPath(process.cwd(), false, ASSEMBLY_FEATURES_SUPPORTED);
const files: Record<string, string> = {};

for (const filename of Object.keys(source)) {
Expand Down
3 changes: 2 additions & 1 deletion src/project-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as semver from 'semver';
import * as ts from 'typescript';

import { findDependencyDirectory } from './common/find-utils';
import { ASSEMBLY_FEATURES_SUPPORTED } from './helpers';
import { JsiiDiagnostic } from './jsii-diagnostic';
import { TypeScriptConfigValidationRuleSet } from './tsconfig';
import { JsiiError, parsePerson, parseRepository } from './utils';
Expand Down Expand Up @@ -392,7 +393,7 @@ class DependencyResolver {
return this.cache.get(jsiiFile)!;
}

const assembly = loadAssemblyFromFile(jsiiFile);
const assembly = loadAssemblyFromFile(jsiiFile, true, ASSEMBLY_FEATURES_SUPPORTED);

// Continue loading any dependencies declared in the asm
const resolvedDependencies = assembly.dependencies
Expand Down
Loading
Loading