Skip to content

[DIT-13670] Add bases support - #161

Merged
marla-hoggard merged 4 commits into
masterfrom
marla/dit-13670-support-bases
Nov 5, 2026
Merged

marla-hoggard merged 4 commits into
masterfrom
marla/dit-13670-support-bases

Conversation

@marla-hoggard

@marla-hoggard marla-hoggard commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Adds support for pulling directly from bases, and updates project exports so they are grouped by connected base. Non-connected projects continue to go into their own project files, but all data from a given base will be placed into a single, combined base file, titled by the base's id, so that the API can handle any duplicates between the base and its connected projects.

Test Plan

Until it merges, you will need to point your ditto-app to this branch: marla/dit-13880-empty-var

  • The following configs should generate identical output between marla/dit-13867-always-use-export and this branch
    • Projects should only be fetched if projects exists in the config. Components should only be fetched if components is in the config. They can both be fetched when both are specified.
    • All components (folders: [])
    • Specific component folders
    • All projects (project: []) in a workspace that has no base-connected projects
    • A list of projects by id, none of which are connected to a base
  • Now, make sure you have some bases + projects connected to those bases + other projects
  • Make sure you have some text items in projects who have diverged from their base text item
  • Change the sources in your config to just bases: -a-base-id (with a line break) and pull
    • You should get a single file with all the text from that base
    • Multiple bases -> multiple files, one per base, titled by the base's dev id
    • Add a project that is connected to the base -> You should get the same base files only, but all project values should have overridden the corresponding base text values. Project items not appearing in the base ("New" status) should be present in addition to the base items
    • Add another project connected to that base -> Same as before. If the same item is in both projects, the item in the project with a later developerId (Z beats A) should be in the file
    • Add two non-connected projects -> They should each get their own file as before, named by their project id
    • Change to projects: [] -> This should fetch EVERY project in the workspace, grouped the same as described
    • Remove bases from the config -> The files should still be grouped the same as before - the projects connected to bases should still be grouped together and named by base, but only the text items present in those projects (and not the whole base) should be in the file
    • For the json exports, the index.js file should spread all base files, then project files, then components, in that order

@marla-hoggard
marla-hoggard force-pushed the marla/dit-13670-support-bases branch from ae6b10b to 5400259 Compare October 8, 2026 21:21
@marla-hoggard
marla-hoggard changed the base branch from marla/dit-13867-always-use-export to master October 13, 2026 13:36
@marla-hoggard
marla-hoggard force-pushed the marla/dit-13670-support-bases branch from 5400259 to 0edd05c Compare October 13, 2026 13:36

@bparrish17 bparrish17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good just a couple stylistic nits, take em or leave em

Comment thread lib/src/formatters/shared/baseExport.ts Outdated
/** Developer ID of the base */
id: string;
/** True if the base is in the config, so its own text items are exported too */
fetchBaseTextItems: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this reads as an action not a boolean, shouldFetchBaseTextItems or something similar for clarity

return requests;
}

private textItemSourceFilter(source: TextItemSource): PullFilters {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

stylistic nit: do we have any conventions for denoting private methods? In the past ive prefixed them with underscore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just checked and every private method in the repo has a regular name, no specific conventions. I think just about every class method in this repo is either private or protected where protected just allows private methods to be used in test files.

Given that basically every method is private, i don't think we need to change the names to denote that. And it would be a huge diff if we did.

@marla-hoggard
marla-hoggard marked this pull request as draft October 13, 2026 15:18
@marla-hoggard
marla-hoggard force-pushed the marla/dit-13670-support-bases branch from 4c85bd6 to 748e92a Compare October 21, 2026 16:11
@marla-hoggard
marla-hoggard marked this pull request as ready for review November 5, 2026 17:24
@marla-hoggard
marla-hoggard merged commit f654153 into master Nov 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants