Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/1.guide/1.getting-started/1.quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ description: ''
// User Model

import { Model } from 'pinia-orm'
import { Str, Uid } from 'pinia-orm/dist/decorators'
import { Str, Uid } from 'pinia-orm/decorators'

export default class User extends Model {
// entity is a required property for all models.
Expand Down Expand Up @@ -144,7 +144,7 @@ description: ''
// Post Model

import { Model } from 'pinia-orm'
import { Attr, BelongsTo, Bool, Str, Uid } from 'pinia-orm/dist/decorators'
import { Attr, BelongsTo, Bool, Str, Uid } from 'pinia-orm/decorators'
import User from './User'

export default class Post extends Model {
Expand Down
2 changes: 1 addition & 1 deletion docs/content/1.guide/1.getting-started/2.usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ const userRepo = useRepo(User, this.$pinia)
Look into the [Api Guide](../../api/composables/helpers/use-collect) for usages of `useCollect` and more

The nice thing of these composables is that they work also with existing `vuex-orm` and `vuex-orm-net`. So if you like them
you can just import these helpers e.g. by `import { useCollect }` from `pinia-orm/dist/helpers`
you can just import these helpers e.g. by `import { useCollect }` from `pinia-orm/helpers`
10 changes: 5 additions & 5 deletions docs/content/1.guide/1.getting-started/4.typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ This is pretty new if you are a vuex-orm user. If you are a vuex-orm-next user t

````ts
import { Model } from 'pinia-orm'
import { Attr, Cast, Uid } from 'pinia-orm/dist/decorators'
import { ArrayCast } from 'pinia-orm/dist/casts'
import { Attr, Cast, Uid } from 'pinia-orm/decorators'
import { ArrayCast } from 'pinia-orm/casts'

class User extends Model {
static entity = 'users'
Expand All @@ -41,8 +41,8 @@ For more information about using `declare` read this [ticket](https://github.com

````ts
import { Model } from 'pinia-orm'
import { Attr, Cast, Uid } from 'pinia-orm/dist/decorators'
import { ArrayCast } from 'pinia-orm/dist/casts'
import { Attr, Cast, Uid } from 'pinia-orm/decorators'
import { ArrayCast } from 'pinia-orm/casts'

class User extends Model {
static entity = 'users'
Expand Down Expand Up @@ -70,7 +70,7 @@ Make sure to disable `useDefineForClassFields` in `tsconfig.json` when using `vi

````ts
import { Model } from 'pinia-orm'
import { ArrayCast } from 'pinia-orm/dist/casts'
import { ArrayCast } from 'pinia-orm/casts'

class User extends Model {
static entity = 'users'
Expand Down
20 changes: 10 additions & 10 deletions docs/content/1.guide/2.model/1.getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ Please make sure that you have `nanoid` installed:
For more details look at [nanoid](https://github.com/ai/nanoid). Standard methods

```js
import { UidCast } from 'pinia-orm/dist/nanoid'
// import { UidCast } from 'pinia-orm/dist/nanoid/non-secure'
// import { UidCast } from 'pinia-orm/dist/nanoid/async'
import { UidCast } from 'pinia-orm/nanoid'
// import { UidCast } from 'pinia-orm/nanoid/non-secure'
// import { UidCast } from 'pinia-orm/nanoid/async'

class User extends Model {
static entity = 'users'
Expand All @@ -239,9 +239,9 @@ class User extends Model {
with decorator:

```ts
import { Uid } from 'pinia-orm/dist/nanoid'
// import { Uid } from 'pinia-orm/dist/nanoid/non-secure'
// import { Uid } from 'pinia-orm/dist/nanoid/async'
import { Uid } from 'pinia-orm/nanoid'
// import { Uid } from 'pinia-orm/nanoid/non-secure'
// import { Uid } from 'pinia-orm/nanoid/async'

class User extends Model {
static entity = 'users'
Expand Down Expand Up @@ -269,8 +269,8 @@ Please make sure that you have `uuid` installed:
For more details look at [uuid](https://github.com/uuidjs/uuid). Standard methods

```js
import { UidCast } from 'pinia-orm/dist/uuid/v1'
// import { UidCast } from 'pinia-orm/dist/uuid/v4'
import { UidCast } from 'pinia-orm/uuid/v1'
// import { UidCast } from 'pinia-orm/uuid/v4'

class User extends Model {
static entity = 'users'
Expand All @@ -293,8 +293,8 @@ class User extends Model {
with decorator:

```ts
import { Uid } from 'pinia-orm/dist/uuid/v1'
// import { Uid } from 'pinia-orm/dist/uuid/v4'
import { Uid } from 'pinia-orm/uuid/v1'
// import { Uid } from 'pinia-orm/uuid/v4'

class User extends Model {
static entity = 'users'
Expand Down
2 changes: 1 addition & 1 deletion docs/content/1.guide/2.model/2.accessors.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ the value before it is saved in the store.

````ts
import { Model, useRepo } from 'pinia-orm'
import { Attr } from 'pinia-orm/dist/decorators'
import { Attr } from 'pinia-orm/decorators'
import { getActivePinia } from 'pinia';

class User extends Model {
Expand Down
38 changes: 19 additions & 19 deletions docs/content/1.guide/2.model/4.decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: ''
# Decorators

::alert{type=warning}
Since `v1.0.0-rc-6` the decorators moved to `pinia-orm/dist/decorators` from `pinia-orm`
Since `v1.0.0-rc-6` the decorators moved to `pinia-orm/decorators` from `pinia-orm`
::

Pinia ORM provides property decorators to Typescript users for better type support when defining the schema for an entity. Simply put, decorators replace the need to define the `fields` method.
Expand All @@ -14,7 +14,7 @@ The following example defines a User model using decorators on properties that f

```ts
import { Model } from 'pinia-orm'
import { Attr, Str, HasMany } from 'pinia-orm/dist/decorators'
import { Attr, Str, HasMany } from 'pinia-orm/decorators'
import Post from '@/models/Post'

class User extends Model {
Expand Down Expand Up @@ -57,7 +57,7 @@ Marks a property on the model as a [generic attribute](getting-started.md#generi

```ts
import { Model } from 'pinia-orm'
import { Attr } from 'pinia-orm/dist/decorators'
import { Attr } from 'pinia-orm/decorators'

export class User extends Model {
static entity = 'users'
Expand All @@ -74,7 +74,7 @@ Marks a property on the model as a [string attribute](./getting-started#string-t

```ts
import { Model } from 'pinia-orm'
import { Attr, Str } from 'pinia-orm/dist/decorators'
import { Attr, Str } from 'pinia-orm/decorators'

export class User extends Model {
static entity = 'users'
Expand All @@ -90,7 +90,7 @@ Marks a property on the model as a [number attribute](./getting-started#string-t

```ts
import { Model } from 'pinia-orm'
import { Num } from 'pinia-orm/dist/decorators'
import { Num } from 'pinia-orm/decorators'

export class User extends Model {
static entity = 'users'
Expand All @@ -107,7 +107,7 @@ Marks a property on the model as a [boolean attribute](./getting-started#boolean

```ts
import { Model } from 'pinia-orm'
import { Bool } from 'pinia-orm/dist/decorators'
import { Bool } from 'pinia-orm/decorators'

export class User extends Model {
static entity = 'users'
Expand All @@ -123,7 +123,7 @@ Marks a property on the model as a [Uid attribute](./getting-started#uid-type) t

```ts
import { Model } from 'pinia-orm'
import { Uid } from 'pinia-orm/dist/decorators'
import { Uid } from 'pinia-orm/decorators'

class User extends Model {
static entity = 'users'
Expand All @@ -138,7 +138,7 @@ Adds a [mutator](/model/accessors#defining-mutators) to a property on the model.

````ts
import { Model } from 'pinia-orm'
import { Attr, Mutate } from 'pinia-orm/dist/decorators'
import { Attr, Mutate } from 'pinia-orm/decorators'

class User extends Model {
static entity = 'users'
Expand All @@ -155,7 +155,7 @@ Adds a cast to a property on the model. For example:

````ts
import { Model } from 'pinia-orm'
import { Attr, Cast } from 'pinia-orm/dist/decorators'
import { Attr, Cast } from 'pinia-orm/decorators'
import { StringCast } from 'pinia-orm/casts'

class User extends Model {
Expand All @@ -177,7 +177,7 @@ Marks a property on the model as a [hasOne attribute](../relationships/getting-s

```ts
import { Model } from 'pinia-orm'
import { Attr, HasOne } from 'pinia-orm/dist/decorators'
import { Attr, HasOne } from 'pinia-orm/decorators'
import Phone from '@/models/Phone'

class User extends Model {
Expand All @@ -193,7 +193,7 @@ Marks a property on the model as a [belongsTo attribute](../relationships/gettin

```ts
import { Model } from 'pinia-orm'
import { Attr, BelongsTo } from 'pinia-orm/dist/decorators'
import { Attr, BelongsTo } from 'pinia-orm/decorators'
import User from '@/models/User'

class Post extends Model {
Expand All @@ -210,7 +210,7 @@ Marks a property on the model as a [hasMany attribute](../relationships/getting-

```ts
import { Model } from 'pinia-orm'
import { Attr, HasMany } from 'pinia-orm/dist/decorators'
import { Attr, HasMany } from 'pinia-orm/decorators'
import Post from '@/models/Post'

class User extends Model {
Expand All @@ -226,7 +226,7 @@ Marks a property on the model as a [hasManyBy attribute](../relationships/one-to

```ts
import { Model } from 'pinia-orm'
import { Attr, HasManyBy } from 'pinia-orm/dist/decorators'
import { Attr, HasManyBy } from 'pinia-orm/decorators'
import Node from '@/models/Node'

class Cluster extends Model {
Expand All @@ -243,7 +243,7 @@ Marks a property on the model as a [belongsToMany attribute](../relationships/ma

```ts
import { Model } from 'pinia-orm'
import { BelongsToMany } from 'pinia-orm/dist/decorators'
import { BelongsToMany } from 'pinia-orm/decorators'
import Role from '@/models/Role'

class User extends Model {
Expand All @@ -259,7 +259,7 @@ Marks a property on the model as a [morphOne attribute](../relationships/polymor

```ts
import { Model } from 'pinia-orm'
import { MorphOne } from 'pinia-orm/dist/decorators'
import { MorphOne } from 'pinia-orm/decorators'
import Image from '@/models/Image'

class User extends Model {
Expand All @@ -275,7 +275,7 @@ Marks a property on the model as a [morphTo attribute](../relationships/polymorp

```ts
import { Model } from 'pinia-orm'
import { Attr, MorphTo } from 'pinia-orm/dist/decorators'
import { Attr, MorphTo } from 'pinia-orm/decorators'
import User from '@/models/User'
import Post from '@/models/Post'

Expand All @@ -294,7 +294,7 @@ Marks a property on the model as a [morphMany attribute](../relationships/polymo

```ts
import { Model } from 'pinia-orm'
import { MorphMany } from 'pinia-orm/dist/decorators'
import { MorphMany } from 'pinia-orm/decorators'
import Comment from '@/models/Comment'
class Video extends Model {
static entity = 'videos'
Expand All @@ -309,7 +309,7 @@ Marks a property on the model as a [morphToMany attribute](../relationships/poly

```ts
import { Model } from 'pinia-orm'
import { MorphToMany } from 'pinia-orm/dist/decorators'
import { MorphToMany } from 'pinia-orm/decorators'
import Comment from '@/models/Comment'
import Commentable from '@/models/Commantable'
class Video extends Model {
Expand All @@ -327,7 +327,7 @@ Marks a property on the model as a [hasMany attribute](../relationships/getting-

```ts
import { Model } from 'pinia-orm'
import { Attr, HasMany, OnDelete } from 'pinia-orm/dist/decorators'
import { Attr, HasMany, OnDelete } from 'pinia-orm/decorators'
import Post from '@/models/Post'

class User extends Model {
Expand Down
4 changes: 2 additions & 2 deletions docs/content/1.guide/2.model/6.pinia-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ And therefore you need to be able to pass options to your store definition.

```ts[user.ts]
import { Model } from 'pinia-orm'
import { Attr, Str } from 'pinia-orm/dist/decorators'
import { Attr, Str } from 'pinia-orm/decorators'
import Post from '@/models/Post'

class User extends Model {
Expand All @@ -35,7 +35,7 @@ Through this options you can also overwrite the default pinia actions and add ev

```ts[user.ts]
import { DataStore, Model, useStoreActions, Elements } from 'pinia-orm'
import { Attr, Str } from 'pinia-orm/dist/decorators'
import { Attr, Str } from 'pinia-orm/decorators'
import Post from '@/models/Post'

class User extends Model {
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-collect.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For Details what each function can do, look at the separate composable for it e.

````ts
import { useRepo } from 'pinia-orm'
import { useCollect } from 'pinia-orm/dist/helpers'
import { useCollect } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-group-by.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'The useGroupBy method groups the collections items by a given key.

````ts
import { useRepo } from 'pinia-orm'
import { useGroupBy } from 'pinia-orm/dist/helpers'
import { useGroupBy } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'The keys method returns all of the collections primary keys'

````ts
import { useRepo } from 'pinia-orm'
import { useKeys } from 'pinia-orm/dist/helpers'
import { useKeys } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-max.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'Get the max value of the specified filed.'

````ts
import { useRepo } from 'pinia-orm'
import { useMax } from 'pinia-orm/dist/helpers'
import { useMax } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-min.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'Get the min value of the specified filed.'

````ts
import { useRepo } from 'pinia-orm'
import { useMin } from 'pinia-orm/dist/helpers'
import { useMin } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-pluck.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'The pluck method retrieves all of the values for a given key.'

````ts
import { useRepo } from 'pinia-orm'
import { usePluck } from 'pinia-orm/dist/helpers'
import { usePluck } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-sort-by.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'Sorts the collection by a given key'

````ts
import { useRepo } from 'pinia-orm'
import { useSortBy } from 'pinia-orm/dist/helpers'
import { useSortBy } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/2.api/1.composables/2.helpers/use-sum.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: 'Get the sum value of the specified filed.'

````ts
import { useRepo } from 'pinia-orm'
import { useSum } from 'pinia-orm/dist/helpers'
import { useSum } from 'pinia-orm/helpers'
import User from './models/User'

const users = useRepo(User).all()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class User extends Model {

````ts[User.ts]
import { Model } from 'pinia-orm'
import { Attr } from 'pinia-orm/dist/decorators'
import { Attr } from 'pinia-orm/decorators'

class User extends Model {
static entity = 'users'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class User extends Model {

````ts[User.ts]
import { Model } from 'pinia-orm'
import { Bool, Num } from 'pinia-orm/dist/decorators'
import { Bool, Num } from 'pinia-orm/decorators'

class User extends Model {
static entity = 'users'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class User extends Model {

````ts[User.ts]
import { Model } from 'pinia-orm'
import { Num } from 'pinia-orm/dist/decorators'
import { Num } from 'pinia-orm/decorators'

class User extends Model {
static entity = 'users'
Expand Down
Loading