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

Migrate to lerna and vite #142

Merged
merged 89 commits into from
Nov 16, 2023
Merged

Migrate to lerna and vite #142

merged 89 commits into from
Nov 16, 2023

Conversation

wesdevpro
Copy link

@wesdevpro wesdevpro commented Nov 16, 2023

Proposed Changes

Let's "rebase and merge" if approved.

Wesley Ford and others added 30 commits October 4, 2023 17:17
- `static` folder contains assets for the `docs` package.
- Vite expects public assets in `public` folder.
- Installs `pre-commit` package that is triggered when one runs `git
  commit`. However, it does nothing until we restore `pre-commit`
  property in `package.json`
- Installs the following packages that `docs` depends on:
    - `bulma-css-vars`
    - `cleave.js`
    - `scrollreveal`
    - `sortablejs`
    - `vue-breakpoint-mixin`
- Corrects the relative path to Buefy's `package.json` from
  `TheNavbar.vue`.
- Removes `server.fs` config in `vite.config.js`, because it is no
  longer necessary and even harmful as we started migrating to Lerna.
- Corrects the relative path to `buefy-next/utils/color.js` from the
  examples folder of `Colorpicker`.
- Installs `vite-plugin-commonjs` to import CommonJS files on Vite.
- Fixes the issue that the example of `bulma-css-vars` extension did not
  work. Problems were two-fold:
    1. `bulma-generated/bulma-colors.js` is not an ESM module, and Vite
       did not like it. Works around this with `vite-plugins-commonjs`
       plugin.
    2. `bulma-css-vars` includes a line that did not work as inteded
       with Vite. I was not able to figure out a workaround of this
       issue other than rewriting `bulma-css-vars`. So I decided to
       configure Vite to patch it with the plugin. There are two
       different plugins for development and production mode:
         - "transform-bulma-css-vars" plugin patches `bulma-css-vars`
           after Vite processes it with esbuild in development mode.
         - "load-bulma-css-vars" plugin patches `bulma-css-vars` when it
           is loaded in production mode.
- Fixes the issue that a code snippet of BulmaCssVars extension became
  "0". Replaces the obsolete `pre` filter syntax with `utils.preformat`
  call.
- Moves `netlify.toml` to `packages/docs` because it is specific to the
  docs package.
- Configures Netlify to forward all the traffic that is not resolved to
  existing files to the root `/` so that the SPA can determine which
  contents to deliver. This configuration should make pre-rendering
  unnecessary.
- The `build` script copies `netlify.toml` to `dist` folder.
- Downgrades `@mdi/font` to v6.9.96, because v7.x deprecated and removed
  the Discord icon. Since other brand icons like GitHub will also go
  away in v8.x, we should consider other icon sources; e.g., Simple
  Icons.
- Because we upgraded `@mdi/font`.
- Installs `@mdi/font` v6.9.96.
Co-Authored-By: Kikuo Emoto <kemoto@codemonger.io>
- `highlight.js` v11.9.0 is the latest version as of this commit.
- Because we bumped `highlight.js` to v11.x.
- Fixes the issue that syntax highlighting was not applied to code
  blocks due to the outdated `highlight` directive define in the Vue 2
  manner. Corrects the definition of `highlight` directive so that it
  works on Vue 3:
    - renames `bind` → `beforeMount`
    - renames `componentUpdated` → `updated`

  See https://v3-migration.vuejs.org/breaking-changes/custom-directives.html

  Removes `deep` option because it was deprecated and has no effect on
  Vue 3 (even on Vue 2).

  See https://v2.vuejs.org/v2/guide/migration#Custom-Directives-simplified

- Also fixes the deprecation warnings from the new version of
  `highlight.js`:
    - renames `highlightBlock` → `highlightElement`
