-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zhi-lib-device): release zhi-lib-device 0.1.0, support systemjs …
…only
- Loading branch information
Showing
11 changed files
with
143 additions
and
35 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Expose Astro dependencies for \`pnpm\` users | ||
registry=https://registry.npmjs.com | ||
shamefully-hoist=true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,5 +1,15 @@ | ||
{ | ||
"name": "@siyuan-community/zhi-core", | ||
"version": "0.0.1", | ||
"type": "commonjs" | ||
"version": "0.1.0", | ||
"type": "module", | ||
"description": "a pluggable siyuan-note theme", | ||
"homepage": "https://github.com/terwer/zhi/tree/main/packages/zhi-core", | ||
"author": "terwer", | ||
"license": "GPL", | ||
"keywords": [ | ||
"zhi", | ||
"zhi-core", | ||
"siyuan-note", | ||
"theme" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,11 +1,55 @@ | ||
# zhi-lib-device | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
auto check environment whether in browser, browser extension, electron, node and more | ||
|
||
## Building | ||
## Usage | ||
|
||
Run `nx build zhi-lib-device` to build the library. | ||
```ts | ||
import { DeviceDetection, BrowserUtil, DeviceTypeEnum } from "@siyuan-community/zhi-device" | ||
|
||
## Running unit tests | ||
console.log("isInBrowser=>", BrowserUtil.isInBrowser) | ||
|
||
Run `nx test zhi-lib-device` to execute the unit tests via [Jest](https://jestjs.io). | ||
const deviceType: DeviceTypeEnum = DeviceDetection.getDevice() | ||
console.log("deviceType=>", deviceType) | ||
|
||
// supported platforms | ||
// Mobile | ||
// Siyuan_Widget | ||
// Siyuan_NewWindow | ||
// Siyuan_MainWindow | ||
// Chrome_Extension | ||
// Chrome_Browser | ||
// Node | ||
``` | ||
|
||
## Deps | ||
|
||
``` | ||
## Congregations! zhi-lib-device need no deps, it is just pure js code 🎉 | ||
``` | ||
|
||
## Dev | ||
|
||
```bash | ||
nx dev zhi-lib-device | ||
``` | ||
|
||
## Build | ||
|
||
```bash | ||
nx build zhi-lib-device | ||
``` | ||
|
||
## Test | ||
|
||
Execute the unit tests via [jest](https://jestjs.io/docs/getting-started#via-ts-jest) | ||
|
||
```bash | ||
nx test zhi-lib-device | ||
``` | ||
|
||
## Publish | ||
|
||
```bash | ||
nx publish zhi-lib-device --ver=0.1.0 --tag=latest | ||
``` |
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 |
---|---|---|
@@ -1,5 +1,17 @@ | ||
{ | ||
"name": "@siyuan-community/zhi-device", | ||
"version": "0.1.0", | ||
"type": "module" | ||
"type": "module", | ||
"description": "auto check environment whether in browser, browser extension, electron, node and more", | ||
"repository": "terwer/zhi", | ||
"homepage": "https://github.com/terwer/zhi/tree/main/packages/zhi-lib-device", | ||
"author": "terwer", | ||
"license": "GPL", | ||
"keywords": [ | ||
"zhi", | ||
"device", | ||
"browser", | ||
"node", | ||
"electron" | ||
] | ||
} |
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