Skip to content

Commit

Permalink
fix: fixed some found issues
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis committed Nov 17, 2024
1 parent 81674b5 commit 60a3985
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 14 deletions.
4 changes: 2 additions & 2 deletions examples/isolated-declarations-oxc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
">=5.5": {
".": [
"./dist/index.d.ts"
"./dist/index.d.cts"
]
}
},
Expand Down
1 change: 1 addition & 0 deletions examples/isolated-declarations-oxc/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig({
isolatedDeclarationTransformer,
rollup: {
node10Compatibility: {
typeScriptVersion: ">=5.5",
writeToPackageJson: true,
},
},
Expand Down
4 changes: 2 additions & 2 deletions examples/isolated-declarations-swc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
">=5.5": {
".": [
"./dist/index.d.ts"
"./dist/index.d.cts"
]
}
},
Expand Down
1 change: 1 addition & 0 deletions examples/isolated-declarations-swc/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig({
isolatedDeclarationTransformer,
rollup: {
node10Compatibility: {
typeScriptVersion: ">=5.5",
writeToPackageJson: true,
},
},
Expand Down
7 changes: 1 addition & 6 deletions examples/isolated-declarations-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
">=5.0": {
">=5.5": {
".": [
"./dist/index.d.cts"
]
},
"*": {
".": [
"./dist/index.d.ts"
]
}
},
"files": [
Expand Down
1 change: 1 addition & 0 deletions examples/isolated-declarations-typescript/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineConfig({
isolatedDeclarationTransformer,
rollup: {
node10Compatibility: {
typeScriptVersion: ">=5.5",
writeToPackageJson: true,
},
},
Expand Down
56 changes: 56 additions & 0 deletions packages/packem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,62 @@
"css/minifier/lightningcss": [
"./dist/rollup/plugins/css/minifiers/lightningcss.d.ts"
]
},
">=5.5": {
".": [
"./dist/packem.d.ts"
],
"config": [
"./dist/config.d.ts"
],
"transformer/esbuild": [
"./dist/rollup/plugins/esbuild/index.d.ts"
],
"transformer/swc": [
"./dist/rollup/plugins/swc/swc-plugin.d.ts"
],
"dts/isolated/transformer/swc": [
"./dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts"
],
"dts/isolated/transformer/oxc": [
"./dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts"
],
"dts/isolated/transformer/typescript": [
"./dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts"
],
"transformer/sucrase": [
"./dist/rollup/plugins/sucrase/index.d.ts"
],
"builder/typedoc": [
"./dist/builder/typedoc/index.d.ts"
],
"runtime/inject-css": [
"./dist/rollup/plugins/css/runtime/inject-css.d.ts"
],
"css/loader/sourcemap": [
"./dist/rollup/plugins/css/loaders/sourcemap.d.ts"
],
"css/loader/less": [
"./dist/rollup/plugins/css/loaders/less/index.d.ts"
],
"css/loader/postcss": [
"./dist/rollup/plugins/css/loaders/postcss/index.d.ts"
],
"css/loader/sass": [
"./dist/rollup/plugins/css/loaders/sass/index.d.ts"
],
"css/loader/stylus": [
"./dist/rollup/plugins/css/loaders/stylus/index.d.ts"
],
"css/loader/lightningcss": [
"./dist/rollup/plugins/css/loaders/lightningcss.d.ts"
],
"css/minifier/cssnano": [
"./dist/rollup/plugins/css/minifiers/cssnano.d.ts"
],
"css/minifier/lightningcss": [
"./dist/rollup/plugins/css/minifiers/lightningcss.d.ts"
]
}
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packages/packem/packem.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
path: "./LICENSE.md",
},
node10Compatibility: {
typeScriptVersion: ">=5.0",
typeScriptVersion: ">=5.5",
writeToPackageJson: true,
},
},
Expand Down
3 changes: 2 additions & 1 deletion packages/packem/src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const createAddCommand = (cli: Cli): void => {
return;
}

// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
const cssLoaders: (keyof typeof cssLoaderDependencies | "sourceMap")[] = [];

const mainCssLoader = (await select({
Expand Down Expand Up @@ -128,7 +129,7 @@ const createAddCommand = (cli: Cli): void => {
const packagesToInstall: string[] = [];

for (const loader of cssLoaders) {
packagesToInstall.push(...cssLoaderDependencies[loader as keyof typeof cssLoaderDependencies]);
packagesToInstall.push(...cssLoaderDependencies[loader as keyof typeof cssLoaderDependencies] as string[]);
}

cssLoaders.push("sourceMap");
Expand Down
2 changes: 0 additions & 2 deletions packages/packem/src/rollup/get-rollup-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,6 @@ export const getRollupDtsOptions = async (context: BuildContext, fileCache: File

nodeResolver,

context.options.sourcemap && sourcemapsPlugin(context.options.rollup.sourcemap),

...normalPlugins,

await memoizeDtsPluginByKey(uniqueProcessId)(context),
Expand Down

0 comments on commit 60a3985

Please sign in to comment.