diff --git a/packages/plasma-new-hope/package.json b/packages/plasma-new-hope/package.json index b56cd25794..46748a851f 100644 --- a/packages/plasma-new-hope/package.json +++ b/packages/plasma-new-hope/package.json @@ -2,9 +2,21 @@ "name": "@salutejs/plasma-new-hope", "version": "0.228.0-dev.0", "description": "Salute Design System blueprint", - "main": "cjs/index.js", - "module": "es/index.js", - "types": "types/index.d.ts", + "main": "./cjs/index.js", + "module": "./es/index.js", + "types": "./types/index.d.ts", + "exports": { + ".": { + "require": "./cjs/index.js", + "import": "./es/index.js", + "types": "./types/index.d.ts" + }, + "./styled-components": { + "require": "./styled-components/cjs/index.js", + "import": "./styled-components/es/index.js", + "types": "./types/index.d.ts" + } + }, "files": [ "cjs", "es", diff --git a/packages/sdds-serv/package.json b/packages/sdds-serv/package.json index cdc72830fa..361815cd8a 100644 --- a/packages/sdds-serv/package.json +++ b/packages/sdds-serv/package.json @@ -22,9 +22,26 @@ "api-extractor.json", "CHANGELOG.md" ], - "main": "index.js", - "module": "es/index.js", - "types": "index.d.ts", + "main": "./index.js", + "module": "./es/index.js", + "types": "./types/index.d.ts", + "exports": { + ".": { + "require": "./components/index.js", + "import": "./es/index.js", + "types": "./index.d.ts" + }, + "./styled-components": { + "require": "./styled-components/cjs/index.js", + "import": "./styled-components/es/index.js", + "types": "./index.d.ts" + }, + "./emotion": { + "require": "./emotion/cjs/index.js", + "import": "./emotion/es/index.js", + "types": "./index.d.ts" + } + }, "repository": { "type": "git", "url": "ssh://git@github.com:salute-developers/plasma.git", 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/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" + ] }