aws / aws/jsii-compiler

JSII Breaks on non SPDX License

Open
#1,775 5 comments 0 reactions 0 assignees View on GitHub
bug p2
Dominant language
TypeScript
Stars
50
Forks
26
Avg merge
7h 10m
Merged PRs (30d)
37

Description

### Describe the bug

Hi there,

I was trying to set a custom License in my package.json like this: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#license

### Expected Behavior

The best for me would be to set non-SPDX licenses like "LicenseRef-MyCoolLicense" as spdx describes here: https://spdx.github.io/spdx-spec/v2-draft/SPDX-license-expressions/

### Current Behavior

```bash
[ERROR] Invalid license identifier "SEE LICENSE IN LICENSE", see valid license identifiers at https://spdx.org/licenses/
```

### Reproduction Steps

create a cdk construct library via projen
set the license like

```typescript
project.package.addField('license', 'SEE LICENSE IN LICENSE');
```

run the build command

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### SDK version used

5.4.0

### Environment details (OS name and version, etc.)

MacOs 15.3

Kind Regards

Henry

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with a projen-generated CDK construct library using `project.package.addField('license', 'SEE LICENSE IN LICENSE')`, then trace where the `Invalid license identifier` error is produced during the build. Done means supported non-SPDX license expressions such as `LicenseRef-MyCoolLicense` no longer break the build, while valid license handling remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.