Skip to content

Commit

Permalink
Fixed themes d.ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Nov 15, 2024
1 parent 73ba3ee commit eea47c6
Show file tree
Hide file tree
Showing 455 changed files with 3,900 additions and 344 deletions.
8 changes: 0 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,5 @@
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"workbench.colorCustomizations": {
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#d0b79e",
"titleBar.activeBackground": "#c09d7b",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#c09d7b99",
"titleBar.inactiveForeground": "#15202b99"
}
}
39 changes: 2 additions & 37 deletions packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,17 @@
"module": "./src/index.ts",
"exports": {
".": "./src/index.ts",
"./aura": "./src/presets/aura/index.ts",
"./lara": "./src/presets/lara/index.ts",
"./material": "./src/presets/material/index.ts",
"./nora": "./src/presets/nora/index.ts",
"./aura/*": {
"types": "./types/*/index.d.ts",
"import": "./src/presets/aura/*/index.ts"
},
"./lara/*": {
"types": "./types/*/index.d.ts",
"import": "./src/presets/lara/*/index.ts"
},
"./material/*": {
"types": "./types/*/index.d.ts",
"import": "./src/presets/material/*/index.ts"
},
"./nora/*": {
"types": "./types/*/index.d.ts",
"import": "./src/presets/nora/*/index.ts"
}
"./*": "./src/presets/*/index.ts"
},
"publishConfig": {
"main": "./index.mjs",
"module": "./index.mjs",
"types": "./index.d.mts",
"exports": {
".": {
"types": "./index.d.ts",
"types": "./index.d.mts",
"import": "./index.mjs"
},
"./aura/*": {
"types": "./types/*/index.d.ts",
"import": "./aura/*/index.mjs"
},
"./lara/*": {
"types": "./types/*/index.d.ts",
"import": "./lara/*/index.mjs"
},
"./material/*": {
"types": "./types/*/index.d.ts",
"import": "./material/*/index.mjs"
},
"./nora/*": {
"types": "./types/*/index.d.ts",
"import": "./nora/*/index.mjs"
},
"./*": {
"types": "./*/index.d.ts",
"import": "./*/index.mjs"
Expand Down
28 changes: 0 additions & 28 deletions packages/themes/scripts/prebuild.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fs from 'fs-extra';
import path from 'path';
import { removeBuild, resolvePath, updatePackageJson } from '../../../scripts/build-helper.mjs';

Expand All @@ -9,30 +8,3 @@ const __root = path.resolve(__dirname, '../');
const pkg = path.resolve(__root, './package.json');

updatePackageJson(pkg);

// update package.json > "publishConfig.exports" for publish
let exports = {
'.': {
types: './index.d.ts',
import: './index.mjs'
}
};

fs.readdirSync(path.resolve(__root, INPUT_DIR + 'presets'), { withFileTypes: true })
.filter((dir) => dir.isDirectory())
.forEach(({ name: folderName }) => {
exports[`./${folderName}/*`] = {
types: `./types/*/index.d.ts`,
import: `./${folderName}/*/index.mjs`
};
});
exports['./*'] = {
types: './*/index.d.ts',
import: './*/index.mjs'
};

const pkgJson = JSON.parse(fs.readFileSync(pkg, { encoding: 'utf8', flag: 'r' }));

pkgJson.publishConfig.exports = exports;

fs.writeFileSync(pkg, JSON.stringify(pkgJson, null, 4));
3 changes: 3 additions & 0 deletions packages/themes/src/presets/aura/accordion/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AccordionDesignTokens } from '../../types/accordion';
declare const _default: AccordionDesignTokens;
export default _default;
3 changes: 3 additions & 0 deletions packages/themes/src/presets/aura/autocomplete/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AutoCompleteDesignTokens } from '../../types/autocomplete';
declare const _default: AutoCompleteDesignTokens;
export default _default;
3 changes: 3 additions & 0 deletions packages/themes/src/presets/aura/avatar/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AvatarDesignTokens } from '../../types/avatar';
declare const _default: AvatarDesignTokens;
export default _default;
3 changes: 3 additions & 0 deletions packages/themes/src/presets/aura/badge/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { BadgeDesignTokens } from '../../types/badge';
declare const _default: BadgeDesignTokens;
export default _default;
Loading

0 comments on commit eea47c6

Please sign in to comment.