Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Dec 12, 2023
1 parent c7c4b8e commit 7331892
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
env:
CI: true

check-types:
test:
runs-on: ubuntu-latest
needs: [install]

Expand All @@ -59,12 +59,13 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Check Types
run: yarn attw -P
- name: Test
run: |
yarn test || yarn test || yarn test || exit 1
env:
CI: true

test:
build:
runs-on: ubuntu-latest
needs: [install]

Expand All @@ -75,15 +76,14 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Test
run: |
yarn test || yarn test || yarn test || exit 1
- name: Build
run: yarn build
env:
CI: true

build:
check-types:
runs-on: ubuntu-latest
needs: [install]
needs: [build]

steps:
- name: Begin CI...
Expand All @@ -92,7 +92,7 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Build
run: yarn build
- name: Check Types
run: yarn lint-types
env:
CI: true
4 changes: 3 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
- uses: actions/checkout@v3

- name: Check Types
run: yarn attw -P
run: |
yarn build
yarn lint-types
env:
CI: true

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"test": "./scripts/test.sh",
"lint": "./scripts/lint.sh",
"lint-check": "CI=true ./scripts/lint.sh",
"lint-types": "CI=true yarn workspaces run attw -P",
"release-channel": "node ./scripts/release-channel.js",
"release-notes": "node ./scripts/release-notes.js",
"package-path": "node ./scripts/package-path.js"
Expand Down
5 changes: 4 additions & 1 deletion packages/@headlessui-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"dist"
],
"exports": {
"types": "./dist/index.d.ts",
"types": {
"import": "./dist/index.d.ts",
"require": "./dist/index.d.cts"
},
"import": "./dist/headlessui.esm.js",
"require": "./dist/index.cjs"
},
Expand Down
7 changes: 4 additions & 3 deletions packages/@headlessui-tailwindcss/scripts/fix-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ let path = require('path')
* CommonJs environment.
**/

let types = path.resolve(__dirname, '..', 'dist', 'index.d.ts')
let esmTypes = path.resolve(__dirname, '..', 'dist', 'index.d.ts')
let cjsTypes = path.resolve(__dirname, '..', 'dist', 'index.d.cts')

async function run() {
let contents = await fs.readFile(types, 'utf8')
let contents = await fs.readFile(esmTypes, 'utf8')
contents = contents.replace('export default', 'export =')
await fs.writeFile(types, contents, 'utf8')
await fs.writeFile(cjsTypes, contents, 'utf8')
}

run()

0 comments on commit 7331892

Please sign in to comment.