Skip to content

Commit

Permalink
refactor: reorganize codebase as monorepo
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Yehyoung Kang authored and pastelmind committed Jun 13, 2022
1 parent c77c4ab commit 29d077d
Show file tree
Hide file tree
Showing 163 changed files with 805 additions and 559 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/dist/
dist/
/dist-web/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bower_components
Thumbs.db

# Ignore build artifacts
/dist/
dist/
/dist-web/

# Coverage reports generated by test suites
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/coverage/
/dist/
dist/
/dist-web/
Loading

0 comments on commit 29d077d

Please sign in to comment.