Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions packages/pwa-kit-create-app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
- 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)
- Introduce the cursor rules to assist storefront project developers [#2578] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2578)
- Add `StoreLocatorProvider` to the `AppConfig` template to support BOPIS [#2753] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2753)
- Introduce the cursor rules to assist storefront project developers [#2578](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2578) [#2754](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2754)
- Add `StoreLocatorProvider` to the `AppConfig` template to support BOPIS [#2753](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2753)

## v3.10.0 (May 22, 2025)
- Add Data Cloud API configuration to `default.js`. [#2318](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2318)
Expand Down
32 changes: 16 additions & 16 deletions packages/pwa-kit-create-app/scripts/create-mobify-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,22 +352,6 @@ const runGenerator = (context, {outputDir, templateVersion, verbose}) => {
assets.forEach((asset) => {
sh.cp('-rf', p.join(packagePath, asset), outputDir)
})

// Copy the .cursor/rules directory if it exists
if (sh.test('-e', CURSOR_RULES_FROM_DIR)) {
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 copying of cursor rules used to be run conditionally.. see line 342 above.

const outputCursorRulesDir = p.join(outputDir, '.cursor', 'rules')

// Create the directory if it doesn't exist
if (!sh.test('-e', outputCursorRulesDir)) {
fs.mkdirSync(outputCursorRulesDir, {recursive: true})
}

// Copy the contents of CURSOR_RULES_FROM_DIR to outputCursorRulesDir
const files = fs.readdirSync(CURSOR_RULES_FROM_DIR)
files.forEach((file) => {
sh.cp('-rf', p.join(CURSOR_RULES_FROM_DIR, file), outputCursorRulesDir)
})
}
} else {
console.log('Copying base template from package or npm: ', packagePath, outputDir)
// Copy the base template either from the package or npm.
Expand Down Expand Up @@ -398,6 +382,22 @@ const runGenerator = (context, {outputDir, templateVersion, verbose}) => {
sh.rm('-rf', tmp)
}

// Copy the .cursor/rules directory if it exists
if (sh.test('-e', CURSOR_RULES_FROM_DIR)) {
const outputCursorRulesDir = p.join(outputDir, '.cursor', 'rules')

// Create the directory if it doesn't exist
if (!sh.test('-e', outputCursorRulesDir)) {
fs.mkdirSync(outputCursorRulesDir, {recursive: true})
}

// Copy the contents of CURSOR_RULES_FROM_DIR to outputCursorRulesDir
const files = fs.readdirSync(CURSOR_RULES_FROM_DIR)
files.forEach((file) => {
sh.cp('-rf', p.join(CURSOR_RULES_FROM_DIR, file), outputCursorRulesDir)
})
}

// Install dependencies for the newly minted project.
npmInstall(outputDir, {verbose})
}
Expand Down
Loading