generated from un-ts/mono-lib-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: first blood, should just work (#1)
- Loading branch information
Showing
18 changed files
with
1,650 additions
and
1,114 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Size Limit | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
size-limit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: latest | ||
|
||
- name: Setup Node.js LTS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: pnpm | ||
|
||
- name: Install Dependencies | ||
run: pnpm i | ||
|
||
- uses: andresz1/size-limit-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
skip_step: install | ||
script: pnpm size-limit --json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { OniiQuill } from '@oniijs/quill' | ||
|
||
export type CustomElement<T> = Partial< | ||
DOMAttributes<T> & T & { children: unknown } | ||
> | ||
|
||
export type CustomEvents<K extends string, T = unknown> = { | ||
[key in K]: (event: CustomEvent<T>) => void | ||
} | ||
|
||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
['onii-quill']: CustomElement<OniiQuill> | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"license": "MIT", | ||
"private": true, | ||
"workspaces": [ | ||
"packages/@oniijs/*", | ||
"packages/*" | ||
], | ||
"packageManager": "[email protected]", | ||
|
@@ -34,32 +35,38 @@ | |
"version": "changeset version" | ||
}, | ||
"devDependencies": { | ||
"@1stg/app-config": "^7.1.1", | ||
"@1stg/lib-config": "^10.1.1", | ||
"@1stg/app-config": "^7.2.1", | ||
"@1stg/lib-config": "^10.2.1", | ||
"@changesets/changelog-github": "^0.4.6", | ||
"@changesets/cli": "^2.24.3", | ||
"@pkgr/webpack": "^3.3.0", | ||
"@pkgr/webpack-mdx": "^2.1.0", | ||
"@oniijs/quill": "workspace:*", | ||
"@pkgr/webpack": "^3.3.1", | ||
"@pkgr/webpack-mdx": "^2.1.1", | ||
"@size-limit/preset-small-lib": "^8.0.1", | ||
"@types/node": "^18.7.13", | ||
"@types/quill": "^2.0.9", | ||
"@types/react": "^18.0.17", | ||
"@types/react-dom": "^18.0.6", | ||
"@types/web": "^0.0.72", | ||
"@vitest/coverage-istanbul": "^0.22.1", | ||
"github-markdown-css": "^5.1.0", | ||
"happy-dom": "^6.0.4", | ||
"onii": "workspace:*", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^6.3.0", | ||
"sirv-cli": "^2.0.2", | ||
"size-limit": "^8.0.1", | ||
"tsx": "^3.8.2", | ||
"type-coverage": "^2.22.0", | ||
"typescript": "^4.7.4", | ||
"typescript": "^4.8.2", | ||
"unplugin-auto-import": "^0.11.2", | ||
"vitest": "^0.22.1" | ||
}, | ||
"resolutions": { | ||
"prettier": "^2.7.1" | ||
}, | ||
"browserslist": "extends @1stg/browserslist-config/modern", | ||
"commitlint": { | ||
"extends": "@1stg" | ||
}, | ||
|
@@ -90,6 +97,19 @@ | |
"@1stg" | ||
] | ||
}, | ||
"size-limit": [ | ||
{ | ||
"path": "packages/@oniijs/quill/lib/index.js", | ||
"ignore": [ | ||
"quill" | ||
], | ||
"limit": "700B" | ||
}, | ||
{ | ||
"path": "packages/onii/lib/index.js", | ||
"limit": "40B" | ||
} | ||
], | ||
"stylelint": { | ||
"extends": "@1stg/stylelint-config" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Change Log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# @oniijs/quill | ||
|
||
Your powerful rich text editor with Web Components | ||
|
||
## TOC <!-- omit in toc --> | ||
|
||
- [Usage](#usage) | ||
- [Install](#install) | ||
- [API](#api) | ||
- [Sponsors](#sponsors) | ||
- [Backers](#backers) | ||
- [Changelog](#changelog) | ||
- [License](#license) | ||
|
||
## Usage | ||
|
||
### Install | ||
|
||
```sh | ||
# pnpm | ||
pnpm add @oniijs/quill | ||
|
||
# yarn | ||
yarn add @oniijs/quill | ||
|
||
# npm | ||
npm i @oniijs/quill | ||
``` | ||
|
||
### API | ||
|
||
```js | ||
import echo from '@oniijs/quill' | ||
|
||
echo() | ||
``` | ||
|
||
## Sponsors | ||
|
||
| 1stG | RxTS | UnTS | | ||
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | ||
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) | | ||
|
||
## Backers | ||
|
||
| 1stG | RxTS | UnTS | | ||
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | ||
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) | | ||
|
||
## Changelog | ||
|
||
Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md). | ||
|
||
## License | ||
|
||
[MIT][] © [JounQin][]@[1stG.me][] | ||
|
||
[1stg.me]: https://www.1stg.me | ||
[jounqin]: https://GitHub.com/JounQin | ||
[mit]: http://opensource.org/licenses/MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "@oniijs/quill", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"description": "Your powerful rich text editor with Web Components", | ||
"repository": "git+https://github.com/oniijs/onii.git", | ||
"homepage": "https://github.com/oniijs/onii/blob/main/packages/quill", | ||
"author": "JounQin (https://www.1stG.me) <[email protected]>", | ||
"funding": "https://opencollective.com/unts", | ||
"license": "MIT", | ||
"engines": { | ||
"node": "^12.20.0 || ^14.18.0 || >=16.0.0" | ||
}, | ||
"main": "./src/index.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"dependencies": { | ||
"quill": "^2.0.0-dev.4" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"main": "./lib/index.cjs", | ||
"module": "./lib/index.js", | ||
"exports": { | ||
"types": "./lib/index.d.ts", | ||
"import": "./lib/index.js", | ||
"require": "./lib/index.cjs" | ||
}, | ||
"types": "./lib/index.d.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export class OniiQuill extends HTMLElement { | ||
constructor() { | ||
super() | ||
|
||
const shadow = this.attachShadow({ mode: 'closed' }) | ||
|
||
const div = document.createElement('div') | ||
div.textContent = 'Hello World, Web Components!' | ||
|
||
shadow.append(div) | ||
} | ||
} | ||
|
||
export const define = (name = 'onii-quill') => | ||
customElements.define(name, OniiQuill) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { define, OniiQuill } from '@oniijs/quill' | ||
|
||
test('it should just work', () => { | ||
expect(customElements.get('onii-quill')).toBeUndefined() | ||
|
||
define() | ||
expect(customElements.get('onii-quill')).toBe(OniiQuill) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../../../tsconfig", | ||
"compilerOptions": { | ||
"composite": true, | ||
"rootDir": "src", | ||
"outDir": "lib" | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,37 +6,6 @@ | |
"repository": "git+https://github.com/oniijs/onii.git", | ||
"homepage": "https://github.com/oniijs/onii/blob/main/packages/onii", | ||
"author": "JounQin (https://www.1stG.me) <[email protected]>", | ||
"donate": { | ||
"recipients": [ | ||
{ | ||
"name": "unts", | ||
"platform": "opencollective", | ||
"address": "https://opencollective.com/unts", | ||
"weight": 60 | ||
}, | ||
{ | ||
"name": "rxts", | ||
"platform": "opencollective", | ||
"address": "https://opencollective.com/rxts", | ||
"weight": 20 | ||
}, | ||
{ | ||
"name": "1stG", | ||
"email": "[email protected]", | ||
"weight": 20, | ||
"platforms": [ | ||
{ | ||
"platform": "opencollective", | ||
"address": "https://opencollective.com/1stG" | ||
}, | ||
{ | ||
"platform": "patreon", | ||
"address": "https://www.patreon.com/1stG" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"funding": "https://opencollective.com/unts", | ||
"license": "MIT", | ||
"engines": { | ||
|
Oops, something went wrong.