mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-10 17:41:49 +08:00
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:
parent
cdeec3b003
commit
8b1cb49809
3
.gitignore
vendored
3
.gitignore
vendored
@ -219,6 +219,9 @@ target/
|
|||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
|
|
||||||
|
# Sync script manifest (not created by script)
|
||||||
|
skills/.synced-template-skills.json
|
||||||
|
|
||||||
# Local configuration
|
# Local configuration
|
||||||
config.local.*
|
config.local.*
|
||||||
*.local.json
|
*.local.json
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* Pins @salesforce/webapp-template-app-react-sample-b2e-experimental to the
|
* Sync webapp skills: pins @salesforce/webapp-template-app-react-sample-b2e-experimental
|
||||||
* latest npm version, runs npm install, then copies skills from
|
* to the latest npm version, runs npm install, then copies skills from
|
||||||
* dist/.a4drules/skills/ into skills/. Run from repo root.
|
* 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 PACKAGE_NAME = '@salesforce/webapp-template-app-react-sample-b2e-experimental';
|
||||||
const SKILLS_SRC = 'dist/.a4drules/skills';
|
const SKILLS_SRC = 'dist/.a4drules/skills';
|
||||||
const MANIFEST = '.synced-template-skills.json';
|
|
||||||
|
|
||||||
const repoRoot = process.cwd();
|
const repoRoot = process.cwd();
|
||||||
const pkgPath = path.join(repoRoot, 'package.json');
|
const pkgPath = path.join(repoRoot, 'package.json');
|
||||||
@ -55,16 +54,6 @@ if (!fs.existsSync(srcDir)) {
|
|||||||
|
|
||||||
if (!fs.existsSync(skillsDir)) fs.mkdirSync(skillsDir, { recursive: true });
|
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) {
|
function addWebappPrefix(name) {
|
||||||
const parts = name.split('-');
|
const parts = name.split('-');
|
||||||
if (parts.length < 2) return name;
|
if (parts.length < 2) return name;
|
||||||
@ -98,9 +87,4 @@ for (const srcName of fs.readdirSync(srcDir)) {
|
|||||||
const version = JSON.parse(
|
const version = JSON.parse(
|
||||||
fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8')
|
fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8')
|
||||||
).version;
|
).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}.`);
|
console.log(`Done — synced ${syncedDirs.length} skills from ${PACKAGE_NAME}@${version}.`);
|
||||||
@ -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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user