Skip to content

Commit

Permalink
Release Candidate 2.0.0 (#575)
Browse files Browse the repository at this point in the history
* Bump @babel/core from 7.19.1 to 7.19.6 (#511)

Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.1 to 7.19.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.6/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump commander from 9.4.0 to 9.4.1 (#503)

Bumps [commander](https://github.com/tj/commander.js) from 9.4.0 to 9.4.1.
- [Release notes](https://github.com/tj/commander.js/releases)
- [Changelog](https://github.com/tj/commander.js/blob/master/CHANGELOG.md)
- [Commits](tj/commander.js@v9.4.0...v9.4.1)

---
updated-dependencies:
- dependency-name: commander
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump marked from 4.1.0 to 4.1.1 (#506)

Bumps [marked](https://github.com/markedjs/marked) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](markedjs/marked@v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [1-min] better package testing (#512)

* Bump mocha from 9.2.2 to 10.1.0 (#509)

* Bump sinon from 13.0.2 to 14.0.1 (#502)

* Bump @babel/cli from 7.18.10 to 7.19.3 (#501)

* Update dependabot.yml

* Workflow test changes and drop support for node 12 (#535)

* workflow test changes and drop support for node 12

* yarn install is still required

* yarn install needed everywhere. updated checkout

* did some breaking things (#540)

* [1-min] add default param object (#553)

* add default param object

* added to chagelog

* [1-min] watch the gql file to rebuild (#554)

* watch the gql file

* tidied up and fixed bug

* added changelog

* [1-min] allow anything but undefined examples (#555)

* all null to be used as an example

* reverted test/src/spectaql/index.test.js

* added changelog

* v1.5.7

* [1-min] optional do not fetch font (#556)

* add option to not fetch google font

* removed log

* added to changelog

* v1.5.8

* [1-min] update deps (#560)

* v1.5.8

* update deps

* changelog

* v1.5.9

* removed external font support

* support esm imports (#552)

* dependabot

* make them grunt deps our deps (#572)

* tidy

* subscriptions in operations (#573)

* put Subscriptions near Operations

* caching build

* .gitignore in vendor-src

* less noise from vendor script

* allow embeddable and oneFile to be set in config (#574)

* allow output to nowhere (#576)

* Nested heading and accessibility (#541)

* some more directive clarity (#577)

* env sub support (#578)

* examples on types (#580)

* barlow removal (#579)

* render default values for fields on more things (#581)

* changelog

* 2.0.0-beta.0

* readme

* scripts

* 2.0.0-beta.1

* Peer the Grunt deps (#586)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
newhouse and dependabot[bot] authored Dec 7, 2022
1 parent 41246ab commit daad420
Show file tree
Hide file tree
Showing 243 changed files with 15,273 additions and 1,459 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
],
},
ignorePatterns: [
'vendor-src/**/*.*js',
'src/**/javascripts/**/*.js',
'examples/output/javascripts/**/*.js',
],
Expand Down
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,20 @@ updates:
open-pull-requests-limit: 10
reviewers:
- newhouse
- package-ecosystem: npm
target-branch: 1.x
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
reviewers:
- newhouse
- package-ecosystem: npm
target-branch: rc-2-0-0
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
reviewers:
- newhouse

90 changes: 75 additions & 15 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,102 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI Lint And Test

on:
push:
branches: [ main ]
pull_request:
# Leave out to test branches off of branches
# branches: [ main ]

env:
NODE_VERSION_MAJOR: 16
GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
TARBALL_PATH: test/e2e/spectaql.tgz

jobs:

prepare-node:
name: Prepare Node
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION_MAJOR }}.x
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION_MAJOR }}
cache: 'yarn'
- run: yarn install

lint:
name: Lint
runs-on: ubuntu-latest
needs: prepare-node

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
- uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION_MAJOR }}.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: ${{ env.NODE_VERSION_MAJOR }}
cache: 'yarn'

- run: yarn install
- run: yarn lint:quiet

test:
name: Test
build-e2e-package:
name: Build E2E Package
runs-on: ubuntu-latest
needs: prepare-node

steps:
- uses: actions/checkout@v3

- name: Cache Package Build
id: cache-package-build
uses: actions/cache@v3
with:
# We'll cache this file
path: ${{ env.TARBALL_PATH }}
key: ${{ runner.os }}-node-v${{ env.NODE_VERSION_MAJOR }}-${{ env.GITHUB_SHA }}

- name: Use Node.js ${{ env.NODE_VERSION_MAJOR }}.x
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION_MAJOR }}
cache: 'yarn'

- run: yarn install
- run: yarn test-e2e:build

unit-test-and-package-test:
name: Unit Test & Package Test
runs-on: ubuntu-latest
needs: build-e2e-package
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [14, 16, 18]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache Package Build
id: cache-package-build
uses: actions/cache@v3
with:
# This is the file to cache / restore
path: ${{ env.TARBALL_PATH }}
key: ${{ runner.os }}-node-v${{ env.NODE_VERSION_MAJOR }}-${{ env.GITHUB_SHA }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

# Node 14 ships with a version of NPM that does not work for us
- name: Optionally update NPM if needed
if: ${{ matrix.node-version == '14' }}
run: npm i -g npm@7
- run: yarn test-e2e:install-and-test
- run: yarn install
- run: yarn test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
dist/
vendor/
public
node_modules
scratch

config-local.yml

**/*.tgz
**/.DS_STORE
**/.DS_Store
~*
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12
v16
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
vendor/**/*.js
vendor-src/**/*.js
src/javascripts
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
### 2.0.0
- BREAKING CHANGE: Drops support for Node 12. Requires Node `>=14`
- BREAKING CHANGE: Requires `npm >= 7`
- BREAKING CHANGE: The `run` and `loadData` commands are now asynchronous and return a promise.
- Fixes bugs and adds better support for various `example` generation scenarios.
- BREAKING CHANGE: `Subscriptions` are now listed under `Operations` alongside `Queries` and `Mutations` in the default theme.
- BREAKING CHANGE: No external fonts are loaded in the included themes, so the `loadExternalFont` option was removed.
- `config` yaml will have environment variable substitution performed.
- `config` yaml can now be specified as a CLI option, instead of only as the first argument.
- Themes written as ESM/`.mjs` modules are now supported.
- BREAKING CHANGE: Accessibility improvements for `<h>` tags deeper than `<h6>` using the `aria-level` attribute.
- `embeddable`, `oneFile` and `targetDir` are now options that can be specified in the config yaml (previously was only CLI).
- `targetDir` can be set to `null` in order to not write any output to a user directory.
- BREAKING CHANGE: `headers` CLI option is now `-H` instead of `-A`
- Moves a number of unmaintained Grunt dependencies "in-house" so that they can be updated for vulnerabilities and bugs.
- BREAKING CHANGE: Dropped support for accidental `queryNameStategy` option. 🤦

### 1.5.9
- Updated dependencies.

### 1.5.8
- Add option to disable 3rd party font request in some built-in themes via the `loadExternalFont` option. https://github.com/anvilco/spectaql/pull/556

### 1.5.7
- Default a few deconstructed object params to be an empty object. https://github.com/anvilco/spectaql/pull/553
- Fix bug where config and SDL files were not being properly watched in some cases. https://github.com/anvilco/spectaql/pull/554
- Fix bug, now allow anything but `undefined` to be used as an example. https://github.com/anvilco/spectaql/issues/547

### 1.5.6
- Re-publish after some reverts

Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ That config will direct a build that flexes the most interesting parts of Specta

To generate your documentation, SpectaQL requires a configuration YAML. This file is where you can specify most of the options to make your output the way you'd like it. All the supported options and their descriptions can be found in the [`config-example.yml`](https://github.com/anvilco/spectaql/blob/master/config-example.yml) file.

Environment variable substitution will be performed, so feel free to use environment variables in your config.

You can also see a minimal-ish working example YAML in the [examples/config.yml](https://github.com/anvilco/spectaql/blob/master/examples/config.yml) file.

## Command Line Options
Expand Down Expand Up @@ -169,9 +171,23 @@ Here's what you need to know:
{ key: String!, value: String! }
```
- All the `value` fields should be provided as strings, and they will be appropriately parsed based on the supported value of the `key` field.
- You do not need to add the definition of the `spectaql` directive, nor its `SpectaQLOption` input type. They will be added (and removed) by SpectaQL automatically if you enable the feature.
- SpectaQL does not need you to add the definition of the `spectaql` directive, nor its `SpectaQLOption` input type to your SDL. They will be added (and removed) by SpectaQL automatically if you enable the feature. However, if you are using that same SDL to create an executable schema, you will need to add the directive and options definitions.
- The directive can be added to your SDL anywhere that directives are supported by GraphQL SDL syntax, but they may only have an impact on the areas that SpectaQL supports.

The directive-related SDL is:
```sdl
directive @spectaql(options: [SpectaQLOption]) on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
input SpectaQLOption { key: String!, value: String! }
````
Or you can generate the required directive SDL programmatically like so:
```node
import { generateSpectaqlSdl } from 'spectaql'
const spectaqlSdl = generateSpectaqlSdl()
// Do something with this SDL
```

Once enabled, the directive can be used like so:
```sdl
type MyType {
Expand Down
7 changes: 6 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ module.exports = {
// modules: 'commonjs',
targets: {
// Keep this roughly in-line with our "engines.node" value in package.json
node: '12',
node: '14',
},
exclude: [
// Node 14+ supports this natively AND we need it to operate natively
// so do NOT transpile it
'proposal-dynamic-import',
],
},
],
],
Expand Down
Loading

0 comments on commit daad420

Please sign in to comment.