diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d9b59f1..6f57c0e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -157,7 +157,7 @@ ### 1.2.0 -- Added a `custom.scss` file to the default theme to allow for simple theme customizations to easily get ohter CSS updates. +- Added a `custom.scss` file to the default theme to allow for simple theme customizations to easily get other CSS updates. - Added a `logoMaxHeightPx` option to set the logo's `max-height` property. - Added `scrollPaddingTopPx` option to set the `scroll-padding-top` property for when there's a Nav bar situation. @@ -212,7 +212,7 @@ ### 1.0.8 - Add support for query name strategies. https://github.com/anvilco/spectaql/pull/282 -- Bug fix: support examples from metatdata for Scalars. https://github.com/anvilco/spectaql/pull/283 +- Bug fix: support examples from metadata for Scalars. https://github.com/anvilco/spectaql/pull/283 - Bug fix: `themeDir` from CLI support. https://github.com/anvilco/spectaql/pull/284 - Bug fix: Reference interpolation. https://github.com/anvilco/spectaql/pull/285 @@ -240,7 +240,7 @@ Some notable additions/enhancements to `1.0.0` are: - When used in a `node` project, there are a few more exports now: - `run`: same as the default export that will build everything if you pass it sane options. - `parseCliOptions`: used to parse the CLI arguments into sane arguments to be passed to `run`. - - `loadData`: bascially does all the processing that SpectaQL would do with gathering and processing the data right up to the point where SpectaQL would start to generate the HTML, etc. + - `loadData`: basically does all the processing that SpectaQL would do with gathering and processing the data right up to the point where SpectaQL would start to generate the HTML, etc. - `buildSchemas`: Does a bit less than `loadData` in that it will take the provided options and return an augmented Introspection Query Response as well as a GraphQL Schema instance. - Choose from several built-in "themes", tweak the default theme, or completely change things up with your own theme! See the [/examples/themes/README.md][themes-readme] for more. diff --git a/README.md b/README.md index ecb46268..1445c1cd 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Using SpectaQL to generate your documentation has a number of benefits, such as: - Will automatically generate documentation for all Types, Fields, Queries, Mutations, Arguments and Subscriptions by default. - Supports blacklisting entire areas (e.g. "don't show Mutations") and 1-off blacklisting. - Supports providing examples via static metadata, or dynamically via a custom generator plugin that you control. -- Supports (beta) dynamic grouping and arranging of data via a custom data arrangment plugin that you control. +- Supports (beta) dynamic grouping and arranging of data via a custom data arrangement plugin that you control. - Supports light tweaking or complete customization of CSS, JS and HTML output via themes. - Supports markdown just about everywhere you can provide text. - Live preview mode while developing. @@ -159,7 +159,7 @@ SpectaQL supports 3 ways to include metadata to be used during processing: 2. Provide a standalone JSON file containing your metadata to be "woven" into your introspection query results by SpectaQL. SpectaQL uses the `addMetadata` method from [our Apollo Plugin](https://www.npmjs.com/package/@anvilco/apollo-server-plugin-introspection-metadata) under the hood, so please see the documentation there or [this example](https://github.com/anvilco/spectaql/blob/main/examples/data/metadata.json) file to understand its format. 3. If you are providing your schema information via an SDL file or files, leverage the [SpectaQL Directive](#the-spectaql-directive) feature to provide your metadata in your SDL through directives. See the [SpectaQL Directive](#the-spectaql-directive) for more information. -**NOTE**: Another way to ensure that things are not documented is to pass your GraphQL Instrospection Results through [Microfiber][microfiber] and perform the removal of any Types, Fields, Queries etc before they even reach SpectaQL. Just a thought. +**NOTE**: Another way to ensure that things are not documented is to pass your GraphQL Introspection Results through [Microfiber][microfiber] and perform the removal of any Types, Fields, Queries etc before they even reach SpectaQL. Just a thought. ## The SpectaQL Directive If you are providing your schema information via an SDL file or files, you can leverage the `@spectaql` directive and pass any of the supported `metadata` options to the `options` argument of that directive. This is a useful approach for those who are taking an "SDL-first" development approach. See the `spectaqlDirective` option in the [`config-example.yml`](https://github.com/anvilco/spectaql/blob/main/config-example.yml) file for more information on how to enable and implement this approach. @@ -214,7 +214,7 @@ SpectaQL ships with 3 included themes that can be specified via the `themeDir` o - `basic`: Outputs the same HTML structure as the `default` theme, but with minimal CSS styling. - `spectaql`: Outputs the same HTML structure as the `default` theme, but with some CSS enhancements. -In addition to those built-in themes, you can specify a path to a custom theme directory to the `themeDir` option. Your custom theme directory will be overlayed on top of the default theme directory, and therefore can include as much or as little overridden or additional files as necessary to obtain your desired output. +In addition to those built-in themes, you can specify a path to a custom theme directory to the `themeDir` option. Your custom theme directory will be overlaid on top of the default theme directory, and therefore can include as much or as little overridden or additional files as necessary to obtain your desired output. See [/examples/themes/README.md][themes-readme] for more information on how you can customize SpectaQL's output with themes. diff --git a/dev/build-e2e.mjs b/dev/build-e2e.mjs index 1f9ee870..bc52e9f4 100644 --- a/dev/build-e2e.mjs +++ b/dev/build-e2e.mjs @@ -42,7 +42,7 @@ let tarballName = await execSync( tarballName = getTarballNameFromOutput(tarballName.toString()) // Rename the thing -const orginalPath = path.join(e2eDir, tarballName) +const originalPath = path.join(e2eDir, tarballName) const newPath = path.join(e2eDir, 'spectaql.tgz') -await execSync(`mv ${orginalPath} ${newPath}`) +await execSync(`mv ${originalPath} ${newPath}`) diff --git a/examples/themes/README.md b/examples/themes/README.md index dbe44ea9..acb70bfb 100644 --- a/examples/themes/README.md +++ b/examples/themes/README.md @@ -8,7 +8,7 @@ SpectaQL's theming system is a powerful way to tweak or augment the default them ### Overview -Any custom theme that you use will be "overlayed" on top of SpectaQL's [default theme directory][default-theme-dir] and structure. This means that your theme gets all the templates, javascripts, CSS and helpers included in the default theme "for free". +Any custom theme that you use will be "overlaid" on top of SpectaQL's [default theme directory][default-theme-dir] and structure. This means that your theme gets all the templates, javascripts, CSS and helpers included in the default theme "for free". Any files that your theme includes will be added on top of the default theme's structure. This means you can: @@ -16,7 +16,7 @@ Any files that your theme includes will be added on top of the default theme's s - Include new files to be considered or included during the build process - Both! -The "theme" system works on a directory structure convention. Here's how that stucture looks: +The "theme" system works on a directory structure convention. Here's how that structure looks: ```js your-theme-dir/ @@ -55,7 +55,7 @@ An example or replacing the whole theme: ```scss // mytheme/stylesheets/main.scss -// This will replace the deafult theme +// This will replace the default theme // You can (but don't have to!) import structural styles from base and // syntax highlighting from the spectaql default theme @@ -86,13 +86,13 @@ You can override syntax highlighting styles by specifying a `syntax-highlighting ### `views` -SpectaQL uses [Handlebars][handlebars] as its templating engine - please read up on their docs if you'd like to alter this area. Any `.hbs` files that you add to this folder will be overlayed on top of the default theme's directory. +SpectaQL uses [Handlebars][handlebars] as its templating engine - please read up on their docs if you'd like to alter this area. Any `.hbs` files that you add to this folder will be overlaid on top of the default theme's directory. SpectaQL will look for the the `main.hbs` file in the resulting `views` directory as the entry point for Handlebars. If your theme provides a `main.hbs` file, that will overwrite the default one and be used to direct the HBS -> HTML build. -If you only want to tweak and/or add certain partials, you can do so by only including those customized or additional files in your theme. They will be overlayed on top of the default theme directory in a supplemental manner. +If you only want to tweak and/or add certain partials, you can do so by only including those customized or additional files in your theme. They will be overlaid on top of the default theme directory in a supplemental manner. -SpectaQL also supports running a theme in "embeddable" mode to produce output that can be embeded into an existing HTML page. In "embeddable" mode, the `embedded.hbs` file will be used as the entry point for Handlebars. Depending on the changes you've made, if you want your theme to support "embeddable" mode properly you may need to customize the `embedded.hbs` file in your theme. +SpectaQL also supports running a theme in "embeddable" mode to produce output that can be embedded into an existing HTML page. In "embeddable" mode, the `embedded.hbs` file will be used as the entry point for Handlebars. Depending on the changes you've made, if you want your theme to support "embeddable" mode properly you may need to customize the `embedded.hbs` file in your theme. ### `helpers` diff --git a/src/lib/common.js b/src/lib/common.js index 892158ee..65179e0b 100644 --- a/src/lib/common.js +++ b/src/lib/common.js @@ -20,7 +20,7 @@ hljs.configure({ hljs.registerLanguage('graphql', hljsGraphqlLang) -// Create a custom renderer for highlight.js compatability +// Create a custom renderer for highlight.js compatibility const mdRenderer = new marked.Renderer() mdRenderer.code = highlight @@ -43,7 +43,7 @@ const QUOTE_TAG_REGEX = new RegExp(QUOTE_TAG, 'g') const QUOTE_HTML = '"' const QUOTE_HTML_REGEX = new RegExp(QUOTE_HTML, 'g') -// Map Scalar types to example data to use fro them +// Map Scalar types to example data to use from them const SCALAR_TO_EXAMPLE = { String: ['abc123', 'xyz789'], Int: [123, 987], diff --git a/src/lib/gruntConfig.js b/src/lib/gruntConfig.js index 54204d33..0e4fc07f 100644 --- a/src/lib/gruntConfig.js +++ b/src/lib/gruntConfig.js @@ -86,7 +86,7 @@ module.exports = function (grunt, options, spectaqlData) { // https://www.npmjs.com/package/grunt-compile-handlebars // Compile the Handlebars templates as HTML into the target directory - // Everyting has been copied intermediately to the cache directory + // Everything has been copied intermediately to the cache directory // so that custom stuff can be combined with standard stuff 'compile-handlebars': { compile: { diff --git a/src/lib/interpolation.js b/src/lib/interpolation.js index efc50a41..ec650025 100644 --- a/src/lib/interpolation.js +++ b/src/lib/interpolation.js @@ -39,12 +39,12 @@ export function substituteEnv(valueIn) { } else { const keyParts = parts[2].split(':-') const key = keyParts[0] - const defautValue = keyParts[1] || '' + const defaultValue = keyParts[1] || '' replacePart = parts[0].substring(prefix.length) value = Object.prototype.hasOwnProperty.call(process.env, key) ? process.env[key] - : defautValue + : defaultValue // If the value is found, remove nested expansions. if (keyParts.length > 1 && value) { diff --git a/src/spectaql/generate-graphql-example-data.js b/src/spectaql/generate-graphql-example-data.js index 40231abb..192c6107 100644 --- a/src/spectaql/generate-graphql-example-data.js +++ b/src/spectaql/generate-graphql-example-data.js @@ -13,13 +13,13 @@ import { lowerCase, } from './utils' -const QUERY_NAME_STATEGY_NONE = 'none' -const QUERY_NAME_STATEGY_CAPITALIZE_FIRST = 'capitalizeFirst' -const QUERY_NAME_STATEGY_CAPITALIZE = 'capitalize' -const QUERY_NAME_STATEGY_CAMELCASE = 'camelCase' -const QUERY_NAME_STATEGY_SNAKECASE = 'snakeCase' -const QUERY_NAME_STATEGY_UPPERCASE = 'upperCase' -const QUERY_NAME_STATEGY_LOWERCASE = 'lowerCase' +const QUERY_NAME_STRATEGY_NONE = 'none' +const QUERY_NAME_STRATEGY_CAPITALIZE_FIRST = 'capitalizeFirst' +const QUERY_NAME_STRATEGY_CAPITALIZE = 'capitalize' +const QUERY_NAME_STRATEGY_CAMELCASE = 'camelCase' +const QUERY_NAME_STRATEGY_SNAKECASE = 'snakeCase' +const QUERY_NAME_STRATEGY_UPPERCASE = 'upperCase' +const QUERY_NAME_STRATEGY_LOWERCASE = 'lowerCase' // Create a sane/friendly indentation of args based on how many there are, and the depth function friendlyArgsString({ args, depth }) { @@ -76,19 +76,19 @@ export function generateQuery({ const cleanedQuery = queryResult.query.replace(/ : [\w![\]]+/g, '') let queryName = field.name - if (!queryNameStrategy || queryNameStrategy === QUERY_NAME_STATEGY_NONE) { + if (!queryNameStrategy || queryNameStrategy === QUERY_NAME_STRATEGY_NONE) { // no op - } else if (queryNameStrategy === QUERY_NAME_STATEGY_CAPITALIZE_FIRST) { + } else if (queryNameStrategy === QUERY_NAME_STRATEGY_CAPITALIZE_FIRST) { queryName = capitalizeFirstLetter(queryName) - } else if (queryNameStrategy === QUERY_NAME_STATEGY_CAPITALIZE) { + } else if (queryNameStrategy === QUERY_NAME_STRATEGY_CAPITALIZE) { queryName = capitalize(queryName) - } else if (queryNameStrategy === QUERY_NAME_STATEGY_CAMELCASE) { + } else if (queryNameStrategy === QUERY_NAME_STRATEGY_CAMELCASE) { queryName = camelCase(queryName) - } else if (queryNameStrategy === QUERY_NAME_STATEGY_SNAKECASE) { + } else if (queryNameStrategy === QUERY_NAME_STRATEGY_SNAKECASE) { queryName = snakeCase(queryName) - } else if (queryNameStrategy === QUERY_NAME_STATEGY_UPPERCASE) { + } else if (queryNameStrategy === QUERY_NAME_STRATEGY_UPPERCASE) { queryName = upperCase(queryName) - } else if (queryNameStrategy === QUERY_NAME_STATEGY_LOWERCASE) { + } else if (queryNameStrategy === QUERY_NAME_STRATEGY_LOWERCASE) { queryName = lowerCase(queryName) } @@ -115,7 +115,7 @@ export function generateQuery({ } return { - query, // The Query/Mutation sring/markdown + query, // The Query/Mutation string/markdown variables, // The Variables response, // The Response } diff --git a/src/spectaql/index.js b/src/spectaql/index.js index 1009dd03..f517ac4e 100644 --- a/src/spectaql/index.js +++ b/src/spectaql/index.js @@ -87,7 +87,7 @@ async function run(opts) { ] if (!customDataArrangerSuffixThatExists.endsWith('.mjs')) { messages.push( - 'You can try renaming your file with an "mjs" extension, or seting "type"="module" in your package.json' + 'You can try renaming your file with an "mjs" extension, or setting "type"="module" in your package.json' ) } else { messages.push('Try setting "type"="module" in your package.json') diff --git a/src/themes/default/helpers/indefiniteArticle.js b/src/themes/default/helpers/indefiniteArticle.js index c9291c95..12102f9e 100644 --- a/src/themes/default/helpers/indefiniteArticle.js +++ b/src/themes/default/helpers/indefiniteArticle.js @@ -9,19 +9,19 @@ module.exports = function (phrase, _options) { else return 'an' var l_word = word.toLowerCase() - // Specific start of words that should be preceeded by 'an' + // Specific start of words that should be preceded by 'an' var alt_cases = ['honest', 'hour', 'hono'] for (var i in alt_cases) { if (l_word.indexOf(alt_cases[i]) == 0) return 'an' } - // Single letter word which should be preceeded by 'an' + // Single letter word which should be preceded by 'an' if (l_word.length == 1) { if ('aedhilmnorsx'.indexOf(l_word) >= 0) return 'an' else return 'a' } - // Capital words which should likely be preceeded by 'an' + // Capital words which should likely be preceded by 'an' if ( word.match( /(?!FJO|[HLMNS]Y.|RY[EO]|SQU|(F[LR]?|[HL]|MN?|N|RH?|S[CHKLMNPTVW]?|X(YL)?)[AEIOU])[FHLMNRSX][A-Z]/ @@ -30,7 +30,7 @@ module.exports = function (phrase, _options) { return 'an' } - // Special cases where a word that begins with a vowel should be preceeded by 'a' + // Special cases where a word that begins with a vowel should be preceded by 'a' const regexes = [ /^e[uw]/, /^onc?e\b/, @@ -49,10 +49,10 @@ module.exports = function (phrase, _options) { else return 'a' } - // Basic method of words that begin with a vowel being preceeded by 'an' + // Basic method of words that begin with a vowel being preceded by 'an' if ('aeiou'.indexOf(l_word[0]) >= 0) return 'an' - // Instances where y follwed by specific letters is preceeded by 'an' + // Instances where y followed by specific letters is preceded by 'an' if (l_word.match(/^y(b[lor]|cl[ea]|fere|gg|p[ios]|rou|tt)/)) return 'an' return 'a' diff --git a/src/themes/default/helpers/md.js b/src/themes/default/helpers/md.js index 6e55c61e..61b359f5 100644 --- a/src/themes/default/helpers/md.js +++ b/src/themes/default/helpers/md.js @@ -6,7 +6,7 @@ import { markdown } from '../../../lib/common' * @param {string} `value` the markdown-formatted text * @param {boolean} `options.hash.stripParagraph` the marked-md-renderer wraps generated HTML in a

