Skip to content

Several services

Give input a folder of documents (named after their files) or { name: fileOrUrl }. Operations and components found in one service are kept; ones found in several are merged when identical and need an owner when they differ.

  • Run in a terminal once to answer the questions — the answers (main service, owners) are written to decisionsFile and commit with the code.
  • --check and CI never ask; they fail listing what is still undecided.
  • Operations carry x-service, and services.ts exports API_SERVICE_BASE_URLS for the per-service base URL. By default each is read from the environment, in a variable named after baseUrlEnv and the service (VITE_API_URL_FILE_STORE for file-store); runtime.services.baseUrls gives literal URLs instead, and runtime.services.fn hands the lookup to a function of your own (the only way the generated code imports anything from your project, and only when you name it). Services matter only when there are several; with one, its operations are written like any others. With @mrzr/api-client that map is handed to its services plugin and a call is apiClient.service(name); axios gets baseURL, fetch and Angular the URL in front of the route.
  • The run prints what was merged, which owner was chosen, which operations use a component owned by another service, and which saved choices no longer apply. --verbose lists the identical duplicates a merge folded together.