Skip to content

Commit

Permalink
refactor!: rename all to index and index to core (#5)
Browse files Browse the repository at this point in the history
* rename all to index and index to core

* update README
  • Loading branch information
sapphi-red authored Jan 19, 2021
1 parent 333c7b0 commit 708f893
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ On the other hand, in Spreadsheets apps like Microsoft Excel or Google Sheets, f
From the example above, now we can have:

```js
import { set } from 'vue-chemistry'
import { set } from 'vue-chemistry/core'
import { sum } from 'vue-chemistry/math'
import { log } from 'vue-chemistry/console'

Expand Down Expand Up @@ -78,7 +78,7 @@ function sum(
If you want to convert a normal function into a "reactified" one, you can use `reactify()` function. The source code can be found [here](https://github.com/antfu/vueuse/blob/master/packages/shared/reactify/index.ts) (deadly simple!).

```ts
import { reactify } from 'vue-chemistry'
import { reactify } from 'vue-chemistry/core'

function sum(x: number, y: number) {
return x + y
Expand All @@ -105,7 +105,7 @@ import { parseInt, parseFloat } from 'vue-chemistry/number'
import { parse, stringify } from 'vue-chemistry/json'
import { isFalsy } from 'vue-chemistry/boolean'
import { log } from 'vue-chemistry/console'
import { set } from 'vue-chemistry'
import { set } from 'vue-chemistry/core'
// or
import * as Math from 'vue-chemistry/math'
Math.sin(a)
Expand All @@ -114,14 +114,14 @@ Math.sin(a)
Or to have everything in one place:

```js
import { sqrt, parseInt, parse, log } from 'vue-chemistry/all'
import { sqrt, parseInt, parse, log } from 'vue-chemistry'
```


## Examples

```js
import { set } from 'vue-chemistry'
import { set } from 'vue-chemistry/core'
import { log } from 'vue-chemistry/console'
import { sqrt, pow, sum } from 'vue-chemistry/math'

Expand Down Expand Up @@ -154,7 +154,7 @@ log(str) // {"foo":"bar","no":42}
```

```ts
import { set } from 'vue-chemistry'
import { set } from 'vue-chemistry/core'
import { log } from 'vue-chemistry/console'
import { rs, toUpperCase } from 'vue-chemistry/string'

Expand All @@ -168,7 +168,7 @@ log(message) // Hello ANTHONY!
```

```ts
import { set } from 'vue-chemistry'
import { set } from 'vue-chemistry/core'
import { log } from 'vue-chemistry/console'
import { rs } from 'vue-chemistry/string'
import { dec, multiply } from 'vue-chemistry/match'
Expand All @@ -189,7 +189,7 @@ log(equation) // 987 x 9 + 5 = 8888
```

```ts
import { set, is, ternary, rs, log } from 'vue-chemistry/all'
import { set, is, ternary, rs, log } from 'vue-chemistry'

// String 3
//
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"import": "./esm/index.js",
"require": "./cjs/index.js"
},
"./core": {
"import": "./esm/core.js",
"require": "./cjs/core.js"
},
"./json": {
"import": "./esm/json/index.js",
"require": "./cjs/json/index.js"
Expand All @@ -35,10 +39,6 @@
"./console": {
"import": "./esm/console/index.js",
"require": "./cjs/console/index.js"
},
"./all": {
"import": "./esm/all.js",
"require": "./cjs/all.js"
}
},
"bugs": {
Expand Down
7 changes: 0 additions & 7 deletions src/all.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { reactify, reactifyObject, get, set, when, MaybeRef } from '@vueuse/shared'
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
export { reactify, reactifyObject, get, set, when, MaybeRef } from '@vueuse/shared'
export * from './boolean'
export * from './console'
export * from './json'
export * from './math'
export * from './number'
export * from './string'
export * from './core'
2 changes: 1 addition & 1 deletion test/examples.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref } from 'vue-demi'
import { rs, is, ternary, set, dec, multiply, sum, toUpperCase, stringify, pow, sqrt } from '../src/all'
import { rs, is, ternary, set, dec, multiply, sum, toUpperCase, stringify, pow, sqrt } from '../src'
import { $expect } from './utils'

describe('examples', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/string.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref } from 'vue-demi'
import { multiply, rs, is } from '../src/all'
import { multiply, rs, is } from '../src'
import { $expect } from './utils'

describe('reactiveStr', () => {
Expand Down

0 comments on commit 708f893

Please sign in to comment.