Skip to content

Commit fcfeb3a

Browse files
refactor repo
Signed-off-by: Henry Gressmann <[email protected]>
1 parent 1a2ed20 commit fcfeb3a

29 files changed

+920
-756
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node_modules
2+
scripts/dist
23
packages/*/dist
3-
packages/*/types
44
.turbo

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66

77
## Projects
88

9-
### Stable
9+
<br/>
1010

11-
#### [![](https://img.shields.io/npm/v/rollup-plugin-minify-template-literals?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/rollup-plugin-minify-template-literals) &nbsp; [**`rollup-plugin-minify-template-literals`**](./packages/rollup-plugin-minify-template-literals) - A rollup & vite plugin to minify html/css template literals
11+
| Stable | |
12+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13+
| [![](https://img.shields.io/npm/v/rollup-plugin-minify-template-literals?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/rollup-plugin-minify-template-literals) | [**`rollup-plugin-minify-template-literals`**](./packages/rollup-plugin-minify-template-literals) <br/> A rollup & vite plugin to minify html/css template literals |
14+
| [![](https://img.shields.io/npm/v/minify-literals?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/minify-literals) | [**`minify-literals`**](./packages/minify-literals) <br/> A library to minify html/css template literals |
1215

13-
#### [![](https://img.shields.io/npm/v/minify-literals?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/minify-literals) &nbsp; [**`minify-literals`**](./packages/minify-literals) - A library to minify html/css template literals
14-
15-
### Unstable
16-
17-
#### [![](https://img.shields.io/npm/v/lit-q?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/lit-q) &nbsp; [**`lit-q`**](./packages/lit-q) - A simple async query/mutation library for Lit/LitElement inspired by react-query
18-
19-
### Development Preview
20-
21-
#### [![](https://img.shields.io/npm/v/ucmd?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/ucmd) &nbsp; [**`ucmd`**](./packages/ucmd) - minimal and strictly typed argument parsing for node.js 19+
16+
| Unstable | |
17+
| --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
18+
| [![](https://img.shields.io/npm/v/ucmd?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/ucmd) | [**`ucmd`**](./packages/ucmd) <br/> minimal and strictly typed argument parsing for node.js 19+ |
19+
| [![](https://img.shields.io/npm/v/lit-q?style=flat&colorA=000000&colorB=efefef)](https://www.npmjs.com/package/lit-q) | [**`lit-q`**](./packages/lit-q) <br/> A simple async query/mutation library for Lit/LitElement inspired by react-query |

configs/tsconfig.base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"importsNotUsedAsValues": "error",
2323
"outDir": "dist"
2424
},
25+
"exclude": ["dist/*"],
2526
"ts-node": {
2627
"transpileOnly": true
2728
}

packages/lit-q/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
# Lit-q [![API Docs](https://img.shields.io/badge/API%20Docs-blue.svg)](https://paka.dev/npm/lit-q)
22

3+
> A simple query and mutation library for lit-element
4+
5+
## Installation
6+
7+
```bash
8+
$ npm i lit-q
9+
# or
10+
$ yarn add lit-q
11+
# or
12+
$ pnpm add lit-q
13+
```
14+
315
## Usage
416

17+
<table>
18+
<tr>
19+
<td> TypeScript </td>
20+
</tr>
21+
<tr>
22+
<td>
23+
524
```ts
625
import { html, LitElement } from "lit";
726
import { customElement } from "lit/decorators.js";
@@ -36,3 +55,7 @@ export class MyElement extends LitElement {
3655
`;
3756
}
3857
```
58+
59+
</td>
60+
</tr>
61+
</table>

packages/lit-q/package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,28 @@
1818
"type": "module",
1919
"exports": {
2020
".": {
21-
"require": "./dist/lit-q.cjs",
22-
"import": "./dist/lit-q.js"
21+
"import": "./dist/index.js",
22+
"require": "./dist/index.cjs",
23+
"types": "./dist/index.d.ts"
2324
}
2425
},
25-
"main": "dist/lit-q.cjs",
26-
"module": "dist/lit-q.js",
27-
"types": "types/index.d.ts",
26+
"main": "dist/index.cjs",
27+
"module": "dist/index.js",
28+
"types": "dist/index.d.ts",
2829
"files": [
29-
"dist",
30-
"types"
30+
"dist"
3131
],
3232
"scripts": {
33-
"build": "scripts build --name lit-q ./lib/index.ts -e lit",
34-
"test": "vitest run"
33+
"build": "scripts build --name lit-q",
34+
"test": "scripts test run"
3535
},
3636
"devDependencies": {
37+
"@types/node": "^18.11.18",
3738
"jsdom": "^21.1.0",
3839
"lit": "^2.6.1",
3940
"scripts": "workspace:0.0.1",
4041
"vite": "^4.0.4",
41-
"vitest": "^0.28.1"
42+
"vitest": "^0.28.2"
4243
},
4344
"peerDependencies": {
4445
"lit": "^2.5.0"

packages/lit-q/tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"compilerOptions": {
3-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
4-
"experimentalDecorators": true,
5-
"useDefineForClassFields": false,
6-
"importsNotUsedAsValues": "preserve"
3+
"lib": ["ES2022", "dom"]
74
},
5+
"exclude": ["dist/", "node_modules/"],
86
"extends": "../../configs/tsconfig.base.json"
97
}

packages/minify-literals/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,25 @@
44
55
Uses [html-minifier-terser](https://www.npmjs.com/package/html-minifier-terser) to minify HTML and [clean-css](https://www.npmjs.com/package/clean-css) to minify CSS.
66

7+
## Installation
8+
9+
```bash
10+
$ npm i minify-literals
11+
# or
12+
$ yarn add minify-literals
13+
# or
14+
$ pnpm add minify-literals
15+
```
16+
717
## Usage
818

19+
<table>
20+
<tr>
21+
<td> TypeScript </td>
22+
</tr>
23+
<tr>
24+
<td>
25+
926
```ts
1027
import { minifyHTMLLiterals } from "minify-literals";
1128

@@ -36,6 +53,10 @@ console.log(map);
3653
// },
3754
```
3855

56+
</td>
57+
</tr>
58+
</table>
59+
3960
## Options
4061

4162
```ts

packages/minify-literals/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
"type": "module",
1818
"exports": {
1919
".": {
20-
"require": "./dist/minify-literals.cjs",
21-
"import": "./dist/minify-literals.js"
20+
"import": "./dist/index.js",
21+
"require": "./dist/index.cjs",
22+
"types": "./dist/index.d.ts"
2223
}
2324
},
24-
"main": "dist/minify-literals.cjs",
25-
"module": "dist/minify-literals.js",
26-
"types": "types/index.d.ts",
25+
"main": "dist/index.cjs",
26+
"module": "dist/index.js",
27+
"types": "dist/index.d.ts",
2728
"files": [
28-
"dist",
29-
"types"
29+
"dist"
3030
],
3131
"scripts": {
32-
"build": "scripts build --name minify-literals --external clean-css --external html-minifier-terser --external magic-string --external parse-literals ./lib/index.ts",
32+
"build": "scripts build --name minify-literals",
3333
"test": "scripts test run"
3434
},
3535
"dependencies": {
@@ -44,6 +44,6 @@
4444
"@types/sinon": "^10.0.13",
4545
"scripts": "workspace:*",
4646
"sinon": "^15.0.1",
47-
"vitest": "^0.28.1"
47+
"vitest": "^0.28.2"
4848
}
4949
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"exclude": ["dist/", "node_modules/"],
23
"extends": "../../configs/tsconfig.base.json"
34
}

packages/rollup-plugin-minify-template-literals/README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@
22

33
> Minify HTML & CSS markup inside JavaScript/TypeScript template literal strings - for vite and rollup.
44
5+
## Installation
6+
7+
```bash
8+
$ npm i rollup-plugin-minify-template-literals
9+
# or
10+
$ yarn add rollup-plugin-minify-template-literals
11+
# or
12+
$ pnpm add rollup-plugin-minify-template-literals
13+
```
14+
515
## Usage
616

717
### Vite
818

19+
<table>
20+
<tr>
21+
<td> vite.config.ts </td>
22+
</tr>
23+
<tr>
24+
<td>
25+
926
```ts
10-
// vite.config.ts
1127
import { defineConfig } from "vite";
1228
import { minifyTemplateLiterals } from "rollup-plugin-minify-template-literals";
1329

@@ -16,17 +32,31 @@ export default defineConfig({
1632
});
1733
```
1834

35+
</td>
36+
</tr>
37+
</table>
38+
1939
### Rollup
2040

41+
<table>
42+
<tr>
43+
<td> rollup.config.js </td>
44+
</tr>
45+
<tr>
46+
<td>
47+
2148
```ts
22-
// rollup.config.js
2349
import { minifyTemplateLiterals } from "rollup-plugin-minify-template-literals";
2450

2551
export default {
2652
plugins: [minifyTemplateLiterals()],
2753
};
2854
```
2955

56+
</td>
57+
</tr>
58+
</table>
59+
3060
## ES5 Support
3161

3262
Be sure to minify template literals before transpiling to ES5. Otherwise, the API will not be able to find any template literal (`${}`) strings.

0 commit comments

Comments
 (0)