Skip to content
This repository was archived by the owner on Oct 1, 2022. It is now read-only.

Commit 24fa262

Browse files
authored
Update Pulse to 3.1.0 (#128)
Develop — updates
2 parents dfdb022 + 031b8f4 commit 24fa262

62 files changed

Lines changed: 2528 additions & 41126 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ private/
2525
*.sw*
2626

2727
# Generated files from build
28+
build/
29+
declarations/
2830
dist/
2931
docs/dist/
3032

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
examples
2-
test
2+
test
3+
build/

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

config/readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
please do NOT change any config files without consulting Jamie first! Thanks :P
2+
3+
handy command to remove accidental build files in lib
4+
5+
```
6+
rm -f lib/**/*.(js|js.map)
7+
```

config/tsconfig.dev.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../dist",
5+
"declaration": true,
6+
"declarationDir": "../dist"
7+
}
8+
}

config/tsconfig.prod.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"declarationDir": "../declarations"
6+
}
7+
}

config/webpack.config.dev.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const base = require('../webpack.config');
2+
3+
module.exports = {
4+
...base('dev'),
5+
name: 'dev',
6+
mode: 'development',
7+
devtool: 'inline-source-map',
8+
watch: true,
9+
entry: {
10+
index: './lib/index.ts',
11+
next: './lib/next'
12+
},
13+
plugins: []
14+
};

config/webpack.config.prod.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const base = require('../webpack.config');
2+
const dts = require('dts-bundle-webpack');
3+
const TerserPlugin = require('terser-webpack-plugin');
4+
5+
module.exports = {
6+
...base('prod'),
7+
name: 'build',
8+
mode: 'production',
9+
devtool: 'hidden-source-map',
10+
entry: {
11+
index: './lib/index.ts',
12+
next: './lib/next'
13+
},
14+
optimization: {
15+
minimize: true,
16+
minimizer: [
17+
new TerserPlugin({
18+
terserOptions: {
19+
keep_classnames: true,
20+
keep_fnames: true
21+
}
22+
})
23+
]
24+
},
25+
plugins: [
26+
new dts({
27+
name: 'pulse-framework',
28+
main: 'declarations/index.d.ts',
29+
out: '../dist/index.d.ts'
30+
}),
31+
new dts({
32+
name: 'pulse-framework/next',
33+
main: 'declarations/next/index.d.ts',
34+
out: '../../dist/next.d.ts'
35+
})
36+
]
37+
};

docs/.vuepress/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = {
121121
{
122122
title: 'Getting Started',
123123
collapsable: false,
124-
children: ['getting-started/setup-with-react', 'getting-started/concepts']
124+
children: ['getting-started/setup-with-react', 'getting-started/setup-with-vue', 'getting-started/concepts']
125125
},
126126
{
127127
title: 'Documentation',
@@ -136,6 +136,7 @@ module.exports = {
136136
'docs/core',
137137
'docs/api',
138138
'docs/persisting-data',
139+
'docs/events',
139140
'docs/ssr'
140141
]
141142
},

docs/v3/docs/api.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
title: API
33
---
4-
54
## Introduction
6-
5+
::: warning Sorry!
6+
This page is not up to standards, improvements need to be made inline with the rest of the documentation.
7+
:::
78
# API
89

910
This is Pulse's integrated fetch API. It's a wrapper around Fetch, which is native to the browser environment.
10-
11+
```ts
12+
const MyAPI = App.API()
13+
```
1114
## Setup
12-
13-
To create an api instance, you must pass a config object. This will define several things such as the options, baseurl, path, timeout and some functions to run before and after each http request.
14-
15+
The API class accepts a config object.
1516
```ts
1617
const MyAPI = App.API({
1718
options: {
1819
headers: {
1920
'content-type': 'application/json, text/plain' // this is not necessary
2021
}
21-
// ...
2222
},
2323
baseURL: 'https://api.mysite.co', // default: 'https://localhost'
2424
path: '/api', // default: '/'
@@ -71,9 +71,9 @@ interface PulseResponse<DataType = any> {
7171
}
7272
```
7373

74-
**Available functions and Properties**
74+
## Methods
7575

76-
## `API.with()`
76+
# `.with()`
7777

7878
This function allows you to override the API config and request options. It returns a modified instance of the original API with the options in the config parameter overriding the original config options.
7979

@@ -85,7 +85,7 @@ This function allows you to override the API config and request options. It retu
8585

8686
- [response (Response)](#response)
8787

88-
## `API.get()`
88+
# `.get()`
8989

9090
Send a HTTP get request to a url
9191

@@ -98,7 +98,7 @@ Send a HTTP get request to a url
9898

9999
- [response (Response)](#response)
100100

101-
## `API.post()`
101+
# `.post()`
102102

103103
Send a HTTP post request to a URL
104104

@@ -112,7 +112,7 @@ Send a HTTP post request to a URL
112112

113113
- [response (Response)](#response)
114114

115-
## `API.put()`
115+
# `.put()`
116116

117117
Send a HTTP put request to a URL
118118

@@ -126,7 +126,7 @@ Send a HTTP put request to a URL
126126

127127
- [response (Response)](#response)
128128

129-
## `API.patch()`
129+
# `.patch()`
130130

131131
Send a HTTP patch request to a URL
132132

@@ -140,7 +140,7 @@ Send a HTTP patch request to a URL
140140

141141
- [Response (response)](#response)
142142

143-
## `API.delete()`
143+
# `.delete()`
144144

145145
Send a HTTP delete request to a URL
146146

0 commit comments

Comments
 (0)