From 695283cc1cc84ecc18fd2fe4007b29143ee5412d Mon Sep 17 00:00:00 2001 From: TitanKuzmich Date: Thu, 19 Dec 2024 14:52:30 +0300 Subject: [PATCH] feat(sdds-serv): fix typings path --- packages/sdds-serv/emotion/package.json | 2 +- packages/sdds-serv/package.json | 7 ++++--- .../sdds-serv/scripts/copy-linaria-components.sh | 2 +- packages/sdds-serv/styled-components/package.json | 2 +- packages/sdds-serv/tsconfig.json | 12 +++++++++++- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/sdds-serv/emotion/package.json b/packages/sdds-serv/emotion/package.json index 0e8061e06b..df850ecf21 100644 --- a/packages/sdds-serv/emotion/package.json +++ b/packages/sdds-serv/emotion/package.json @@ -1,5 +1,5 @@ { "module": "es/index.js", "main": "cjs/index.js", - "types": "../types/index.d.ts" + "types": "../index.d.ts" } diff --git a/packages/sdds-serv/package.json b/packages/sdds-serv/package.json index 77929aa548..551cdb30ed 100644 --- a/packages/sdds-serv/package.json +++ b/packages/sdds-serv/package.json @@ -109,9 +109,10 @@ "build:styled-components:esm": "BABEL_ENV=esm SC_NAMESPACE=sdds-srvc babel ./src --out-dir ./styled-components/es --extensions .ts,.tsx", "build:css": "BABEL_ENV=esm SC_NAMESPACE=sdds-srvc rollup -c", "postbuild:css": "rm -rf src-css", - "postbuild:styled-components": "npm run generate:typings", - "postbuild:emotion": "rm -rf src-emotion && npm run generate:typings", - "generate:typings": "tsc --outDir . --emitDeclarationOnly", + "postbuild:styled-components": "rm -rf src-sc", + "postbuild:emotion": "rm -rf src-emotion", + "remove:typings": "rm -rf components/**/*.d.ts && rm index.d.ts && rm mixins/index.d.ts && rm tokens/index.d.ts", + "generate:typings": "npm run remove:typings && tsc --outDir . --emitDeclarationOnly", "storybook": "npm run storybook:sc", "prestorybook:emotion": "npm run prebuild:emotion", "storybook:emotion": "USE_EMOTION_COMPONENTS=true storybook dev -p ${PORT:-7002} -c .storybook", diff --git a/packages/sdds-serv/scripts/copy-linaria-components.sh b/packages/sdds-serv/scripts/copy-linaria-components.sh index cae4db3957..6bd8bf87a6 100755 --- a/packages/sdds-serv/scripts/copy-linaria-components.sh +++ b/packages/sdds-serv/scripts/copy-linaria-components.sh @@ -9,7 +9,7 @@ touch src-css/index.d.ts for component in $components; do cp -R src/components/$component src-css/components/; grep -E "\<$component\>" src/index.ts >> src-css/index.ts - echo "export * from '../components/$component';" >> css/index.d.ts; + echo "export * from '../components/$component';" >> src-css/index.d.ts; done; diff --git a/packages/sdds-serv/styled-components/package.json b/packages/sdds-serv/styled-components/package.json index 0e8061e06b..df850ecf21 100644 --- a/packages/sdds-serv/styled-components/package.json +++ b/packages/sdds-serv/styled-components/package.json @@ -1,5 +1,5 @@ { "module": "es/index.js", "main": "cjs/index.js", - "types": "../types/index.d.ts" + "types": "../index.d.ts" } diff --git a/packages/sdds-serv/tsconfig.json b/packages/sdds-serv/tsconfig.json index b81f4d6b8d..fe6524ef3f 100644 --- a/packages/sdds-serv/tsconfig.json +++ b/packages/sdds-serv/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "allowJs": false, "target": "ES5", "module": "CommonJS", "lib": ["dom", "dom.iterable", "esnext"], @@ -40,5 +41,14 @@ } }, "include": ["./src"], - "exclude": ["./src/helpers", "./src/**/*.stories.tsx", "./src/**/*.component-test.tsx", "./src/**/*.perftest.tsx"] + "exclude": [ + "./src/helpers", + "./src/**/*.stories.tsx", + "./src/**/*.component-test.tsx", + "./src/**/*.perftest.tsx", + "./components", + "./es", + "./styled-components", + "./emotion" + ] }