You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: update `code-item` to `CodeGroupItem`
Changes required for vuepressV2
upfrontjs/docs@946e50d
* chore(deps-dev): update eslint
* docs(services): removed typo
* ci: refined api docs deployment
* Feat/0.14.0 (#296)
## Feature:
* feat(collection): add dot notation to pluck method
* feat(collection): add `shuffle` method
## Chore:
* chore: increment version
* chore: make tsc output predictable
* chore(deps-dev): update dependencies
## Refactor:
* refactor(helpers): split out functions into files
* This will help with maintainability and with tree-shaking when packaging separately for cjs.
* refactor: import helper methods from their respective path
## Testing:
* test: fix timestamp
* test(api-calls): removed some casting
* The values can already be inferred from the code
* test(helpers): fix node@16 fringe testing error
* Potentially issue due to different architecture on the runner.
* https://github.com/upfrontjs/framework/actions/runs/3118093610/jobs/5057158718#step:5:59
* test(helpers): use real timers where possible
* test(helpers): clarified comment
Copy file name to clipboardExpand all lines: docs/calliope/attributes.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@ Models have been given powerful tools to manage data without involved logic and
13
13
Casting transforms values when accessing or setting attributes on a model.
14
14
To define the casters on your model you should define a getter for the `casts` property.
15
15
16
-
<code-group>
17
-
<code-blocktitle="Javascript">
16
+
<CodeGroup>
17
+
<CodeGroupItemtitle="Javascript">
18
18
```js
19
19
// User.js
20
20
import { Model } from'@upfrontjs/framework';
@@ -27,9 +27,9 @@ export default class User extends Model {
27
27
}
28
28
}
29
29
```
30
-
</code-block>
30
+
</CodeGroupItem>
31
31
32
-
<code-blocktitle="Typescript">
32
+
<CodeGroupItemtitle="Typescript">
33
33
```ts
34
34
// User.ts
35
35
import { Model } from'@upfrontjs/framework';
@@ -44,8 +44,8 @@ export default class User extends Model {
44
44
}
45
45
}
46
46
```
47
-
</code-block>
48
-
</code-group>
47
+
</CodeGroupItem>
48
+
</CodeGroup>
49
49
50
50
**The following cast types are available:**
51
51
@@ -72,8 +72,8 @@ Cast the values to the [given date time](../helpers/global-config.md#datetime) b
72
72
73
73
This is an object which implements the `AttributeCaster` type. Meaning it has a `get` and a `set` method both of which accepts a value, and an `Attributes` object (the equivalent of [getRawAttributes](#getrawattributes)) argument.
74
74
75
-
<code-group>
76
-
<code-blocktitle="Javascript">
75
+
<CodeGroup>
76
+
<CodeGroupItemtitle="Javascript">
77
77
```js
78
78
// User.js
79
79
import { Model } from'@upfrontjs/framework';
@@ -93,9 +93,9 @@ export default class User extends Model {
93
93
}
94
94
}
95
95
```
96
-
</code-block>
96
+
</CodeGroupItem>
97
97
98
-
<code-blocktitle="Typescript">
98
+
<CodeGroupItemtitle="Typescript">
99
99
```ts
100
100
// User.ts
101
101
import { Model } from'@upfrontjs/framework';
@@ -116,8 +116,8 @@ export default class User extends Model {
116
116
}
117
117
}
118
118
```
119
-
</code-block>
120
-
</code-group>
119
+
</CodeGroupItem>
120
+
</CodeGroup>
121
121
122
122
### Further casting methods
123
123
@@ -328,8 +328,8 @@ user.fullName; // 'Dr. John Doe'
328
328
329
329
While some prefer to name their variables and object keys as [camelCase](../helpers/readme.md#camel) others will prefer [snake_case](../helpers/readme.md#snake) or perhaps there are different conventions between the front and back end. To accommodate such preferences you can set the `attributeCasing` getter to return either `'camel'` or `'snake'` like so:
330
330
331
-
<code-group>
332
-
<code-blocktitle="Javascript">
331
+
<CodeGroup>
332
+
<CodeGroupItemtitle="Javascript">
333
333
334
334
```js
335
335
// User.js
@@ -341,9 +341,9 @@ export default class User extends Model {
341
341
}
342
342
}
343
343
```
344
-
</code-block>
344
+
</CodeGroupItem>
345
345
346
-
<code-blocktitle="Typescript">
346
+
<CodeGroupItemtitle="Typescript">
347
347
348
348
```ts
349
349
// User.ts
@@ -355,8 +355,8 @@ export default class User extends Model {
355
355
}
356
356
}
357
357
```
358
-
</code-block>
359
-
</code-group>
358
+
</CodeGroupItem>
359
+
</CodeGroup>
360
360
361
361
When using mass-assignment like the [create](./readme.md#create) and the [fill](#fill) methods, all keys of the given arguments will automatically and recursively transform to the set casing. e.g.: `user.fill({ some_value: 1 }).someValue; // 1`
362
362
The default value is `'camel'`. This can be counteracted by the [serverAttributeCasing](./api-calls.md#serverattributecasing) getter method when sending data to the server.
Copy file name to clipboardExpand all lines: docs/getting-started/installation.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
# Installation
2
2
3
-
<code-group>
4
-
<code-blocktitle="npm">
3
+
<CodeGroup>
4
+
<CodeGroupItemtitle="npm">
5
5
```shell
6
6
npm install @upfrontjs/framework
7
7
```
8
-
</code-block>
8
+
</CodeGroupItem>
9
9
10
-
<code-blocktitle="yarn">
10
+
<CodeGroupItemtitle="yarn">
11
11
```shell
12
12
yarn install @upfrontjs/framework
13
13
```
14
-
</code-block>
15
-
</code-group>
14
+
</CodeGroupItem>
15
+
</CodeGroup>
16
16
17
17
The library is transpiled to ES6 (currently the lowest supported version), but if you're using [Typescript](https://www.typescriptlang.org/), you could choose to use the source `.ts` files. To do so, import files from `/src` folder as opposed to the library root.
0 commit comments