Skip to content

refactor: public source, package built in CI - #18

Open
0ptaq0 wants to merge 6 commits into
mainfrom
ci/deps-from-sfdx-project
Open

0ptaq0 wants to merge 6 commits into
mainfrom
ci/deps-from-sfdx-project

Conversation

@0ptaq0

@0ptaq0 0ptaq0 commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

package/ and force-app/ held the same classes (global vs public), edited by hand twice, and the vendored SOQL and DML copies had their own version pins. Now the repo keeps one public source and the package is built from it.

What changed

  • force-app/ stays the public source people clone and deploy. package/ is gone.
  • Package API = // global markers. Every declaration that is global in the package has a // global line above it: 122 markers, the same set as the released 0.2.0. scripts/prepare-package.mjs makes marked declarations global, drops @TestVisible on them and leaves out dependencies/. On the current code it gives back the released package/ source byte for byte (marker lines aside).
  • force-app/main/default/dependencies/ is generated by npm run build:dependencies: the public SOQL/DML classes and tests at the tags pinned in sfdx-project.json (SOQL Lib@6.12.0-1 -> v6.12.0, DML Lib 4.0.0.LATEST -> v4.0.0). One place for dependency versions, and a plain clone still deploys everything.
  • CI, three jobs:
    • salesforce-ci: deploys force-app the way people clone it (with dependencies/), runs the tests, uploads coverage. examples/ is not deployed.
    • package-check: runs prepare-package.mjs, deploys SOQL Lib and DML Lib from their tags, then the package form, and runs the tests. A missing marker fails here, not at release.
    • dependencies: fails when dependencies/ does not match sfdx-project.json.
  • Package version workflow (manual): prepares the source and runs sf package version create. The summary shows the new 04t and the alias to add.
  • Coverage: codecov.yml ignores dependencies/ and examples/.
  • Docs: README and the installation page say Trigger Lib depends on SOQL Lib 6.12.0 and DML Lib 4.0.0, with the package install order. CONTRIBUTING explains the layout and the markers.
  • .prettierignore: dependencies/ (kept verbatim) and README.md (prettier turns its Apex blocks into 2-space, 80-column code).

Worth a look

  • The marker style, // global above the declaration. Other options were a list of declarations in the script (the async-lib way) or splitting API and internals into separate files.
  • dependencies/ now comes verbatim from the tags, so SOQL_Test/DML_Test lose the local testFor and use the deps' apiVersion 66.0.
  • The package version workflow does not commit the new alias, it prints it.
  • Before merge: point ci.yml back to cicd-template@main once feat: deploy dependencies from sfdx-project cicd-template#6 is merged, and drop template-ref.

@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
trigger-lib Ready Ready Preview Sep 29, 2026 2:53pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Salesforce CI

✅ Deployment succeeded

✅ All tests passed

==========================================
     APEX TEST EXECUTION SUMMARY
==========================================

📊 Total Tests: 1131
✅ Passed: 1131
❌ Failed: 0
⏭️  Skipped: 0


🎉 All tests passed successfully!

📦 Workflow run, logs and artifacts


📊 Stats: 1131 total | ✅ 1131 passed | ❌ 0 failed
🤖 Automated comment by Salesforce CI

@0ptaq0 0ptaq0 changed the title refactor: force-app as the only source refactor: public source, package built in CI Sep 29, 2026
@0ptaq0
0ptaq0 force-pushed the ci/deps-from-sfdx-project branch from 7a24959 to 8d4bb30 Compare September 29, 2026 14:53

This branch was successfully deployed

1 active deployment
Preview — 8d4bb303 Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant