From fb8e70bad8b44fd2fc46fdbf43baa33ae0f3c512 Mon Sep 17 00:00:00 2001 From: Michael Dowse Date: Thu, 7 Mar 2024 19:54:26 +0100 Subject: [PATCH] chore: Refactor to publish to lib folder --- .eslintrc | 2 +- .github/workflows/release.yml | 2 ++ .gitignore | 2 +- package.json | 12 ++++-------- postcss.js | 2 +- tsconfig.json | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.eslintrc b/.eslintrc index dfea96d..72e0df1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -34,5 +34,5 @@ } } ], - "ignorePatterns": ["dist"] + "ignorePatterns": ["lib"] } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2fb7d8..d04c759 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,3 +16,5 @@ jobs: release: uses: cloudscape-design/actions/.github/workflows/release.yml@main secrets: inherit + with: + publish-packages: lib diff --git a/.gitignore b/.gitignore index 31da342..2efed1e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ build -dist +lib node_modules /index.css coverage diff --git a/package.json b/package.json index 3fc149d..02ceec1 100644 --- a/package.json +++ b/package.json @@ -8,21 +8,17 @@ "homepage": "https://cloudscape.design", "license": "Apache-2.0", "type": "module", - "main": "./dist/index.js", + "main": "./index.js", "exports": { - ".": "./dist/index.js", + ".": "./index.js", "./dark-mode-utils.css": "./dark-mode-utils.css", "./index.css": "./index.css" }, - "files": [ - "dist", - "index.css", - "dark-mode-utils.css", - "THIRD_PARTY_LICENSES.txt" - ], "scripts": { "prepare": "husky", + "prebuild": "rm -rf lib && mkdir lib", "build": "node postcss.js && tsc", + "postbuild": "cp dark-mode-utils.css package.json THIRD-PARTY-LICENSES.txt LICENSE README.md lib", "lint": "eslint .", "test": "jest --coverage" }, diff --git a/postcss.js b/postcss.js index 595ed56..afa3743 100644 --- a/postcss.js +++ b/postcss.js @@ -6,7 +6,7 @@ import postcssUrl from 'postcss-url'; import postcssImport from 'postcss-import'; const input = 'src/index.css'; -const output = 'index.css'; +const output = 'lib/index.css'; async function convert() { const css = fs.readFileSync(input); diff --git a/tsconfig.json b/tsconfig.json index 9077864..aa1cca0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "moduleResolution": "Node", "strict": true, "declaration": true, - "outDir": "dist" + "outDir": "lib" }, "include": ["src/**/*.ts"], "exclude": ["**/__tests__/**"]