Skip to content

fix esm vs. cjs typings #1197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/bin/license/allowed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ const missingLicenseExceptions = [
{
file: 'node_modules/filter-iterator/package.json',
},
{
file: 'node_modules/@andrewbranch/untar.js/package.json',
},
];

export function missingLicenseIsOkByException(file) {
Expand Down
2 changes: 1 addition & 1 deletion .github/bin/license/check-license.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const allFiles = (await getFiles('./')).filter((file) => {

for (const line of lines) {
if (line.includes('@license')) {
if (line.startsWith(' * @license W3C')) {
if (line.trim().startsWith('* @license W3C')) {
// W3C license is ok
continue;
}
Expand Down
3 changes: 3 additions & 0 deletions experimental/css-has-pseudo/dist/index.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PluginCreator } from 'postcss';
declare const creator: PluginCreator<unknown>;
export = creator;
3 changes: 3 additions & 0 deletions experimental/css-has-pseudo/dist/index.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PluginCreator } from 'postcss';
declare const creator: PluginCreator<unknown>;
export { creator as default };
4 changes: 2 additions & 2 deletions experimental/css-has-pseudo/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type { PluginCreator } from 'postcss';
import { PluginCreator } from 'postcss';
declare const creator: PluginCreator<unknown>;
export default creator;
export = creator;
16 changes: 11 additions & 5 deletions experimental/css-has-pseudo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@
"engines": {
"node": "^14 || ^16 || >=18"
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"default": "./dist/index.mjs"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./browser": {
"import": "./dist/browser.mjs",
Expand Down
2 changes: 1 addition & 1 deletion experimental/css-has-pseudo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"declarationDir": "."
"declarationDir": "dist"
},
"include": ["./src/**/*"],
"exclude": ["dist"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { PluginCreator } from 'postcss';
/** postcss-gradient-stop-increments plugin options */
type pluginOptions = {
/** Preserve the original notation. default: false */
preserve?: boolean;
};
declare const creator: PluginCreator<pluginOptions>;
export type { pluginOptions };
export = creator;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { PluginCreator } from 'postcss';
/** postcss-gradient-stop-increments plugin options */
type pluginOptions = {
/** Preserve the original notation. default: false */
preserve?: boolean;
};
declare const creator: PluginCreator<pluginOptions>;
export { creator as default, pluginOptions };
7 changes: 4 additions & 3 deletions experimental/postcss-gradient-stop-increments/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { PluginCreator } from 'postcss';
import { PluginCreator } from 'postcss';
/** postcss-gradient-stop-increments plugin options */
export type pluginOptions = {
type pluginOptions = {
/** Preserve the original notation. default: false */
preserve?: boolean;
};
declare const creator: PluginCreator<pluginOptions>;
export default creator;
export type { pluginOptions };
export = creator;
17 changes: 11 additions & 6 deletions experimental/postcss-gradient-stop-increments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,20 @@
"engines": {
"node": "^14 || ^16 || >=18"
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"default": "./dist/index.mjs"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"declarationDir": ".",
"declarationDir": "dist",
"strict": true
},
"include": ["./src/**/*"],
Expand Down
3 changes: 3 additions & 0 deletions experimental/postcss-nesting/dist/index.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PluginCreator } from 'postcss';
declare const creator: PluginCreator<never>;
export = creator;
3 changes: 3 additions & 0 deletions experimental/postcss-nesting/dist/index.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PluginCreator } from 'postcss';
declare const creator: PluginCreator<never>;
export { creator as default };
4 changes: 2 additions & 2 deletions experimental/postcss-nesting/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type { PluginCreator } from 'postcss';
import { PluginCreator } from 'postcss';
declare const creator: PluginCreator<never>;
export default creator;
export = creator;
2 changes: 0 additions & 2 deletions experimental/postcss-nesting/dist/lib/ampersand-to-scope.d.ts

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions experimental/postcss-nesting/dist/lib/atrule-within-rule.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions experimental/postcss-nesting/dist/lib/cleanup-parent.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions experimental/postcss-nesting/dist/lib/group-declarations.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions experimental/postcss-nesting/dist/lib/is-type-of-rule.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion experimental/postcss-nesting/dist/lib/list.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion experimental/postcss-nesting/dist/lib/merge-params.d.ts

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions experimental/postcss-nesting/dist/lib/rule-within-rule.d.ts

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions experimental/postcss-nesting/dist/lib/valid-atrules.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions experimental/postcss-nesting/dist/lib/walk-func.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions experimental/postcss-nesting/dist/lib/walk.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion experimental/postcss-nesting/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"declarationDir": "."
"declarationDir": "dist"
},
"include": ["./src/**/*"],
"exclude": ["dist"],
Expand Down
1 change: 1 addition & 0 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"@rollup/plugin-terser",
"@rollup/plugin-typescript",
"@stryker-mutator/command-runner",
"rollup-plugin-ts",
"tslib"
]
}
Loading