-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from kidunot89/develop
Release 0.2.0
- Loading branch information
Showing
153 changed files
with
31,256 additions
and
10,879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
{ "presets": ["react-app"] } | ||
{ | ||
"presets": [ | ||
[ "@babel/preset-env", { "modules": false } ], | ||
"react-app" | ||
], | ||
"plugins": [ | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-external-helpers", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
# production | ||
/build | ||
/deploy | ||
|
||
# misc | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# production | ||
/demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#Changelog | ||
|
||
## [Experimental/Incomplete] | ||
## Added | ||
- **Introspectation CLI** use `wpg-intro <endpoint> <output>` to run execute an introspection query against `<endpoint>`, and a json file will be save at `<output>` for use in `WPProvider`. (Incomplete) | ||
|
||
## [0.2.0] Breaking Change | ||
### Added | ||
- **New build configuration** see changes below | ||
|
||
### Changes | ||
- **PWD restructured** `src/lib/` => `src/` | ||
- **Create-React-App ejected** to solves some styling issues as well as for optimization purposes the CRA has been ejected and all dependencies directly related to react-scripts have been removed. | ||
- **Circular dependencies removed** all `/[component-group]/index.js` have modified to be solely exporters all composer definitions are defined in the same file as the view layer for modularity and optimization. | ||
- **Unit Tests** they now run against the `dist/` instead of the `src/` | ||
|
||
### Fixed | ||
- **Unit Tests** unit test were broken somewhere between [0.1.5] - [0.1.3] | ||
|
||
### Removed | ||
- **`wp-graphql-compose` CLI ** see [0.1.10]:Deprecated | ||
- **`./src/demo`** Incomplete demo replace | ||
|
||
## [0.1.10] | ||
### Deprecated | ||
- **`wp-graphql-compose` CLI ** code related to the command line interface `wp-graphql-compose` is official deprecated and its recommend that you use [Oil-Based Boilerplate](https://github.com/kidunot89/oil-based-boilerplate) instead. `wp-graphql-compose` CLI will be remove in 0.2.x | ||
|
||
## [0.1.9 and below] | ||
### Added | ||
|
||
#### New components | ||
- **Archive** only post-results created | ||
- **Header** custom schema required until updates made to WP-GraphQL | ||
- **Main** | ||
- **Menu** | ||
- **MenuItem** | ||
- **SubMenu** | ||
- **Attachment** | ||
- **Page** | ||
- **Post** | ||
- **PostComments** | ||
- **Comment** | ||
- **EditComment** | ||
- **Login** | ||
- **UserControls** | ||
- **Error** | ||
- **Loading** | ||
- **Icon** | ||
- **WPProvider** | ||
|
||
#### Tests | ||
- **Archive** only post-results created | ||
- **Header** custom schema required until updates made to WP-GraphQL | ||
- **Main** | ||
- **Menu** | ||
- **Attachment** | ||
- **Page** | ||
- **Post** | ||
- **PostComments** | ||
- **Login** | ||
- **Error** | ||
- **Loading** | ||
- **Icon** | ||
- **WPProvider** | ||
|
||
#### WP-Composer functions | ||
- **baseComposer** | ||
- **composeQuery** | ||
- **errorHandler** | ||
- **forError** | ||
- **queryComposer** | ||
- **utilComposer** | ||
- **whileLoading** | ||
|
||
#### `wp-graphql-compose` CLI commands | ||
- `wp-graphql-compose init` - for scaffolding a WordPress theme or plugin stub | ||
- `wp-graphql-compose build` - for adding stub code to build directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import path from 'path'; | ||
import fetch from 'node-fetch'; | ||
|
||
export const introspectionFetch = (endpoint, output = path.resolve(process.cwd())) => { | ||
fetch(endpoint, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify({ | ||
variables: {}, | ||
operationName: '', | ||
query: ` | ||
{ | ||
__schema { | ||
types { | ||
kind | ||
name | ||
possibleTypes { | ||
name | ||
} | ||
} | ||
} | ||
} | ||
`, | ||
}), | ||
}) | ||
.then(result => result.json()) | ||
.then(result => { | ||
// here we're filtering out any type information unrelated to unions or interfaces | ||
const filteredData = result.data.__schema.types.filter( | ||
type => type.possibleTypes !== null, | ||
); | ||
result.data.__schema.types = filteredData; | ||
fs.writeFile(output, JSON.stringify(result.data), err => { | ||
if (err) { | ||
console.error('Error writing fragmentTypes file', err); | ||
} else { | ||
console.log('Fragment types successfully extracted!'); | ||
} | ||
}); | ||
}); | ||
}; |
Oops, something went wrong.