Skip to content

Commit 0ffea17

Browse files
Cosmetic changes for mobify name and docs urls (#269)
* Cosmetic changes for mobify name and docs urls * Update packages/pwa-kit-react-sdk/scripts/upload.js Reverting back to cloud.mobify.com, based on comment from @kevinxh * fix url * reformat files * fix tests Co-authored-by: Kevin He <kevin.he@salesforce.com>
1 parent c858ed2 commit 0ffea17

File tree

9 files changed

+28
-30
lines changed

9 files changed

+28
-30
lines changed

packages/pwa-kit-create-app/scripts/create-mobify-app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
/**
10-
* This is a generator for projects that run on the Managed Rutime.
10+
* This is a generator for PWA Kit projects that run on the Managed Runtime.
1111
*
1212
* The output of this script is a copy of the pwa package with the following changes:
1313
*

packages/pwa-kit-react-sdk/bin/save-credentials.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const argv = require('yargs')
1313
.option('u', {
1414
alias: 'user',
1515
demand: true,
16-
describe: 'the e-mail address you used to register with Mobify Cloud',
16+
describe: 'the e-mail address you used to register with Managed Runtime',
1717
type: 'string'
1818
})
1919
.option('k', {
2020
alias: 'key',
2121
demand: true,
22-
describe: 'find your API key at https://cloud.mobify.com/account/',
22+
describe: 'find your API key at https://runtime.commercecloud.com/account/settings',
2323
type: 'string'
2424
})
2525
.help('h')
@@ -34,7 +34,7 @@ const settingsPath = require('../scripts/utils').getSettingsPath()
3434

3535
try {
3636
fs.writeFileSync(settingsPath, JSON.stringify({username: argv.u, api_key: argv.k}, null, 4))
37-
console.log(`Saved Mobify Cloud credentials to "${settingsPath}".`)
37+
console.log(`Saved Managed Runtime credentials to "${settingsPath}".`)
3838
} catch (e) {
3939
console.error('Failed to save credentials.')
4040
console.error(e)

packages/pwa-kit-react-sdk/bin/upload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const argv = require('yargs')
2828
.option(POTENTIAL_OPTIONS.message, {
2929
alias: 'message',
3030
describe:
31-
'a message to include along with the uploaded bundle in Mobify Cloud. default: <git branch>: <git commit hash>',
31+
'a message to include along with the uploaded bundle in Managed Runtime. default: <git branch>: <git commit hash>',
3232
type: 'string'
3333
})
3434
.option(POTENTIAL_OPTIONS.projectSlug, {
@@ -39,7 +39,7 @@ const argv = require('yargs')
3939
})
4040
.option(POTENTIAL_OPTIONS.target, {
4141
alias: 'target',
42-
describe: 'a custom target to upload a bundle to within Mobify Cloud',
42+
describe: 'a custom target to upload a bundle to within Managed Runtime',
4343
type: 'string'
4444
})
4545
.help('h')

packages/pwa-kit-react-sdk/scripts/upload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const upload = (options) => {
6060

6161
const uploadBundle = (customOptions) => {
6262
if (isEmptyOptions(customOptions)) {
63-
Utils.fail('[Error: You must provide a Mobify Cloud project slug to upload a bundle.]')
63+
Utils.fail('[Error: You must provide a Runtime Admin project slug to upload a bundle.]')
6464
}
6565

6666
const options = Object.assign(OPTION_DEFAULTS, customOptions)

packages/pwa-kit-react-sdk/scripts/upload.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('uploadBundle fails with no options, no project slug, or empty project slug
2424
// Ignore
2525
}
2626
expect(Utils.fail).toBeCalledWith(
27-
'[Error: You must provide a Mobify Cloud project slug to upload a bundle.]'
27+
'[Error: You must provide a Runtime Admin project slug to upload a bundle.]'
2828
)
2929
})
3030
})

packages/pwa-kit-react-sdk/scripts/utils.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ const fileUtils = require('./file-utils')
1818
const Matcher = require('../dist/utils/glob').Matcher
1919

2020
const SDK_VERSION = require('../package.json').version
21-
const DEFAULT_DOCS_URL =
22-
'https://dev.mobify.com/v2.x/how-to-guides/categories/deployment/pushing-and-publishing-bundles'
21+
const DEFAULT_DOCS_URL = 'http://sfdc.co/pwa-kit'
2322

2423
const Utils = {}
2524

@@ -75,7 +74,7 @@ Utils.createBundle = (options, destination) => {
7574
process.cwd(),
7675
options.buildDirectory
7776
)}" not found.]\n` +
78-
'You must first run the Progressive Web SDK build process before uploading a bundle.'
77+
'You must first run the PWA Kit build process before uploading a bundle.'
7978
/* eslint-disable max-len */
8079
)
8180
)
@@ -241,7 +240,7 @@ Utils.requestErrorMessage = {
241240
'You do not have permission to perform this actions.\nPlease double check your command to make sure the option values are correct.', // wrong project name.
242241
code404:
243242
'Resource not found.\nPlease double check your command to make sure the option values are correct.', // wrong target name
244-
code500: 'Internal Server Error. Please report this to Mobify support team.'
243+
code500: 'Internal Server Error. Please report this to Salesforce support team.'
245244
}
246245

