Code Monkey home page Code Monkey logo

Comments (8)

muenzpraeger avatar muenzpraeger commented on July 22, 2024 1

@octref Agree in the separation. The coupling I was thinking about to trigger version/publication via a workflow event after grammar/theme updates.

Although I'm wondering about the right balance for auto-publication. I mean, even with only a weekly one it could be like 52 patch versions/year on the main package. Or maybe the way would be to separate grammars/themes into a dedicated package.

from shiki.

muenzpraeger avatar muenzpraeger commented on July 22, 2024 1

I'd say I'll get as a first step a PR up for issue creation in case of grammar/theme update issues.

And we'll discuss with v1 on nightlies. Now that there are breaking changes on the table it's way easier to draw ideas. ;-)

My thinking re: packages was conceptually like this.

{
  "name": "@shiki/core",
  "version": "1.0.0",
  "dependencies": {
    "@shiki/themes": "^1.0.0",
    "@shiki/grammars": "^1.0.0"
  }
}

That way theme/grammar could have nightly packages, and "core" would not need them.

And taking it further... implementing the package configs via the project config. Which could then also be a standard way for people to add their own customizations.

{
   "name": "@muenzpraeger/my-custom-shiki-theme",
   "version": "0.2.1",
   "shiki": {
      "themes": {
         "my-custom-theme": "./my-custom-theme.json"
      }
   }
 }

Just a thought. ;-)

from shiki.

octref avatar octref commented on July 22, 2024

Sure 👍

from shiki.

stefanprobst avatar stefanprobst commented on July 22, 2024

is there a nightly shiki build on npm? npm info shiki does not seem to show it.

from shiki.

muenzpraeger avatar muenzpraeger commented on July 22, 2024

@orta @octref Any thoughts if I take a stab on the GitHub actions to make this happen?

Current behavior:

  • Isolated, scheduled job to update grammars
    • fails hard when grammar is not available (no updates for subsequent grammars)
    • doesn't update semver patch for shiki
  • Isolated, scheduled job to update themes
    • fails hard when theme is not available (no updates for subsequent themes)
    • doesn't update semver patch for shiki
  • Isolated, on commit-to-main job to publish to npm
    • doesn't do anything for/with the scheduled grammar/theme updates as no semver update

Proposed behavior:

  • Couple (or combine) workflows for grammars and themes
    • Don't fail hard, instead auto-create issue for failed theme or grammar (easier tracking, no impact on other grammars/themes)
    • Increase patch version of shiki if changes exist
    • Commit changes
    • Create GitHub release with change history
      • This could eventually replace the current Changelog, to reduce future manual maintenance
    • Publish to npm

from shiki.

octref avatar octref commented on July 22, 2024

@muenzpraeger Looks great 👍 Doing it in two parts would be best, eg first the "don't fail hard" part, then the commit/version/publish flow. I still think fetching grammar/theme and publishing should be separate actions.

from shiki.

octref avatar octref commented on July 22, 2024

I don't know about another package though – I still believe people should download one package and be able to start using it. However, one structure this could take is:

  • Have a theme/language nightly package, that you can use with the shiki main package
  • Have a workflow that send PR to merge latest theme/language into the main shiki package

from shiki.

octref avatar octref commented on July 22, 2024

Yeah, similar to what I'm thinking. @shiki/themes should export a list of themes, and people can duck theme.

from shiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.