Rename sync script to sync-webapp-skills, drop manifest file

- Rename sync-template-skills.js to sync-webapp-skills.js
- Update package.json script to sync-webapp-skills
- Remove .synced-template-skills.json creation and add to .gitignore

Made-with: Cursor
This commit is contained in:
k-j-kim 2026-03-18 10:59:39 -07:00
parent cdeec3b003
commit 8b1cb49809
No known key found for this signature in database
GPG Key ID: 40FA25A7DE938B04
3 changed files with 5 additions and 44 deletions

3
.gitignore vendored
View File

@ -219,6 +219,9 @@ target/
bin/
obj/
# Sync script manifest (not created by script)
skills/.synced-template-skills.json
# Local configuration
config.local.*
*.local.json

View File

@ -1,7 +1,7 @@
#!/usr/bin/env node
/**
* Pins @salesforce/webapp-template-app-react-sample-b2e-experimental to the
* latest npm version, runs npm install, then copies skills from
* Sync webapp skills: pins @salesforce/webapp-template-app-react-sample-b2e-experimental
* to the latest npm version, runs npm install, then copies skills from
* dist/.a4drules/skills/ into skills/. Run from repo root.
*/
@ -12,7 +12,6 @@ const { copyRecursive } = require('./lib/copy-recursive');
const PACKAGE_NAME = '@salesforce/webapp-template-app-react-sample-b2e-experimental';
const SKILLS_SRC = 'dist/.a4drules/skills';
const MANIFEST = '.synced-template-skills.json';
const repoRoot = process.cwd();
const pkgPath = path.join(repoRoot, 'package.json');
@ -55,16 +54,6 @@ if (!fs.existsSync(srcDir)) {
if (!fs.existsSync(skillsDir)) fs.mkdirSync(skillsDir, { recursive: true });
// Remove skills from previous sync (tracked in manifest)
const manifestPath = path.join(skillsDir, MANIFEST);
if (fs.existsSync(manifestPath)) {
const prev = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
for (const dir of prev.syncedDirs || []) {
const p = path.join(skillsDir, dir);
if (fs.existsSync(p)) fs.rmSync(p, { recursive: true });
}
}
function addWebappPrefix(name) {
const parts = name.split('-');
if (parts.length < 2) return name;
@ -98,9 +87,4 @@ for (const srcName of fs.readdirSync(srcDir)) {
const version = JSON.parse(
fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8')
).version;
fs.writeFileSync(
manifestPath,
JSON.stringify({ package: PACKAGE_NAME, version, syncedDirs }, null, 2) + '\n',
'utf8'
);
console.log(`Done — synced ${syncedDirs.length} skills from ${PACKAGE_NAME}@${version}.`);

View File

@ -1,26 +0,0 @@
{
"package": "@salesforce/webapp-template-app-react-sample-b2e-experimental",
"version": "1.107.3",
"syncedDirs": [
"accessing-webapp-data",
"building-webapp-analytics-charts",
"building-webapp-data-visualization",
"building-webapp-interactive-map",
"building-webapp-react-components",
"building-webapp-weather-widget",
"configuring-webapp-csp-trusted-sites",
"configuring-webapp-metadata",
"creating-webapp",
"deploying-webapp-to-salesforce",
"designing-webapp-ui-ux",
"exploring-webapp-graphql-schema",
"fetching-webapp-rest-api",
"generating-webapp-graphql-mutation-query",
"generating-webapp-graphql-read-query",
"implementing-webapp-file-upload",
"installing-webapp-features",
"integrating-webapp-agentforce-conversation-client",
"integrating-webapp-unsplash-images",
"using-webapp-graphql"
]
}