Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions jest.config.cjs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this was added as it wasn't in develop, so I removed it. Things still work without it.

This file was deleted.

1 change: 1 addition & 0 deletions packages/pwa-kit-create-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## v3.11.0-dev.0 (May 23, 2025)
- Fix exiting before `program.json` content can be flushed [#2699](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2699)
- Add `program.json` + Support for Agent-Friendly CLI Input via stdio [#2662](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2662)
- Change the default ECOM instance in the generated application [#2610](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2610)
- Load active data scripts on demand only [#2623](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2623)
Expand Down
11 changes: 8 additions & 3 deletions packages/pwa-kit-create-app/scripts/create-mobify-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,13 @@ const getAnswersFromStdin = async () => {
/**
* Prints the contents of program.json in a nicely formatted way and exits the process.
*/
const printProgramJsonAndExit = () => {
console.log(JSON.stringify(PROGRAM, null, 2))
const printProgramJsonAndExit = async () => {
const output = JSON.stringify(PROGRAM, null, 2)
await new Promise((resolve) => {
process.stdout.write(output + '\n', () => {
resolve()
})
})
Comment on lines +463 to +469
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug that I originally made where the output was being printed and the program exited before the standard out could be flushed. This fixes that problem.

process.exit(0)
}

Expand Down Expand Up @@ -490,7 +495,7 @@ const main = async (opts) => {

// Exit if the preset provided is not valid.
if (displayProgram) {
printProgramJsonAndExit()
await printProgramJsonAndExit()
}

// Exit if the preset provided is not valid.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const parentConfig = require('@salesforce/pwa-kit-dev/configs/babel/babel-config').default

module.exports = {
...parentConfig,
sourceType: 'module'
}
module.exports = require('internal-lib-build/configs/babel.config')
Copy link
Contributor Author

@bendvc bendvc Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module type was no longer required and our project is not an esm project anymore but we still use import syntax. Its a little weird, but that is how we currently do it in the pwa-kit mono repo. We could choose to change this, but we might have to drop pwa-kit-dev as a source of our jest integration.

Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
// eslint-disable-next-line @typescript-eslint/no-var-requires
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing some lint errors now that we have linting for all files working.

const parentConfig = require('@salesforce/pwa-kit-dev/configs/jest/jest.config.js')

module.exports = {
...parentConfig,
testEnvironment: 'node',
testMatch: [
'**/__tests__/**/*.js',
'**/?(*.)+(spec|test).js'
],
collectCoverageFrom: [
'src/**/*.js',
'!src/**/*.test.js',
'!src/**/*.spec.js'
],
testMatch: ['**/__tests__/**/*.js', '**/?(*.)+(spec|test).js'],
testPathIgnorePatterns: ['bin/*', 'coverage/*', 'dist/*', 'node_modules/*', 'scripts/*'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont test node modules etc.

collectCoverageFrom: ['src/**/*.js', '!src/**/*.test.js', '!src/**/*.spec.js'],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
testTimeout: 10000
}
}
Loading