Skip to content

Commit

Permalink
feat: migrate @tianditu/web-components to @tianditu/wc
Browse files Browse the repository at this point in the history
  • Loading branch information
DemoMacro committed Oct 19, 2023
1 parent e4554f2 commit 5892b2a
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 65 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- [@tianditu/api](./packages/api/README.md)
- [@tianditu/types](./packages/types/README.md)
- [@tianditu/vue](./packages/vue/README.md)
- [@tianditu/web-components](./packages/web-components/README.md)
- [@tianditu/wc](./packages/web-components/README.md)

## License

Expand Down
6 changes: 3 additions & 3 deletions packages/vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

```bash
# npm
$ npm install -D @tianditu/web-components @tianditu/vue
$ npm install -D @tianditu/wc @tianditu/vue

# yarn
$ yarn add -D @tianditu/web-components @tianditu/vue
$ yarn add -D @tianditu/wc @tianditu/vue

# pnpm
$ pnpm add -D @tianditu/web-components @tianditu/vue
$ pnpm add -D @tianditu/wc @tianditu/vue
```

## License
Expand Down
6 changes: 1 addition & 5 deletions packages/vue/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ import { defineBuildConfig } from "unbuild";
export default defineBuildConfig({
declaration: true,
entries: ["src/index"],
externals: [
"vue",
"@tianditu/web-components",
"@tianditu/web-components/dist/loader",
],
externals: ["vue", "@tianditu/wc", "@tianditu/wc/dist/loader"],
});
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"homepage": "https://github.com/DemoMacro/tianditu#readme",
"devDependencies": {
"@tianditu/web-components": "workspace:*",
"@tianditu/wc": "workspace:*",
"vue": "3.3.4"
}
}
2 changes: 1 addition & 1 deletion packages/vue/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* auto-generated vue proxies */
import { defineContainer } from "./vue-component-lib/utils";

import type { JSX } from "@tianditu/web-components";
import type { JSX } from "@tianditu/wc";

export const TdtControl = /*@__PURE__*/ defineContainer<JSX.TdtControl>(
"tdt-control",
Expand Down
5 changes: 1 addition & 4 deletions packages/vue/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
applyPolyfills,
defineCustomElements,
} from "@tianditu/web-components/dist/loader";
import { applyPolyfills, defineCustomElements } from "@tianditu/wc/dist/loader";
import { Plugin } from "vue";

export const ComponentLibrary: Plugin = {
Expand Down
42 changes: 42 additions & 0 deletions packages/wc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# @tianditu/wc

![npm version](https://img.shields.io/npm/v/@tianditu/wc)
![npm downloads](https://img.shields.io/npm/dw/@tianditu/wc)
![npm license](https://img.shields.io/npm/l/@tianditu/wc)

> Web components for tianditu, powered by Demo Macro.
## Getting started

### CDN

```html
<html>
<head>
<script
type="module"
src="https://cdn.jsdelivr.net/npm/@tianditu/wc/dist/web-components/web-components.esm.js"
></script>
</head>
<body>
<tdt-map tk=""></tdt-map>
</body>
</html>
```

### NPM

```bash
# npm
$ npm install -D @tianditu/wc

# yarn
$ yarn add -D @tianditu/wc

# pnpm
$ pnpm add -D @tianditu/wc
```

## License

- [MIT](LICENSE) &copy; [Demo Macro](https://imst.xyz/)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@tianditu/web-components",
"name": "@tianditu/wc",
"version": "0.0.0",
"description": "Web components for tianditu, powered by Demo Macro.",
"main": "dist/index.cjs.js",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const config: Config = {
dir: "dist/hydrate",
},
vueOutputTarget({
componentCorePackage: "@tianditu/web-components",
componentCorePackage: "@tianditu/wc",
proxiesFile: "../vue/src/components.ts",
}),
{
Expand Down
File renamed without changes.
42 changes: 0 additions & 42 deletions packages/web-components/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion playground/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@tianditu/api": "workspace:*",
"@tianditu/types": "workspace:*",
"@tianditu/vue": "workspace:*",
"@tianditu/web-components": "workspace:*",
"@tianditu/wc": "workspace:*",
"@unocss/nuxt": "0.56.1",
"@unocss/reset": "0.56.1",
"nuxt": "3.7.4"
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5892b2a

Please sign in to comment.