@rainte/js 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ export * as date from '../src/date';
2
+ export * as fast from '../src/fast';
3
+ export * as file from '../src/file';
4
+ export * as http from '../src/http';
5
+ export * as storage from '../src/storage';
@@ -1,5 +1 @@
1
- export * as date from './date';
2
- export * as fast from './fast';
3
- export * as file from './file';
4
- export * as http from './http';
5
- export * as storage from './storage';
1
+ export {};
package/lib/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * as date from '../src/date'
2
+ export * as fast from '../src/fast'
3
+ export * as file from '../src/file'
4
+ export * as http from '../src/http'
5
+ export * as storage from '../src/storage'
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@rainte/js",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.cjs",
6
6
  "module": "dist/index.js",
7
- "typings": "dist/types/lib/main.d.ts",
7
+ "typings": "dist/types/lib/index.d.ts",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
10
  "build": "vite build && tsc",
package/src/main.ts CHANGED
@@ -1,5 +1,20 @@
1
- export * as date from './date'
2
- export * as fast from './fast'
3
- export * as file from './file'
4
- export * as http from './http'
5
- export * as storage from './storage'
1
+ import * as date from './date'
2
+ import * as fast from './fast'
3
+
4
+ const make = (content: string, tag: keyof HTMLElementTagNameMap = 'li') => {
5
+ const ele = document.createElement(tag)
6
+ ele.textContent = content
7
+ return ele
8
+ }
9
+
10
+ const list = [
11
+ { label: 'label1', value: 'value1' },
12
+ { label: 'label2', value: 'value2' },
13
+ { label: 'label3', value: 'value3' }
14
+ ]
15
+
16
+ document
17
+ .querySelector<HTMLDivElement>('#app')
18
+ ?.appendChild(document.createElement('ul'))
19
+ ?.appendChild(make(date.dayjs().format(date.FORMAT.DATETIME)))
20
+ ?.appendChild(make(fast.find(list, 'value3', '无知')))
package/tsconfig.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "noUnusedParameters": true,
23
23
  "noFallthroughCasesInSwitch": true
24
24
  },
25
- "include": ["src", "vite.config.ts"]
25
+ "include": ["src", "lib", "vite.config.ts"]
26
26
  }
package/vite.config.ts CHANGED
@@ -4,7 +4,7 @@ import { resolve } from 'path'
4
4
  export default defineConfig({
5
5
  build: {
6
6
  lib: {
7
- entry: resolve(__dirname, 'src/main.ts'),
7
+ entry: resolve(__dirname, 'lib/index.ts'),
8
8
  name: '@rainte/js',
9
9
  fileName: 'index'
10
10
  }