Apply consistent spacing and use of single quotes

This commit is contained in:
James M. Greene
2022-09-11 10:18:04 -05:00
parent 35c001ded6
commit 45efe60937
18 changed files with 94 additions and 114 deletions

18
dist/index.js vendored
View File

@@ -15438,7 +15438,7 @@ class ConfigParser {
throw 'Could not find a configuration object in the configuration file' throw 'Could not find a configuration object in the configuration file'
} }
// A property may be nested in the configuration file. Split the property name with `.` // A property may be nested in the configuration file. Split the property name with '.'
// then walk the configuration object one property at a time. // then walk the configuration object one property at a time.
var depth = 0 var depth = 0
const properties = propertyName.split('.') const properties = propertyName.split('.')
@@ -15519,7 +15519,7 @@ class ConfigParser {
} }
// Logging // Logging
core.info(`Injection successful, new configuration:`) core.info('Injection successful, new configuration:')
core.info(this.configuration) core.info(this.configuration)
// Finally write the new configuration in the file // Finally write the new configuration in the file
@@ -15609,7 +15609,7 @@ const removeTrailingSlash = __nccwpck_require__(9255)
// Return the settings to be passed to a {ConfigParser} for a given static site generator, // Return the settings to be passed to a {ConfigParser} for a given static site generator,
// optional configuration file path, and a Pages siteUrl value to inject // optional configuration file path, and a Pages siteUrl value to inject
function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl }) { function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
let { pathname, origin } = siteUrl let { pathname: path, origin } = siteUrl
switch (staticSiteGenerator) { switch (staticSiteGenerator) {
case 'nuxt': case 'nuxt':
@@ -15618,7 +15618,7 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
blankConfigurationFile: __nccwpck_require__.ab + "nuxt.js", blankConfigurationFile: __nccwpck_require__.ab + "nuxt.js",
properties: { properties: {
// Configure a base path on the router // Configure a base path on the router
'router.base': pathname, 'router.base': path,
// Set the target to static too // Set the target to static too
// https://nuxtjs.org/docs/configuration-glossary/configuration-target/ // https://nuxtjs.org/docs/configuration-glossary/configuration-target/
@@ -15627,14 +15627,14 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
} }
case 'next': case 'next':
// Next does not want a trailing slash // Next does not want a trailing slash
pathname = removeTrailingSlash(pathname) path = removeTrailingSlash(path)
return { return {
configurationFile: generatorConfigFile || './next.config.js', configurationFile: generatorConfigFile || './next.config.js',
blankConfigurationFile: __nccwpck_require__.ab + "next.js", blankConfigurationFile: __nccwpck_require__.ab + "next.js",
properties: { properties: {
// Configure a base path // Configure a base path
basePath: pathname, basePath: path,
// Disable server side image optimization too // Disable server side image optimization too
// https://nextjs.org/docs/api-reference/next/image#unoptimized // https://nextjs.org/docs/api-reference/next/image#unoptimized
@@ -15647,21 +15647,21 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
blankConfigurationFile: __nccwpck_require__.ab + "gatsby.js", blankConfigurationFile: __nccwpck_require__.ab + "gatsby.js",
properties: { properties: {
// Configure a path prefix // Configure a path prefix
pathPrefix: pathname, pathPrefix: path,
// Configure a site url // Configure a site url
'siteMetadata.siteUrl': origin 'siteMetadata.siteUrl': origin
} }
} }
case 'sveltekit': case 'sveltekit':
// SvelteKit does not want a trailing slash // SvelteKit does not want a trailing slash
pathname = removeTrailingSlash(pathname) path = removeTrailingSlash(path)
return { return {
configurationFile: generatorConfigFile || './svelte.config.js', configurationFile: generatorConfigFile || './svelte.config.js',
blankConfigurationFile: __nccwpck_require__.ab + "sveltekit.js", blankConfigurationFile: __nccwpck_require__.ab + "sveltekit.js",
properties: { properties: {
// Configure a base path // Configure a base path
'kit.paths.base': pathname, 'kit.paths.base': path,
// Configure a prerender origin // Configure a prerender origin
'kit.prerender.origin': origin 'kit.prerender.origin': origin
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -184,7 +184,7 @@ class ConfigParser {
throw 'Could not find a configuration object in the configuration file' throw 'Could not find a configuration object in the configuration file'
} }
// A property may be nested in the configuration file. Split the property name with `.` // A property may be nested in the configuration file. Split the property name with '.'
// then walk the configuration object one property at a time. // then walk the configuration object one property at a time.
var depth = 0 var depth = 0
const properties = propertyName.split('.') const properties = propertyName.split('.')
@@ -265,7 +265,7 @@ class ConfigParser {
} }
// Logging // Logging
core.info(`Injection successful, new configuration:`) core.info('Injection successful, new configuration:')
core.info(this.configuration) core.info(this.configuration)
// Finally write the new configuration in the file // Finally write the new configuration in the file

View File

@@ -14,79 +14,79 @@ const cases = [
// //
{ {
property: 'property', property: 'property',
source: `export default {}`, source: 'export default {}',
expected: `export default { property: "value" }` expected: 'export default { property: "value" }'
}, },
{ {
property: 'property', property: 'property',
source: `export default { property: 0 }`, // property exists and is a number source: 'export default { property: 0 }', // property exists and is a number
expected: `export default { property: "value" }` expected: 'export default { property: "value" }'
}, },
{ {
property: 'property', property: 'property',
source: `export default { property: false }`, // property exists and is a boolean source: 'export default { property: false }', // property exists and is a boolean
expected: `export default { property: "value" }` expected: 'export default { property: "value" }'
}, },
{ {
property: 'property', property: 'property',
source: `export default { property: "test" }`, // property exists and is a string source: 'export default { property: "test" }', // property exists and is a string
expected: `export default { property: "value" }` expected: 'export default { property: "value" }'
}, },
{ {
property: 'property', property: 'property',
source: `export default { property: [1,2] }`, // property exists and is an array source: 'export default { property: [1,2] }', // property exists and is an array
expected: `export default { property: "value" }` expected: 'export default { property: "value" }'
}, },
{ {
property: 'property', property: 'property',
source: `export default { property: null }`, // property exists and is null source: 'export default { property: null }', // property exists and is null
expected: `export default { property: "value" }` expected: 'export default { property: "value" }'
}, },
{ {
property: 'property', property: 'property',
source: `export default { property: {}}`, // property exists and is an object source: 'export default { property: { } }', // property exists and is an object
expected: `export default { property: "value" }` expected: 'export default { property: "value" }'
}, },
// Deep properties (injection 1) // Deep properties (injection 1)
{ {
property: 'property.b.c', property: 'property.b.c',
source: `export default {}`, source: 'export default {}',
expected: `export default { property: { b: { c: "value" }}}` expected: 'export default { property: { b: { c: "value" } } }'
}, },
{ {
property: 'property.b.c', property: 'property.b.c',
source: `export default { property: 0 }`, // property exists and is a number source: 'export default { property: 0 }', // property exists and is a number
expected: `export default { property: { b: { c: "value" }}}` expected: 'export default { property: { b: { c: "value" } } }'
}, },
{ {
property: 'property.b.c', property: 'property.b.c',
source: `export default { property: {}}`, // property exists and is an object source: 'export default { property: { } }', // property exists and is an object
expected: `export default { property: { b: { c: "value" }}}` expected: 'export default { property: { b: { c: "value" } } }'
}, },
// Deep properties (injection 2) // Deep properties (injection 2)
{ {
property: 'property.b.c', property: 'property.b.c',
source: `export default { property: { b: 0 }}`, // property exists and is a number source: 'export default { property: { b: 0 } }', // property exists and is a number
expected: `export default { property: { b: { c: "value" }}}` expected: 'export default { property: { b: { c: "value" } } }'
}, },
{ {
property: 'property.b.c', property: 'property.b.c',
source: `export default { property: { b: {}}}`, // property exists and is an object source: 'export default { property: { b: { } } }', // property exists and is an object
expected: `export default { property: { b: { c: "value" }}}` expected: 'export default { property: { b: { c: "value" } } }'
}, },
{ {
property: 'property.b.c', property: 'property.b.c',
source: `export default { property: { b: { hello: 123}}}`, // property exists and is a non-empty object source: 'export default { property: { b: { hello: 123 } } }', // property exists and is a non-empty object
expected: `export default { property: { b: { c: "value", hello: 123 }}}` expected: 'export default { property: { b: { c: "value", hello: 123 } } }'
}, },
// Deep properties (existing properties) // Deep properties (existing properties)
{ {
property: 'a1.a2', property: 'a1.a2',
source: `export default { a2: false, a1: { a3: [12]}}`, // property exists and is a non-empty object source: 'export default { a2: false, a1: { a3: [12] } }', // property exists and is a non-empty object
expected: `export default { a2: false, a1: { a2: "value", a3: [12]}}` expected: 'export default { a2: false, a1: { a2: "value", a3: [12] } }'
}, },
// //
@@ -94,23 +94,23 @@ const cases = [
// //
{ {
property: 'property', property: 'property',
source: `const config = {}; export default config`, source: 'const config = {}; export default config',
expected: `const config = { property: "value"}; export default config` expected: 'const config = { property: "value"}; export default config'
}, },
{ {
property: 'property', property: 'property',
source: `var config = {}; export default config`, source: 'var config = {}; export default config',
expected: `var config = { property: "value"}; export default config` expected: 'var config = { property: "value"}; export default config'
}, },
{ {
property: 'a.b.c', property: 'a.b.c',
source: `var config = {}; export default config`, source: 'var config = {}; export default config',
expected: `var config = { a: { b: { c: "value"}}}; export default config` expected: 'var config = { a: { b: { c: "value" } } }; export default config'
}, },
{ {
property: 'a.b.c', property: 'a.b.c',
source: `var config = { a: { b: [], c: "hello"}}; export default config`, source: 'var config = { a: { b: [], c: "hello" } }; export default config',
expected: `var config = { a: { b: { c: "value"}, c: "hello"}}; export default config` expected: 'var config = { a: { b: { c: "value"}, c: "hello" } }; export default config'
}, },
// //
@@ -118,18 +118,18 @@ const cases = [
// //
{ {
property: 'property', property: 'property',
source: `module.exports = {}`, source: 'module.exports = {}',
expected: `module.exports = { property: "value"}` expected: 'module.exports = { property: "value"}'
}, },
{ {
property: 'property', property: 'property',
source: `module.exports = { p1: 0}`, source: 'module.exports = { p1: 0}',
expected: `module.exports = { property: "value", p1: 0}` expected: 'module.exports = { property: "value", p1: 0}'
}, },
{ {
property: 'a.b.c', property: 'a.b.c',
source: `module.exports = { p1: 0}`, source: 'module.exports = { p1: 0}',
expected: `module.exports = { a: { b: { c: "value" }}, p1: 0}` expected: 'module.exports = { a: { b: { c: "value" } }, p1: 0}'
}, },
// //
@@ -137,23 +137,23 @@ const cases = [
// //
{ {
property: 'property', property: 'property',
source: `const config = {}; module.exports = config`, source: 'const config = {}; module.exports = config',
expected: `const config = { property: "value"}; module.exports = config` expected: 'const config = { property: "value"}; module.exports = config'
}, },
{ {
property: 'property', property: 'property',
source: `var config = {}; module.exports = config`, source: 'var config = {}; module.exports = config',
expected: `var config = { property: "value"}; module.exports = config` expected: 'var config = { property: "value"}; module.exports = config'
}, },
{ {
property: 'a.b.c', property: 'a.b.c',
source: `var config = {}; module.exports = config`, source: 'var config = {}; module.exports = config',
expected: `var config = { a: { b: { c: "value"}}}; module.exports = config` expected: 'var config = { a: { b: { c: "value" } } }; module.exports = config'
}, },
{ {
property: 'a.b.c', property: 'a.b.c',
source: `var config = { a: { b: [], c: "hello"}}; module.exports = config`, source: 'var config = { a: { b: [], c: "hello" } }; module.exports = config',
expected: `var config = { a: { b: { c: "value"}, c: "hello"}}; module.exports = config` expected: 'var config = { a: { b: { c: "value"}, c: "hello" } }; module.exports = config'
} }
] ]

View File

@@ -1,6 +1,6 @@
module.exports = { module.exports = {
siteMetadata: { siteMetadata: {
title: `My Gatsby Site` title: 'My Gatsby Site'
}, },
plugins: [] plugins: []
} }

View File

@@ -2,7 +2,7 @@ module.exports = {
pathPrefix: '/docs/', pathPrefix: '/docs/',
siteMetadata: { siteMetadata: {
siteUrl: 'https://configure-pages.github.io', siteUrl: 'https://configure-pages.github.io',
title: `My Gatsby Site` title: 'My Gatsby Site'
}, },
plugins: [] plugins: []
} }

View File

@@ -2,7 +2,7 @@ module.exports = {
pathPrefix: '/docs/', pathPrefix: '/docs/',
siteMetadata: { siteMetadata: {
siteUrl: 'https://configure-pages.github.io', siteUrl: 'https://configure-pages.github.io',
title: `My Gatsby Site` title: 'My Gatsby Site'
}, },
plugins: [] plugins: []
} }

View File

@@ -2,7 +2,7 @@ export default {
pathPrefix: '/docs/', pathPrefix: '/docs/',
siteMetadata: { siteMetadata: {
siteUrl: 'https://configure-pages.github.io', siteUrl: 'https://configure-pages.github.io',
title: `My Gatsby Site` title: 'My Gatsby Site'
}, },
plugins: [] plugins: []
} }

View File

@@ -1,6 +1,6 @@
module.exports = { module.exports = {
siteMetadata: { siteMetadata: {
title: `My Gatsby Site` title: 'My Gatsby Site'
}, },
plugins: [] plugins: []
} }

View File

@@ -1,6 +1,6 @@
export default { export default {
siteMetadata: { siteMetadata: {
title: `My Gatsby Site` title: 'My Gatsby Site'
}, },
plugins: [] plugins: []
} }

View File

@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
experimental: {images: {unoptimized: true}}, experimental: { images: { unoptimized: true } },
basePath: '/docs', basePath: '/docs',
reactStrictMode: true, reactStrictMode: true,
swcMinify: true swcMinify: true

View File

@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
experimental: {images: {unoptimized: true}}, experimental: { images: { unoptimized: true } },
basePath: '/docs', basePath: '/docs',
reactStrictMode: true, reactStrictMode: true,
swcMinify: true swcMinify: true

View File

@@ -7,7 +7,7 @@ const getAllDynamicRoute = async function() {
module.exports = { module.exports = {
target: 'static', target: 'static',
router: {base: '/docs/'}, router: { base: '/docs/' },
mode: 'universal', mode: 'universal',
generate: { generate: {
async routes () { async routes () {

View File

@@ -7,7 +7,7 @@ const getAllDynamicRoute = async function() {
export default { export default {
target: 'static', target: 'static',
router: {base: '/docs/'}, router: { base: '/docs/' },
mode: 'universal', mode: 'universal',
generate: { generate: {
async routes () { async routes () {

View File

@@ -20,25 +20,20 @@ module.exports = {
}, },
// Global CSS: https://go.nuxtjs.dev/config-css // Global CSS: https://go.nuxtjs.dev/config-css
css: [ css: [],
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [ plugins: [],
],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
components: true, components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [ buildModules: [],
],
// Modules: https://go.nuxtjs.dev/config-modules // Modules: https://go.nuxtjs.dev/config-modules
modules: [ modules: [],
],
// Build Configuration: https://go.nuxtjs.dev/config-build // Build Configuration: https://go.nuxtjs.dev/config-build
build: { build: {}
}
} }

View File

@@ -1,7 +1,7 @@
module.exports = { module.exports = {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
target: 'static', target: 'static',
router: { base: "/docs/" }, router: { base: '/docs/' },
ssr: false, ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head // Global page headers: https://go.nuxtjs.dev/config-head
@@ -22,25 +22,20 @@ module.exports = {
}, },
// Global CSS: https://go.nuxtjs.dev/config-css // Global CSS: https://go.nuxtjs.dev/config-css
css: [ css: [],
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [ plugins: [],
],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
components: true, components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [ buildModules: [],
],
// Modules: https://go.nuxtjs.dev/config-modules // Modules: https://go.nuxtjs.dev/config-modules
modules: [ modules: [],
],
// Build Configuration: https://go.nuxtjs.dev/config-build // Build Configuration: https://go.nuxtjs.dev/config-build
build: { build: {}
}
} }

View File

@@ -1,7 +1,7 @@
export default { export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
target: 'static', target: 'static',
router: { base: "/docs/" }, router: { base: '/docs/' },
ssr: false, ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head // Global page headers: https://go.nuxtjs.dev/config-head
@@ -22,25 +22,20 @@ export default {
}, },
// Global CSS: https://go.nuxtjs.dev/config-css // Global CSS: https://go.nuxtjs.dev/config-css
css: [ css: [],
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [ plugins: [],
],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
components: true, components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [ buildModules: [],
],
// Modules: https://go.nuxtjs.dev/config-modules // Modules: https://go.nuxtjs.dev/config-modules
modules: [ modules: [],
],
// Build Configuration: https://go.nuxtjs.dev/config-build // Build Configuration: https://go.nuxtjs.dev/config-build
build: { build: {}
}
} }

View File

@@ -20,25 +20,20 @@ export default {
}, },
// Global CSS: https://go.nuxtjs.dev/config-css // Global CSS: https://go.nuxtjs.dev/config-css
css: [ css: [],
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [ plugins: [],
],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
components: true, components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [ buildModules: [],
],
// Modules: https://go.nuxtjs.dev/config-modules // Modules: https://go.nuxtjs.dev/config-modules
modules: [ modules: [],
],
// Build Configuration: https://go.nuxtjs.dev/config-build // Build Configuration: https://go.nuxtjs.dev/config-build
build: { build: {}
}
} }