diff --git a/package-lock.json b/package-lock.json index cad39ccb3ec..1f6433739e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -110081,18 +110081,6 @@ } } }, - "node_modules/typescript-transform-paths": { - "version": "3.4.6", - "resolved": "https://registry.npmjs.org/typescript-transform-paths/-/typescript-transform-paths-3.4.6.tgz", - "integrity": "sha512-qdgpCk9oRHkIBhznxaHAapCFapJt5e4FbFik7Y4qdqtp6VyC3smAIPoDEIkjZ2eiF7x5+QxUPYNwJAtw0thsTw==", - "dev": true, - "dependencies": { - "minimatch": "^3.0.4" - }, - "peerDependencies": { - "typescript": ">=3.6.5" - } - }, "node_modules/typescript-tuple": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/typescript-tuple/-/typescript-tuple-2.2.1.tgz", @@ -118007,8 +117995,8 @@ "rollup": "2.76.0", "rollup-plugin-dts": "4.2.2", "rollup-plugin-typescript2": "0.32.1", - "ttypescript": "^1.5.15", - "typescript-transform-paths": "^3.4.4" + "ttypescript": "1.5.15", + "typescript-transform-paths": "3.4.4" }, "peerDependencies": { "@reduxjs/toolkit": "1.6.1", @@ -118274,6 +118262,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "packages/common/node_modules/typescript-transform-paths": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/typescript-transform-paths/-/typescript-transform-paths-3.4.4.tgz", + "integrity": "sha512-b+6JTpJbO9CxVyt9+fIKXpLNUEyzrKXdflsVo/nXbQqelCYkpSsRdI+ikg3SelyE04rUeKlb+Kdt1D8Doa9JoQ==", + "dev": true, + "dependencies": { + "minimatch": "^3.0.4" + }, + "peerDependencies": { + "typescript": ">=3.6.5" + } + }, "packages/compose": { "name": "@audius/compose", "version": "1.0.6", @@ -133477,8 +133477,9 @@ "storybook-addon-smart-knobs": "6.0.2", "storybook-dark-mode": "3.0.1", "tsconfig-paths-webpack-plugin": "3.5.2", - "typescript": "4.9.4", + "ttypescript": "1.5.15", "typescript-plugin-css-modules": "3.4.0", + "typescript-transform-paths": "3.4.4", "webpack": "4.46.0" }, "peerDependencies": { @@ -134713,6 +134714,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "packages/harmony/node_modules/typescript-transform-paths": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/typescript-transform-paths/-/typescript-transform-paths-3.4.4.tgz", + "integrity": "sha512-b+6JTpJbO9CxVyt9+fIKXpLNUEyzrKXdflsVo/nXbQqelCYkpSsRdI+ikg3SelyE04rUeKlb+Kdt1D8Doa9JoQ==", + "dev": true, + "dependencies": { + "minimatch": "^3.0.4" + }, + "peerDependencies": { + "typescript": ">=3.6.5" + } + }, "packages/harmony/node_modules/unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", diff --git a/packages/common/package.json b/packages/common/package.json index de651010ef2..5e7596b4293 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -76,8 +76,8 @@ "rollup": "2.76.0", "rollup-plugin-dts": "4.2.2", "rollup-plugin-typescript2": "0.32.1", - "ttypescript": "^1.5.15", - "typescript-transform-paths": "^3.4.4" + "ttypescript": "1.5.15", + "typescript-transform-paths": "3.4.4" }, "peerDependencies": { "@reduxjs/toolkit": "1.6.1", diff --git a/packages/common/rollup.config.js b/packages/common/rollup.config.js index a60194ed746..94e217291ed 100644 --- a/packages/common/rollup.config.js +++ b/packages/common/rollup.config.js @@ -1,5 +1,6 @@ import image from '@rollup/plugin-image' import rollupTypescript from 'rollup-plugin-typescript2' +import ttypescript from 'ttypescript' import pkg from './package.json' @@ -22,18 +23,7 @@ export default [ ], plugins: [ rollupTypescript({ - typescript: require('ttypescript'), - tsconfigDefaults: { - compilerOptions: { - plugins: [ - { transform: 'typescript-transform-paths' }, - { - transform: 'typescript-transform-paths', - afterDeclarations: true - } - ] - } - } + typescript: ttypescript }), image() ], diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index b15eb8a7569..3491d3e0df1 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -14,6 +14,10 @@ "utils/*": ["src/utils/*"], "utils": ["src/utils"] }, + "plugins": [ + { "transform": "typescript-transform-paths" }, + { "transform": "typescript-transform-paths", "afterDeclarations": true } + ], "module": "esnext", "target": "es6", "moduleResolution": "node", diff --git a/packages/harmony/package.json b/packages/harmony/package.json index f8a3a35423f..931b2cbc61f 100644 --- a/packages/harmony/package.json +++ b/packages/harmony/package.json @@ -83,8 +83,9 @@ "storybook-addon-smart-knobs": "6.0.2", "storybook-dark-mode": "3.0.1", "tsconfig-paths-webpack-plugin": "3.5.2", - "typescript": "4.9.4", + "ttypescript": "1.5.15", "typescript-plugin-css-modules": "3.4.0", + "typescript-transform-paths": "3.4.4", "webpack": "4.46.0" }, "peerDependencies": { diff --git a/packages/harmony/rollup.config.mjs b/packages/harmony/rollup.config.mjs index 92ba8eb468e..48ed6db9423 100644 --- a/packages/harmony/rollup.config.mjs +++ b/packages/harmony/rollup.config.mjs @@ -2,7 +2,7 @@ import svgr from '@svgr/rollup' import json from 'rollup-plugin-json' import postcss from 'rollup-plugin-postcss' import rollupTypescript from 'rollup-plugin-typescript2' -import typescript from 'typescript' +import ttypescript from 'ttypescript' import pkg from './package.json' assert { type: 'json' } @@ -34,8 +34,8 @@ export default { }), svgr(), rollupTypescript({ - clean: true, - typescript + typescript: ttypescript, + clean: true }) ], external diff --git a/packages/harmony/src/components/avatar/Avatar.stories.tsx b/packages/harmony/src/components/avatar/Avatar.stories.tsx index 0133d3b0e3b..b962a999ee6 100644 --- a/packages/harmony/src/components/avatar/Avatar.stories.tsx +++ b/packages/harmony/src/components/avatar/Avatar.stories.tsx @@ -3,8 +3,8 @@ import type { Meta, StoryObj } from '@storybook/react' import { Box } from 'components/layout/Box' import { Flex } from 'components/layout/Flex' import { Paper } from 'components/layout/Paper' -// TODO: Get final image assets from Sammie import shadowBackground from 'storybook/assets/shadowBackground.jpeg' +// TODO: Get final image assets from Sammie import { Avatar } from './Avatar' diff --git a/packages/harmony/src/components/icon/Icon.tsx b/packages/harmony/src/components/icon/Icon.tsx index 982a81c0ec1..980f59174a5 100644 --- a/packages/harmony/src/components/icon/Icon.tsx +++ b/packages/harmony/src/components/icon/Icon.tsx @@ -15,12 +15,14 @@ export const iconSizes = { type IconSize = keyof typeof iconSizes -type IconProps = { +type BaseIconProps = SVGProps + +type IconProps = BaseIconProps & { color?: IconColors size?: IconSize -} & SVGProps +} -export type IconComponent = ComponentType +export type IconComponent = ComponentType /** * Renders a harmony Icon component diff --git a/packages/harmony/tsconfig.json b/packages/harmony/tsconfig.json index a0e7ff474a9..36e19ed6a4f 100644 --- a/packages/harmony/tsconfig.json +++ b/packages/harmony/tsconfig.json @@ -5,7 +5,6 @@ "module": "esnext", "sourceMap": true, "checkJs": false, - "plugins": [{ "name": "typescript-plugin-css-modules" }], "allowJs": false, "jsx": "react-jsx", "jsxImportSource": "@emotion/react", @@ -14,7 +13,24 @@ "exactOptionalPropertyTypes": false, "declaration": true, "declarationMap": true, - "baseUrl": "./src", + "baseUrl": "./", + "paths": { + "foundations": ["src/foundations/index.ts"], + "foundations/*": ["src/foundations/*"], + "components": ["src/components/index.ts"], + "components/*": ["src/components/*"], + "icons": ["src/icons/index.ts"], + "icons/*": ["src/icons/*"], + "assets": ["src/assets/index.ts"], + "assets/*": ["src/assets/*"], + "storybook": ["src/storybook/index.ts"], + "storybook/*": ["src/storybook/*"] + }, + "plugins": [ + { "name": "typescript-plugin-css-modules" }, + { "transform": "typescript-transform-paths" }, + { "transform": "typescript-transform-paths", "afterDeclarations": true } + ], "outDir": "build", "declarationDir": "./", "noPropertyAccessFromIndexSignature": false,