- Fixes the issue that the text input on the search modal did not work.
  Replaces "@input" → "@update:model-value" on the `<b-input>` for
  search terms.

  The `<b-input>` for the search terms intended to call the `search`
  method whenever a new text was inputted. It was listening for "input"
  events to receive inputted texts (model value) and it worked on Vue 2.
  However, it broke on Vue 3, because Vue 3 changed the name of events
  triggered when a model value is updated from "input" to
  "update:modelValue". Since "input" overlaps with events from the
  underlying `<input>` of `<b-input>`, the `search` method started to
  receive `InputEvent` objects instead of inputted texts.
- Fixes the version displayed on the Home view.
- Because we upgraded `@mdi/font`.
kikuomax and others added 22 commits November 4, 2023 08:23
- Fixes the problem that tests failed due to the discrepancy between
  `packages/buefy-next` and `packages/docs` over Vue's version. I took
  the following steps to fix this:
    1. Bump `vue` in `packages/docs` → 3.3.7 or above
    2. Remove dependency on `@vue/shared` that is indirectly installed
       by `vue
    3. Remove `package-lock.json`, and all the `node_modules` folders
    4. Run `npm install`
- I should have updated snapshots in #127.
- Adds `vetur` script that runs `build/vetur.js`. `build` script runs
  `vetur`.
- Installs `esm` package to import ESM scripts from CJS files; e.g,
  `build/vetur.js`.
MigrateToLerna: restore vetur script
- Removes unnecessary files including:
    - files related to Webpack
    - leftovers of the Vite template project
- Triggers a GitHub Actions workflow that publishes to the GitHub
  Packages registry whenever new commits are pushed to the `dev` branch.
  Commit hashes are appended to the package versions so that they won't
  overlap with existing or future releases.
- Copies `README.md` in the root folder to `packages/buefy-next` so that
  published packages have correct README. A symbolic link might work,
  though, I was not very confident about whether it would work on
  Windows.
MigrateToLerna: publish dev releases to the GitHub Packages registry
chore: clean up GitHub action for unit testing

chore: clean up GitHub action for unit testing

fix(action): update commands in GitHub action for unit testing
Create GitHub Action For Unit Testing Upon PR To `dev` And `main`
- `npm ci` command did not accept the workspace option `-w`. Simply runs
  `npm ci` instead.
- Fixes the issue that the unit testing workflow did not work with
  Node.js v14 because some of our `devDependencies` required Node.js v16
  or higher. Simply drops "14.x" from the build matrix.
…-gha

MigrateToLerna: fix the unit testing GitHub Actions workflow
- Updates `npm_deploy.yml`:
    - Inserts `npm build` before `npm publish`. The `prepare` script
      used to run `build` at `publish`, but the `prepare` script was
      removed; I removed it because it was not very useful in the
      workspace configuration.
    - Adds the workspace option `-w @ntohq/buefy-next` to `npm` commands
      except for `npm ci`.
    - Bumps Node.js to v18.
    - Bumps `actions/checkout` to v4.
MigrateToLerna: update npm deploy workflow
MigrateToLerna: bump version to 0.1.3
@wesdevpro wesdevpro requested a review from kikuomax November 16, 2023 05:45
Copy link

netlify bot commented Nov 16, 2023

Deploy Preview for buefy-nextdocs ready!

Name Link
🔨 Latest commit a6e5ab4
🔍 Latest deploy log https://app.netlify.com/sites/buefy-nextdocs/deploys/6555ac7a59ff890009ea7e4a
😎 Deploy Preview https://deploy-preview-142--buefy-nextdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@kikuomax kikuomax left a comment

Choose a reason for hiding this comment

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

Too many changes to review, though, I am sure we already have reviewed all the changes.

@kikuomax kikuomax merged commit 6470287 into dev Nov 16, 2023
6 checks passed
@kikuomax kikuomax deleted the MigrateToLerna branch November 16, 2023 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Migrate to Webpack 5.x or Vite Migrate Mono Repo to Use Lerna build:docs does not produce CSS files
3 participants