-tag by default. * If this options is set to true, the

-tag is stripped. - * @returns {Handlebars.SafeString} a Handlebars-SafeString containing the provieded + * @returns {Handlebars.SafeString} a Handlebars-SafeString containing the provided * markdown, rendered as HTML. */ module.exports = function (value, options) { diff --git a/src/themes/default/stylesheets/custom.scss b/src/themes/default/stylesheets/custom.scss index 6b5ffbb3..c4185e28 100644 --- a/src/themes/default/stylesheets/custom.scss +++ b/src/themes/default/stylesheets/custom.scss @@ -1,6 +1,6 @@ // The default theme will put nothing in here, but it will be imported in // "main.scss", allowing users to specify it in their custom theme to adjust the -// deafult theme without losing updates to the "core" SCSS. +// default theme without losing updates to the "core" SCSS. // You can override variables and styles in your custom.scss file. All support // variables are shown below. diff --git a/test/src/spectaql/augmenters.test.js b/test/src/spectaql/augmenters.test.js index d489df92..b4f70b8e 100644 --- a/test/src/spectaql/augmenters.test.js +++ b/test/src/spectaql/augmenters.test.js @@ -1020,7 +1020,7 @@ describe('augmenters', function () { .to.be.an('object') .that.does.have.any.keys('example') - // No top-level examples, even if ther was something in the metadata for them + // No top-level examples, even if there was something in the metadata for them expect($.introspectionManipulator.getType({ name: 'Query' })) .to.be.an('object') .that.does.not.have.any.keys('example')