diff --git a/constraints.pro b/constraints.pro index 39eebacb9df9..8beae223e6b4 100644 --- a/constraints.pro +++ b/constraints.pro @@ -57,10 +57,12 @@ gen_enforced_field(WorkspaceCwd, 'author', 'The Babel Team (https://babel.dev/te gen_enforced_field(WorkspaceCwd, 'author', null) :- workspace_field(WorkspaceCwd, 'private', true). -% Enforces the main field to start with ./ -gen_enforced_field(WorkspaceCwd, 'main', ExpectedValue) :- +% Enforces the main and types field to start with ./ +gen_enforced_field(WorkspaceCwd, FieldName, ExpectedValue) :- + % Fields the rule applies to + member(FieldName, ['main', 'types']), % Get current value - workspace_field(WorkspaceCwd, 'main', CurrentValue), + workspace_field(WorkspaceCwd, FieldName, CurrentValue), % Must not start with ./ already \+ atom_concat('./', _, CurrentValue), % Store './' + CurrentValue in ExpectedValue diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index db2591bc699c..8dc297752cec 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -23,7 +23,7 @@ "directory": "packages/babel-parser" }, "main": "./lib/index.js", - "types": "typings/babel-parser.d.ts", + "types": "./typings/babel-parser.d.ts", "files": [ "bin", "lib", diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index e930875eb6de..ea103ec8fb28 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -15,7 +15,7 @@ "directory": "packages/babel-types" }, "main": "./lib/index.js", - "types": "lib/index-legacy.d.ts", + "types": "./lib/index-legacy.d.ts", "typesVersions": { ">=3.7": { "lib/index-legacy.d.ts": [