Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reorganize codebase as monorepo #19

Merged
merged 1 commit into from
Jun 13, 2022
Merged

Conversation

pastelmind
Copy link
Collaborator

Convert the codebase into a monorepo, using NPM's workspaces.

The packages are:

  • The core package (@webtoon/psd) is moved under packages/psd/
  • The browser example app, benchmark app, and Node.js example app are given their own packages under packages/. These packages are marked private in order to prevent accidentally publishing them.
  • The example apps now import @webtoon/psd using NPM's workspace support (i.e. import "@webtoon/psd") instead of relative paths (i.e. import "../../src").

This has several benefits:

  • Clarify which dependencies are needed for building and testing @webtoon/psd, and which ones are needed for building the examples.
  • Allow us to apply different configurations for the core package and example apps in a sensible way.
  • Force the examples to consume @webtoon/psd as though it was installed from npmjs.com. This helps us identify bundling/deployment problems, and provides a better example for users.

Other changes added in this commit:

  • Change the bundle name to index.js. This fixes issue Package main points to missing file #13 properly (better than fix: update main and types in package.json #14, which may have caused TypeScript issues for users)
  • The benchmark app now has its own PSD file (example.psd) instead of borrowing it from the Node.js example app.
  • The Node.js example app uses node-dev instead of tsc-watch.
  • We now have two README.md and LICENSE files. The ones in the root directory are for people who visit the project repo, while the ones under packages/psd/ are included when publishing @webtoon/psd.
  • Properly sort import statements in some files.

@pastelmind pastelmind added the type: maintenance General maintenance label Jun 10, 2022
@pastelmind pastelmind self-assigned this Jun 10, 2022
Convert the codebase into a monorepo, using NPM's workspaces.

The packages are:

- The core package (@webtoon/psd) is moved under `packages/psd/`
- The browser example app, benchmark app, and Node.js example app are
  given their own packages under `packages/`. These packages are marked
  private in order to prevent accidentally publishing them.
- The example apps now import @webtoon/psd using NPM's workspace support
  (i.e. `import "@webtoon/psd"`) instead of relative paths
  (i.e. `import "../../src"`).

This has several benefits:

- Clarify which dependencies are needed for building and testing
  @webtoon/psd, and which ones are needed for building the examples.
- Allow us to apply different configurations for the core package and
  example apps in a sensible way.
- Force the examples to consume @webtoon/psd as though it was installed
  from npmjs.com. This helps us identify bundling/deployment problems,
  and provides better examples for users.

Other changes added in this commit:

- Change the bundle name to `index.js`. This fixes issue #13 properly
  (better than #14, which may have caused TypeScript issues for users)
- The benchmark app now has its own PSD file (`example.psd`) instead of
  borrowing it from the Node.js example app.
- The Node.js example app uses node-dev instead of tsc-watch.
- We now have two README.md and LICENSE files. The ones in the root
  directory are for people who visit the project repo, while the ones
  under `packages/psd/` are included when publishing @webtoon/psd.
- Properly sort import statements in some files.
@pastelmind pastelmind merged commit 29d077d into main Jun 13, 2022
@pastelmind pastelmind deleted the refactor-monorepo branch June 13, 2022 06:30
pastelmind pushed a commit that referenced this pull request Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance General maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant