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
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ body:
value: "Please describe the problem you are having. Include any relevant log output, if applicable."
validations:
required: true
- type: dropdown
id: version
attributes:
label: Version
description: What version of our software are you running?
options:
- 1.0.0
- 2.0.0
- 2.0.5
- 3.0.0
default: 3
validations:
required: true
- type: textarea
id: logs
attributes:
Expand Down
16 changes: 16 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MIT License

Copyright (c) 2024 Quickdevelopment

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# WP-JS

Get all your public WordPress data through the WP API using a tree-shakable TypeScript library.

## Pre-requisites
- Make sure your WordPress site has the WP REST API enabled.
- It can cause CORS issues if you're using a local WordPress site.
<div align="center">
<h2>@quickdevelopment/wp-js &middot; <a href="https://badge.fury.io/js/@quickdevelopment%2Fwp-js"><img src="https://badge.fury.io/js/@quickdevelopment%2Fwp-js.svg" alt="npm version" height="18"></a></h2>
<p align="center">
Get all your public WordPress data through the WP API using a tree-shakable TypeScript library.
</p>
</div>

<details>
<summary>Table of Contents</summary>
<ol>
<li><a href="#installation">Installation</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#coming-up">Coming up</a></li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
</ol>
</details>

## Installation
```
Expand Down Expand Up @@ -32,7 +42,7 @@ import {Post, PostDataType} from "@quickdevelopment/wp-js";

const posts = new Post()

posts.fetch().then((posts: PostDataType[]) => {
posts.fetchMany().then((posts: PostDataType[]) => {
console.log(posts);
})
.catch((err) => {
Expand All @@ -47,7 +57,7 @@ import {User, UserDataType} from "@quickdevelopment/wp-js";

const user = new User(116)

user.fetch().then((user: UserDataType[]) => {
user.fetchMany().then((user: UserDataType[]) => {
console.log(user);
})
.catch((err) => {
Expand All @@ -69,20 +79,24 @@ class CustomEndpoint extends WPJSBase<CustomEndpointType> {
public fetch(): Promise<CustomEndpointType> {
return this.get();
}

public fetchMany(): Promise<CustomEndpointType[]> {
return this.get();
}
}
```

## Coming up
- [ ] Add more API classes to retrieve data from the WP API
- [x] Add more API classes to retrieve data from the WP API
- [ ] Examples of how to use the library in multiple contexts
- [ ] Add a documentation site

## Issues
If you find any issues with the library, please create an issue on the GitHub repository.
## Contributing
If you want to contribute to this project, see [CONTRIBUTING](CONTRIBUTING) for details.

| Known Issues | Status |
|--------------|--------|
| | |
## License
MIT © Quickdevelopment. See [LICENSE](LICENSE) for details.

## Contributing
If you want to contribute to this project, please read the CONTRIBUTING.md file.

[coveralls-image]:https://coveralls.io/repos/github/quickdevelopment/wp-js/badge.svg?branch=main
[coveralls-url]:https://coveralls.io/github/quickdevelopment/wp-js?branch=main
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@quickdevelopment/wp-js",
"private": false,
"version": "3.0.0",
"version": "3.0.1",
"repository": "https://github.com/QuickDevelopment/wp-js",
"author": "QuickDevelopment",
"license": "MIT",
Expand Down Expand Up @@ -38,7 +38,7 @@
"build": "tsc && vite build",
"build:watch": "tsc && vite build --watch",
"preview": "vite preview",
"prepublishOnly": "npm run build",
"prepublishOnly": "npm run lint && npm run build",
"lint": "npx eslint ."
},
"devDependencies": {
Expand Down