Skip to content

Commit 45efe60

Browse files
committed
Apply consistent spacing and use of single quotes
1 parent 35c001d commit 45efe60

18 files changed

+94
-114
lines changed

dist/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15438,7 +15438,7 @@ class ConfigParser {
1543815438
throw 'Could not find a configuration object in the configuration file'
1543915439
}
1544015440

15441-
// A property may be nested in the configuration file. Split the property name with `.`
15441+
// A property may be nested in the configuration file. Split the property name with '.'
1544215442
// then walk the configuration object one property at a time.
1544315443
var depth = 0
1544415444
const properties = propertyName.split('.')
@@ -15519,7 +15519,7 @@ class ConfigParser {
1551915519
}
1552015520

1552115521
// Logging
15522-
core.info(`Injection successful, new configuration:`)
15522+
core.info('Injection successful, new configuration:')
1552315523
core.info(this.configuration)
1552415524

1552515525
// Finally write the new configuration in the file
@@ -15609,7 +15609,7 @@ const removeTrailingSlash = __nccwpck_require__(9255)
1560915609
// Return the settings to be passed to a {ConfigParser} for a given static site generator,
1561015610
// optional configuration file path, and a Pages siteUrl value to inject
1561115611
function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
15612-
let { pathname, origin } = siteUrl
15612+
let { pathname: path, origin } = siteUrl
1561315613

