Skip to content

Commit

Permalink
Bundle .d.ts files when building project (#854)
Browse files Browse the repository at this point in the history
* ensure VS Code uses the same version of TypeScript as the project

* bundle .d.ts files as part of build process

* add a changeset

* expose `ResponsiveArray`

* replace `tsup` implementation with `rollup-plugin-dts`

* rename some vars

* remove the exception for `@vanilla-extract/private`

* Revert "remove the exception for `@vanilla-extract/private`"

This reverts commit e009da9.

* update changesets

* defer the overwrite until all bundles are ready

Co-authored-by: mattcompiles <mattjones701@gmail.com>
  • Loading branch information
mrm007 and mattcompiles authored Oct 18, 2022
1 parent 31c5ff5 commit 98f8b03
Show file tree
Hide file tree
Showing 8 changed files with 354 additions and 59 deletions.
5 changes: 5 additions & 0 deletions .changeset/old-planets-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/sprinkles': patch
---

Expose `ResponsiveArray` so `.d.ts` bundling works correctly
8 changes: 8 additions & 0 deletions .changeset/silent-files-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@vanilla-extract/css': patch
'@vanilla-extract/css-utils': patch
'@vanilla-extract/dynamic': patch
'@vanilla-extract/sprinkles': patch
---

Bundle TypeScript declaration files (`.d.ts`) when building packages
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"license": "MIT",
"scripts": {
"dev": "preconstruct dev",
"build": "preconstruct build",
"build": "preconstruct build && pnpm build:dts",
"build:dts": "ts-node ./scripts/build-dts",
"watch": "preconstruct watch",
"start-fixture": "ts-node ./test-helpers/src/startFixtureCLI",
"start": "pnpm start-fixture themed",
"start-site": "manypkg run site start",
"build-site": "manypkg run site build",
"start-site": "pnpm --filter=site start",
"build-site": "pnpm --filter=site build",
"test:jest": "jest",
"test:playwright": "playwright test",
"format": "prettier --write .",
Expand Down Expand Up @@ -48,6 +49,10 @@
"fast-glob": "^3.2.7",
"jest": "^27.3.1",
"prettier": "^2.3.2",
"resolve.exports": "^1.1.0",
"rollup": "^2.7.0",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-node-externals": "^5.0.0",
"ts-node": "^10.0.0",
"typescript": "^4.5.0"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/sprinkles/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { SprinklesProperties, ResponsiveArrayConfig } from './types';
export { createNormalizeValueFn, createMapValueFn } from './createUtils';
export type { ConditionalValue, RequiredConditionalValue } from './createUtils';

export type { ResponsiveArray } from './types';

type ConditionKey = '@media' | '@supports' | '@container' | 'selector';
type Condition = Partial<Record<ConditionKey, string>>;

Expand Down
Loading

0 comments on commit 98f8b03

Please sign in to comment.