247246
module.exports = Utils

packages/pwa-kit-react-sdk/src/ssr/server/express.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ const validateConfiguration = (options) => {
345345
/* istanbul ignore next */
346346
console.warn(
347347
`Warning: You are using Node ${process.versions.node}. ` +
348-
`Your app may not work as expected when deployed to Mobify's ` +
349-
`servers which are compatible with Node ${requiredNode}`
348+
`Your app may not work as expected when deployed to Managed ` +
349+
`Runtime servers which are compatible with Node ${requiredNode}`
350350
)
351351
}
352352

scripts/check-version.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,15 @@ if (!fs.existsSync(path.join('node_modules', 'semver'))) {
2828
'--no-save',
2929
'--no-package-lock',
3030
'--ignore-scripts',
31-
'--no-audit'
31+
'--no-audit',
3232
])
3333
}
3434

3535
const semver = require('semver')
3636
const requiredNode = new semver.Range(pkg.engines.node)
3737
const foundNode = process.version
3838
const requiredNpm = new semver.Range(pkg.engines.npm)
39-
const foundNpm = spawnSync(npm, ['-v'])
40-
.stdout.toString()
41-
.trim()
39+
const foundNpm = spawnSync(npm, ['-v']).stdout.toString().trim()
4240

4341
const warnings = []
4442

@@ -56,21 +54,19 @@ const blue = (s) => `\x1b[36m${s}\u001b[0m`
5654
if (warnings.length) {
5755
const rl = readline.createInterface({
5856
input: process.stdin,
59-
output: process.stdout
57+
output: process.stdout,
6058
})
6159
console.log(red('Pausing installation...'))
6260
console.log(
63-
"Warning: Some software installed locally does not meet Mobify's version requirements:\n"
61+
'Warning: Some software installed locally does not meet the version requirements:\n'
6462
)
6563
warnings.forEach((warning) => console.log(warning))
6664
console.log('')
6765

68-
console.log(
69-
'To fix this warning, see: https://dev.mobify.com/v2.x/get-started#installing-required-software'
70-
)
66+
console.log('To fix this warning, see: http://sfdc.co/pwa-kit-required-software')
7167
rl.question(
7268
blue(
73-
"Your app may not work as expected when deployed to Mobify's servers. Would you like to continue installing anyway? (y/N) "
69+
'Your app may not work as expected when deployed to Managed Runtime servers. Would you like to continue installing anyway? (y/N) '
7470
),
7571
(answer) => {
7672
const continueAnyway = /^y|yes$/i.test(answer)

scripts/smoke-test-npm-scripts.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ sh.set('-e')
99

1010
const defaultDir = process.cwd()
1111

12-
program.description([
13-
`Smoke-tests uncommonly-run NPM scripts that get shipped with Mobify projects `,
14-
`by simply checking that those scripts exit without errors.`
12+
program.description(
13+
[
14+
`Smoke-tests uncommonly-run NPM scripts that get shipped with PWA Kit projects `,
15+
`by simply checking that those scripts exit without errors.`,
1516
].join('\n')
1617
)
17-
program.option('--dir <dir>', `Path to a Mobify project`, defaultDir)
18+
program.option('--dir <dir>', `Path to a PWA Kit project`, defaultDir)
1819

1920
program.parse(process.argv)
2021

@@ -33,10 +34,12 @@ const main = (opts) => {
3334
/^prod:build$/,
3435
/^start.*$/,
3536
/^compile-translations.*$/,
36-
/^extract-default-translations.*$/
37+
/^extract-default-translations.*$/,
3738
]
3839

39-
const scripts = Object.keys(pkg.scripts).filter((script) => !exclude.some((re) => script.match(re)))
40+
const scripts = Object.keys(pkg.scripts).filter(
41+
(script) => !exclude.some((re) => script.match(re))
42+
)
4043

4144
scripts.forEach((script) => {
4245
const cmd = `npm run ${script}`

0 commit comments

Comments
 (0)