1561415614
switch (staticSiteGenerator) {
1561515615
case 'nuxt':
@@ -15618,7 +15618,7 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
1561815618
blankConfigurationFile: __nccwpck_require__.ab + "nuxt.js",
1561915619
properties: {
1562015620
// Configure a base path on the router
15621-
'router.base': pathname,
15621+
'router.base': path,
1562215622

1562315623
// Set the target to static too
1562415624
// https://nuxtjs.org/docs/configuration-glossary/configuration-target/
@@ -15627,14 +15627,14 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
1562715627
}
1562815628
case 'next':
1562915629
// Next does not want a trailing slash
15630-
pathname = removeTrailingSlash(pathname)
15630+
path = removeTrailingSlash(path)
1563115631

1563215632
return {
1563315633
configurationFile: generatorConfigFile || './next.config.js',
1563415634
blankConfigurationFile: __nccwpck_require__.ab + "next.js",
1563515635
properties: {
1563615636
// Configure a base path
15637-
basePath: pathname,
15637+
basePath: path,
1563815638

1563915639
// Disable server side image optimization too
1564015640
// https://nextjs.org/docs/api-reference/next/image#unoptimized
@@ -15647,21 +15647,21 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
1564715647
blankConfigurationFile: __nccwpck_require__.ab + "gatsby.js",
1564815648
properties: {
1564915649
// Configure a path prefix
15650-
pathPrefix: pathname,
15650+
pathPrefix: path,
1565115651
// Configure a site url
1565215652
'siteMetadata.siteUrl': origin
1565315653
}
1565415654
}
1565515655
case 'sveltekit':
1565615656
// SvelteKit does not want a trailing slash
15657-
pathname = removeTrailingSlash(pathname)
15657+
path = removeTrailingSlash(path)
1565815658

1565915659
return {
1566015660
configurationFile: generatorConfigFile || './svelte.config.js',
1566115661
blankConfigurationFile: __nccwpck_require__.ab + "sveltekit.js",
1566215662
properties: {
1566315663
// Configure a base path
15664-
'kit.paths.base': pathname,
15664+
'kit.paths.base': path,
1566515665
// Configure a prerender origin
1566615666
'kit.prerender.origin': origin
1566715667
}

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class ConfigParser {
184184
throw 'Could not find a configuration object in the configuration file'
185185
}
186186

187-
// A property may be nested in the configuration file. Split the property name with `.`
187+
// A property may be nested in the configuration file. Split the property name with '.'
188188
// then walk the configuration object one property at a time.
189189
var depth = 0
190190
const properties = propertyName.split('.')
@@ -265,7 +265,7 @@ class ConfigParser {
265265
}
266266

267267
// Logging
268-
core.info(`Injection successful, new configuration:`)
268+
core.info('Injection successful, new configuration:')
269269
core.info(this.configuration)
270270

271271
// Finally write the new configuration in the file

src/config-parser.test.js

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,146 +14,146 @@ const cases = [
1414
//
1515
{
1616
property: 'property',
17-
source: `export default {}`,
18-
expected: `export default { property: "value" }`
17+
source: 'export default {}',
18+
expected: 'export default { property: "value" }'
1919
},
2020
{
2121
property: 'property',
22-
source: `export default { property: 0 }`, // property exists and is a number
23-
expected: `export default { property: "value" }`
22+
source: 'export default { property: 0 }', // property exists and is a number
23+
expected: 'export default { property: "value" }'
2424
},
2525
{
2626
property: 'property',
27-
source: `export default { property: false }`, // property exists and is a boolean
28-
expected: `export default { property: "value" }`
27+
source: 'export default { property: false }', // property exists and is a boolean
28+
expected: 'export default { property: "value" }'
2929
},
3030
{
3131
property: 'property',
32-
source: `export default { property: "test" }`, // property exists and is a string
33-
expected: `export default { property: "value" }`
32+
source: 'export default { property: "test" }', // property exists and is a string
33+
expected: 'export default { property: "value" }'
3434
},
3535
{
3636
property: 'property',
37-
source: `export default { property: [1,2] }`, // property exists and is an array
38-
expected: `export default { property: "value" }`
37+
source: 'export default { property: [1,2] }', // property exists and is an array
38+
expected: 'export default { property: "value" }'
3939
},
4040
{
4141
property: 'property',
42-
source: `export default { property: null }`, // property exists and is null
43-
expected: `export default { property: "value" }`
42+
source: 'export default { property: null }', // property exists and is null
43+
expected: 'export default { property: "value" }'
4444
},
4545
{
4646
property: 'property',
47-
source: `export default { property: {}}`, // property exists and is an object
48-
expected: `export default { property: "value" }`
47+
source: 'export default { property: { } }', // property exists and is an object
48+
expected: 'export default { property: "value" }'
4949
},
5050

5151
// Deep properties (injection 1)
5252
{
5353
property: 'property.b.c',
54-
source: `export default {}`,
55-
expected: `export default { property: { b: { c: "value" }}}`
54+
source: 'export default {}',
55+
expected: 'export default { property: { b: { c: "value" } } }'
5656
},
5757
{
5858
property: 'property.b.c',
59-
source: `export default { property: 0 }`, // property exists and is a number
60-
expected: `export default { property: { b: { c: "value" }}}`
59+
source: 'export default { property: 0 }', // property exists and is a number
60+
expected: 'export default { property: { b: { c: "value" } } }'
6161
},
6262
{
6363
property: 'property.b.c',
64-
source: `export default { property: {}}`, // property exists and is an object
65-
expected: `export default { property: { b: { c: "value" }}}`
64+
source: 'export default { property: { } }', // property exists and is an object
65+
expected: 'export default { property: { b: { c: "value" } } }'
6666
},
6767

6868
// Deep properties (injection 2)
6969
{
7070
property: 'property.b.c',
71-
source: `export default { property: { b: 0 }}`, // property exists and is a number
72-
expected: `export default { property: { b: { c: "value" }}}`
71+
source: 'export default { property: { b: 0 } }', // property exists and is a number
72+
expected: 'export default { property: { b: { c: "value" } } }'
7373
},
7474
{
7575
property: 'property.b.c',
76-
source: `export default { property: { b: {}}}`, // property exists and is an object
77-
expected: `export default { property: { b: { c: "value" }}}`
76+
source: 'export default { property: { b: { } } }', // property exists and is an object
77+
expected: 'export default { property: { b: { c: "value" } } }'
7878
},
7979
{
8080
property: 'property.b.c',
81-
source: `export default { property: { b: { hello: 123}}}`, // property exists and is a non-empty object
82-
expected: `export default { property: { b: { c: "value", hello: 123 }}}`
81+
source: 'export default { property: { b: { hello: 123 } } }', // property exists and is a non-empty object
82+
expected: 'export default { property: { b: { c: "value", hello: 123 } } }'
8383
},
8484

8585
// Deep properties (existing properties)
8686
{
8787
property: 'a1.a2',
88-
source: `export default { a2: false, a1: { a3: [12]}}`, // property exists and is a non-empty object
89-
expected: `export default { a2: false, a1: { a2: "value", a3: [12]}}`
88+
source: 'export default { a2: false, a1: { a3: [12] } }', // property exists and is a non-empty object
89+
expected: 'export default { a2: false, a1: { a2: "value", a3: [12] } }'
9090
},
9191

9292
//
9393
// Indirect default export
9494
//
9595
{
9696
property: 'property',
97-
source: `const config = {}; export default config`,
98-
expected: `const config = { property: "value"}; export default config`
97+
source: 'const config = {}; export default config',
98+
expected: 'const config = { property: "value"}; export default config'
9999
},
100100
{
101101
property: 'property',
102-
source: `var config = {}; export default config`,
103-
expected: `var config = { property: "value"}; export default config`
102+
source: 'var config = {}; export default config',
103+
expected: 'var config = { property: "value"}; export default config'
104104
},
105105
{
106106
property: 'a.b.c',
107-
source: `var config = {}; export default config`,
108-
expected: `var config = { a: { b: { c: "value"}}}; export default config`
107+
source: 'var config = {}; export default config',
108+
expected: 'var config = { a: { b: { c: "value" } } }; export default config'
109109
},
110110
{
111111
property: 'a.b.c',
112-
source: `var config = { a: { b: [], c: "hello"}}; export default config`,
113-
expected: `var config = { a: { b: { c: "value"}, c: "hello"}}; export default config`
112+
source: 'var config = { a: { b: [], c: "hello" } }; export default config',
113+
expected: 'var config = { a: { b: { c: "value"}, c: "hello" } }; export default config'
114114
},
115115

116116
//
117117
// Direct module exports
118118
//
119119
{
120120
property: 'property',
121-
source: `module.exports = {}`,
122-
expected: `module.exports = { property: "value"}`
121+
source: 'module.exports = {}',
122+
expected: 'module.exports = { property: "value"}'
123123
},
124124
{
125125
property: 'property',
126-
source: `module.exports = { p1: 0}`,
127-
expected: `module.exports = { property: "value", p1: 0}`
126+
source: 'module.exports = { p1: 0}',
127+
expected: 'module.exports = { property: "value", p1: 0}'
128128
},
129129
{
130130
property: 'a.b.c',
131-
source: `module.exports = { p1: 0}`,
132-
expected: `module.exports = { a: { b: { c: "value" }}, p1: 0}`
131+
source: 'module.exports = { p1: 0}',
132+
expected: 'module.exports = { a: { b: { c: "value" } }, p1: 0}'
133133
},
134134

135135
//
136136
// Indirect module exports
137137
//
138138
{
139139
property: 'property',
140-
source: `const config = {}; module.exports = config`,
141-
expected: `const config = { property: "value"}; module.exports = config`
140+
source: 'const config = {}; module.exports = config',
141+
expected: 'const config = { property: "value"}; module.exports = config'
142142
},
143143
{
144144
property: 'property',
145-
source: `var config = {}; module.exports = config`,
146-
expected: `var config = { property: "value"}; module.exports = config`
145+
source: 'var config = {}; module.exports = config',
146+
expected: 'var config = { property: "value"}; module.exports = config'
147147
},
148148
{
149149
property: 'a.b.c',
150-
source: `var config = {}; module.exports = config`,
151-
expected: `var config = { a: { b: { c: "value"}}}; module.exports = config`
150+
source: 'var config = {}; module.exports = config',
151+
expected: 'var config = { a: { b: { c: "value" } } }; module.exports = config'
152152
},
153153
{
154154
property: 'a.b.c',
155-
source: `var config = { a: { b: [], c: "hello"}}; module.exports = config`,
156-
expected: `var config = { a: { b: { c: "value"}, c: "hello"}}; module.exports = config`
155+
source: 'var config = { a: { b: [], c: "hello" } }; module.exports = config',
156+
expected: 'var config = { a: { b: { c: "value"}, c: "hello" } }; module.exports = config'
157157
}
158158
]
159159

src/fixtures/gatsby/default.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
siteMetadata: {
3-
title: `My Gatsby Site`
3+
title: 'My Gatsby Site'
44
},
55
plugins: []
66
}

src/fixtures/gatsby/default.expected.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
pathPrefix: '/docs/',
33
siteMetadata: {
44
siteUrl: 'https://configure-pages.github.io',
5-
title: `My Gatsby Site`
5+
title: 'My Gatsby Site'
66
},
77
plugins: []
88
}

src/fixtures/gatsby/default.expected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
pathPrefix: '/docs/',
33
siteMetadata: {
44
siteUrl: 'https://configure-pages.github.io',
5-
title: `My Gatsby Site`
5+
title: 'My Gatsby Site'
66
},
77
plugins: []
88
}

src/fixtures/gatsby/default.expected.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
pathPrefix: '/docs/',
33
siteMetadata: {
44
siteUrl: 'https://configure-pages.github.io',
5-
title: `My Gatsby Site`
5+
title: 'My Gatsby Site'
66
},
77
plugins: []
88
}

src/fixtures/gatsby/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
siteMetadata: {
3-
title: `My Gatsby Site`
3+
title: 'My Gatsby Site'
44
},
55
plugins: []
66
}

src/fixtures/gatsby/default.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
siteMetadata: {
3-
title: `My Gatsby Site`
3+
title: 'My Gatsby Site'
44
},
55
plugins: []
66
}

0 commit comments

Comments
 (0)