Skip to content

Commit

Permalink
initial intellisense support
Browse files Browse the repository at this point in the history
  • Loading branch information
sastan committed Oct 20, 2022
1 parent e6acbea commit 2ac8e69
Show file tree
Hide file tree
Showing 48 changed files with 36,232 additions and 876 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-deers-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@twind/preset-tailwind': patch
---

support arbitrary variants in `group:` and `peer:`
7 changes: 7 additions & 0 deletions .changeset/seven-lemons-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@twind/intellisense': patch
'@twind/preset-tailwind': patch
'twind': patch
---

initial intellisense support
35 changes: 17 additions & 18 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,8 @@

## v1

- `ensure`: like setup but keeps track of presets and merges them

```js
// package a
import { ensure } from 'twind'
ensure(presetTailwind())

// package b
import { ensure } from 'twind'
ensure(presetTailwind(), presetTailwindForms())
```

- @twind/devtools:
- enumerate all classes and inject as empty for dev tools
- @twind/with-remix: https://github.com/remix-run/remix/issues/1804
- @twind/preset-\* from tailwind core
- @twind/styled (previously @twind/react)
Expand All @@ -66,9 +56,9 @@
- framework integrations
- solid, wmr, nuxt, vue, stenciljs, angular, ...
- https://vercel.com/templates
- development condition — let distilt create development bundles
- warnings: console.warn(`[twind] unknown rule "${value}"`)
- completion infos
- development condition
[x] let distilt create development bundles
- [x] warnings: console.warn(`[twind] unknown rule "${value}"`)
- additional checks
- performance marks for devtools
- perf: large website with many different rules
Expand All @@ -90,16 +80,25 @@

- zero runtime
- safelist, extractor, examples
- @twind/completions — provide autocompletion for classNames
- https://www.npmjs.com/package/genex
- https://www.npmjs.com/regexp-enumerator
- a package to make it easy to create lightweight versions of presets (like https://lodash.com/custom-builds)
- postcss plugin like tailwindcss for SSR

```css
@twind;
```

- `ensure`: like setup but keeps track of presets and merges them

```js
// package a
import { ensure } from 'twind'
ensure(presetTailwind())

// package b
import { ensure } from 'twind'
ensure(presetTailwind(), presetTailwindForms())
```

## v2

- fully typed theme
32 changes: 25 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,33 +43,33 @@
"name": "twind",
"path": "packages/twind/dist/twind.esnext.js",
"brotli": true,
"limit": "7.7kb"
"limit": "8kb"
},
{
"name": "twind (setup)",
"path": "packages/twind/dist/twind.esnext.js",
"import": "{ setup }",
"brotli": true,
"limit": "5.25kb"
"limit": "5.45kb"
},
{
"name": "twind (twind + cssom)",
"path": "packages/twind/dist/twind.esnext.js",
"import": "{ twind, cssom }",
"brotli": true,
"limit": "4.6kb"
"limit": "4.8kb"
},
{
"name": "@twind/cdn",
"path": "packages/cdn/dist/cdn.esnext.js",
"brotli": true,
"limit": "15.25kb"
"limit": "15.5kb"
},
{
"name": "@twind/preset-tailwind",
"path": "packages/preset-tailwind/dist/preset-tailwind.esnext.js",
"brotli": true,
"limit": "9.2kb",
"limit": "9.3kb",
"ignore": [
"twind"
]
Expand Down Expand Up @@ -97,6 +97,7 @@
"@changesets/get-github-info": "^0.5.1",
"@size-limit/esbuild": "^8.1.0",
"@size-limit/file": "^8.1.0",
"@types/node": "^14.5.0",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/parser": "^5.39.0",
"@vitest/coverage-c8": "^0.23.4",
Expand Down Expand Up @@ -124,15 +125,32 @@
},
"pnpm": {
"patchedDependencies": {
"@size-limit/esbuild@8.1.0": "patches/@size-limit__esbuild@8.1.0.patch"
"@size-limit/esbuild@8.1.0": "patches/@size-limit__esbuild@8.1.0.patch",
"monaco-editor@0.34.0": "patches/monaco-editor@0.34.0.patch",
"csstree-validator@3.0.0": "patches/csstree-validator@3.0.0.patch"
}
},
"prettier": {
"printWidth": 100,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true
"overrides": [
{
"files": "*.test.js",
"options": {
"semi": true
}
},
{
"files": [
"sites/twind.run/src/lib/templates/**"
],
"options": {
"singleQuote": false
}
}
]
},
"eslintConfig": {
"root": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/cdn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"name": "@twind/cdn",
"path": "dist/cdn.esnext.js",
"brotli": true,
"limit": "15.25kb"
"limit": "15.5kb"
}
],
"dependencies": {
Expand Down
11 changes: 11 additions & 0 deletions packages/intellisense/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @twind/intellisense [![MIT License](https://flat.badgen.net/github/license/tw-in-js/twind)](https://github.com/tw-in-js/twind/blob/next/LICENSE) [![Latest Release](https://flat.badgen.net/npm/v/@twind/intellisense/next?icon=npm&label&cache=10800&color=blue)](https://www.npmjs.com/package/@twind/intellisense/v/next) [![Github](https://flat.badgen.net/badge/icon/tw-in-js%2Ftwind%23intellisense?icon=github&label)](https://github.com/tw-in-js/twind/tree/next/packages/intellisense)

---

## READ THIS FIRST!

**Twind v1 is still in beta. Expect bugs!**

---

Intellisense utils for Twind
58 changes: 58 additions & 0 deletions packages/intellisense/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@twind/intellisense",
"version": "1.0.0-next.39",
"description": "Intellisense utils for Twind",
"keywords": [
"twind",
"tailwind",
"tailwindcss",
"tw-in-js",
"tailwind-in-js",
"intellisense",
"autocomplete"
],
"type": "module",
"// The 'module', 'unpkg' and 'types' fields are added by distilt": "",
"main": "src/index.ts",
"// Each entry is expanded into several bundles (types, esnext, module, script, node, and default)": "",
"exports": {
".": "./src/index.ts",
"./package.json": "./package.json"
},
"// These are relative from within the dist/ folder": "",
"sideEffects": false,
"dependencies": {
"@ctrl/tinycolor": "^3.4.1",
"css-tree": "^2.2.1",
"cssbeautify": "^0.3.1",
"csstree-validator": "^3.0.0",
"genex": "^1.1.0",
"match-sorter": "^6.3.1",
"quick-lru": "^6.1.1"
},
"devDependencies": {
"@twind/preset-autoprefix": "1.0.0-next.39",
"@twind/preset-tailwind": "1.0.0-next.39",
"@types/css-tree": "^2.0.0",
"@types/cssbeautify": "^0.3.2",
"twind": "1.0.0-next.39",
"typescript": "^4.8.4"
},
"peerDependencies": {
"twind": "1.0.0-next.39",
"typescript": "^4.8.4"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"scripts": {
"build": "distilt"
},
"publishConfig": {
"tag": "next",
"access": "public",
"directory": "dist"
}
}
Loading

0 comments on commit 2ac8e69

Please sign in to comment.