Skip to content

feat!: refactor into monorepo with compile and cli packages#192

Merged
chrispcampbell merged 34 commits into
mainfrom
chris/191-monorepo
Jun 6, 2022
Merged

feat!: refactor into monorepo with compile and cli packages#192
chrispcampbell merged 34 commits into
mainfrom
chris/191-monorepo

Conversation

@chrispcampbell
Copy link
Copy Markdown
Contributor

Fixes #191

This is an initial round of refactoring that converts the existing sdeverywhere package into separate @sdeverywhere/compile and @sdeverywhere/cli packages. This sets the stage for adding more packages (build, runtime, check, etc) in the coming days.

For this PR, I've kept the implementation as untouched as possible. The changes are limited to:

  1. moving sde command-related files to the cli package
  2. moving core compiler (preprocess, parse, generate) files to the compile package
  3. updating imports and moving some functions/dependencies to one side or the other so that there is a clean split
  4. removing some repeated boilerplate (e.g., parser creation) and replacing with shared functions

The only notable exception is that I've removed the sde generate --genhtml command and supporting web files. There will be a replacement for this implemented using the plugin API; this avoids having it baked into the core, so that we can make it more configurable and have fewer dependencies in core.

With these changes in place, we now have a pretty minimal API surface for the compile package. The exact API is subject to change before 1.0, but at least now the compile package is well isolated:

export { generateCode } from './CodeGen.js'
export { parseAndGenerate, printNames } from './Entry.js'
export { canonicalName } from './Helpers.js'
export { parseModel } from './Parser.js'
export { preprocessModel } from './Preprocessor.js'
export { readDat } from './ReadDat.js'

For the commit message (and the changelog):

BREAKING CHANGE: The sdeverywhere package is deprecated and effectively replaced by @sdeverywhere/cli. Additionally, the sde generate --genhtml command and supporting code has been removed and will be replaced with a different solution in the near future.

/cc @ToddFincannon

…new parseAndGenerate() function in compile package
@chrispcampbell chrispcampbell merged commit 8946f18 into main Jun 6, 2022
@chrispcampbell chrispcampbell deleted the chris/191-monorepo branch June 6, 2022 22:10
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.

Refactor into monorepo with compile and cli packages

1 participant