Skip to content

Commit

Permalink
Externalize htm and quantum packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Nov 20, 2023
1 parent c9d3e40 commit 93a980a
Show file tree
Hide file tree
Showing 6 changed files with 1,402 additions and 1,379 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-moons-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chialab/dna': minor
---

Externalize htm and quantum packages.
8 changes: 0 additions & 8 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ pnpm add @chialab/dna

:::

### or use a CDN

You can use DNA via CDN thanks to [unpkg](https://unpkg.com/):

```ts
import { Component, define } from 'https://unpkg.com/@chialab/dna?module';
```

## Configure JSX

### Typescript
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"author": "Chialab <[email protected]> (https://www.chialab.it)",
"scripts": {
"build": "rimraf 'dist' 'types' && yarn types && yarn build:esm && yarn build:cjs",
"build:esm": "esbuild src/index.ts --outfile=dist/dna.js --format=esm --bundle --sourcemap",
"build:cjs": "esbuild src/index.ts --outfile=dist/dna.cjs --format=cjs --bundle --sourcemap",
"build:esm": "esbuild src/index.ts --outfile=dist/dna.js --format=esm --bundle --packages=external --sourcemap",
"build:cjs": "esbuild src/index.ts --outfile=dist/dna.cjs --format=cjs --bundle --packages=external --sourcemap",
"types": "tsc",
"test": "yarn test:typings && yarn test:browser && yarn test:node",
"test:typings": "tsc -p test-typings --noEmit",
Expand All @@ -50,20 +50,20 @@
"prepack": "yarn build"
},
"dependencies": {
"@chialab/quantum": "^1.0.0-alpha.5"
"@chialab/quantum": "^1.0.0-alpha.6",
"htm": "^3.0.3"
},
"devDependencies": {
"@babel/runtime": "^7.14.0",
"@changesets/cli": "^2.22.0",
"@chialab/eslint-config": "^4.0.0",
"@chialab/prettier-config": "^1.2.2",
"@vitest/browser": "^0.34.6",
"@vitest/coverage-istanbul": "^0.34.6",
"@vitest/coverage-v8": "^0.34.6",
"@vitest/browser": "^1.0.0-beta.5",
"@vitest/coverage-istanbul": "^1.0.0-beta.5",
"@vitest/coverage-v8": "^1.0.0-beta.5",
"esbuild": "^0.19.4",
"eslint": "^8.0.0",
"eslint-plugin-jsdoc": "^39.3.2",
"htm": "^3.0.3",
"ip": "^1.1.8",
"playwright": "^1.38.1",
"prettier": "^3.0.3",
Expand All @@ -73,7 +73,7 @@
"saucelabs": "^7.4.0",
"typescript": "^5.0.0",
"vitepress": "^1.0.0-rc.25",
"vitest": "^0.34.6",
"vitest": "^1.0.0-beta.5",
"webdriverio": "^8.17.0"
}
}
20 changes: 10 additions & 10 deletions src/property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ export type PropertyObserver<TypeHint = unknown> = (
type ConvertConstructorTypes<C extends Constructor<unknown>, T = InstanceType<C>> = T extends Number
? number
: T extends String
? string
: T extends Boolean
? boolean
: T extends unknown[]
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
any[]
: T extends Object
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
any
: T;
? string
: T extends Boolean
? boolean
: T extends unknown[]
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
any[]
: T extends Object
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
any
: T;

/**
* A state property declaration.
Expand Down
3 changes: 2 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';

const job = (() => {
Expand All @@ -21,7 +22,7 @@ export default defineConfig({
},
resolve: {
alias: {
'@chialab/dna': './src/index.ts',
'@chialab/dna': fileURLToPath(new URL('./src/index.ts', import.meta.url)),
},
},
test: {
Expand Down
Loading

0 comments on commit 93a980a

Please sign in to comment.