Skip to content

Ci upgrade release version #71

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

Closed
wants to merge 27 commits into from
Closed

Conversation

soranoo
Copy link
Owner

@soranoo soranoo commented Apr 25, 2025

Summary by CodeRabbit

  • New Features

    • Added support for TailwindCSS 4, nested CSS, and CSS idents obfuscation.
    • Introduced new configuration options: prefix, suffix, and ignorePatterns for more flexible obfuscation control.
    • Added a GitHub Actions workflow for automated releases and a new upgrade guide for version 3.
  • Bug Fixes

    • Improved handling of CSS and HTML obfuscation by leveraging external libraries for more reliable processing.
  • Refactor

    • Simplified and modernized the codebase by removing deprecated options, functions, and internal parsing logic.
    • Updated internal and exported types to align with new configuration and obfuscation mechanisms.
  • Documentation

    • Updated the README to reflect breaking changes and new features in version 3.
    • Added a comprehensive upgrade guide to assist users migrating from previous versions.
  • Chores

    • Integrated new linting and release tools, and updated project dependencies for better maintainability.
    • Removed obsolete configuration and test files, and improved formatting and code consistency.

soranoo and others added 27 commits April 22, 2025 07:16
Moves test files from the `src/handlers` directory to the `src/__tests__` directory for better organization and separation of concerns.
This change improves the project structure and makes it easier to locate and manage test files.
Also, updates import paths in test files.
Moves the test file from the `src` directory to the `__tests__` directory for better organization and separation of concerns.
This change improves the project structure and makes it easier to locate test files.
Migrates the project's code formatting and linting from Prettier to Biome.

This change removes the existing Prettier configuration and
implements Biome. The Biome configuration enforces consistent code
style and catches potential issues, improving code quality and
maintainability.
Upgrades the core CSS transformation engine to `css-seasoning` and `lightningcss-wasm`.

- Replaces PostCSS with `css-seasoning` for CSS parsing and transformation.
- Integrates `lightningcss-wasm` for CSS minification and optimization.
- Introduces a new `obfuscateCssFiles` function for processing CSS files.
- Removes the deprecated `classLength` option.
- Improves the way of css obfuscation with new logic and features.

This change significantly enhances the performance and flexibility of the CSS obfuscation process.
Refactors the CSS obfuscation process to leverage the `css-seasoning` library, replacing custom CSS parsing and manipulation logic. This change improves maintainability and leverages a dedicated library for CSS transformations.

Removes the old CSS test file as the functionality is now covered by `css-seasoning`.
Refactors utility functions for better organization and reusability.

- Removes unused random string generation and string simplification functions.
- Exports previously internal functions to enhance module accessibility and
  facilitate testing.
- Streamlines the codebase by removing dead code and improving overall
  structure.
Introduces breaking changes to support TailwindCSS 4, nested CSS, and CSS ident obfuscation.

- Updates configuration options, including renaming, merging, and removing deprecated options.
- Migrates to css-seasoning v1.4.1.
- Enables JS AST parsing by default.
- Updates documentation with v3 migration guide.
Sets up semantic release to automate the release process.

This includes:
- Adding a release workflow file.
- Installing semantic-release and related plugins.
- Creating a release configuration file.

This automates versioning, changelog generation, and package publishing.
# 1.0.0-beta.1 (2025-04-25)

### Bug Fixes

* fix html tests ([f517839](f517839))
* **html:** fix [#57](#57) ([a638538](a638538))
* **html:** fix incorrect html class name truncation ([7cb985d](7cb985d))
* **js-ast:** added support to `MemberExpression` [#45](#45) ([8c95ba0](8c95ba0))
* **js-ast:** added support to `TemplateLiteral` & `TemplateElement` [#45](#45) ([0dd46b3](0dd46b3))

### Features

* Enables semantic release for automated publishing ([b43a194](b43a194))
* Upgrades to v3 with new CSS transformation ([0afd780](0afd780))
* v3 migration with TailwindCSS 4 support ([668a5f6](668a5f6))
BREAKING CHANGE
# [1.0.0-beta.2](v1.0.0-beta.1...v1.0.0-beta.2) (2025-04-25)

### Features

* upgrade semantic-release release version to v2 ([7466b77](7466b77))
Copy link

vercel bot commented Apr 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-css-obfuscator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 11:10am

Copy link

coderabbitai bot commented Apr 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces significant refactoring and modernization across the codebase. The CSS obfuscation logic is overhauled to utilize the css-seasoning and lightningcss-wasm libraries, replacing custom parsing and manual class name generation. Several deprecated configuration options are removed or marked as deprecated, with new options and types introduced for improved flexibility and clarity. The test suites are updated to align with these changes, with some tests removed or rewritten. New configuration files for release automation (release.config.cjs, .github/workflows/release.yml) and formatting (biome.json) are added, while Prettier configuration files are removed. Documentation is updated to reflect breaking changes and migration guidance for version 3.

Changes

File(s) Change Summary
.github/workflows/auto_test.yml Updated to use actions/checkout@v4 instead of v3.
.github/workflows/release.yml Added new GitHub Actions workflow for releases, supporting semantic-release and npm provenance.
.prettierignore, .prettierrc Removed Prettier ignore and configuration files.
biome.json Added new Biome configuration for formatting and linting.
release.config.cjs Added semantic-release configuration for main and beta branches.
tsconfig.json Excluded release.config.cjs from TypeScript compilation.
package.json Downgraded version, updated scripts, replaced/added dependencies for CSS and release automation.
README.md Updated for v3 release: breaking changes, new options, migration notes, TailwindCSS v4 support.
docs/upgrade-to-v3.md Added upgrade guide for v3, detailing breaking changes and configuration migration.
bin/cli.mjs Added newline at end of file.
src/config.ts Updated default options, deprecated old config fields, changed defaults for generatorSeed and enableJsAst.
src/types.ts Refactored types: imported from css-seasoning, deprecated old fields, removed some options, updated obfuscateMode.
src/utils.ts Refactored: unified path filtering, modularized logging, overhauled conversion table handling, removed RNG-based functions, improved file utilities.
src/handlers/css.ts Major refactor: removed manual parsing, integrated css-seasoning/lightningcss-wasm, restructured obfuscation logic, removed old exports.
src/handlers/html.ts Removed deprecated HTML tag extraction functions, improved obfuscation with CSS unescaping, updated export style.
src/handlers/js.ts, src/handlers/js-ast.ts Converted to exported arrow functions, improved type imports, minor formatting.
src/index.ts Refactored to async flow, modernized options, removed deprecated logic, improved logging and type safety.
src/__tests__/html.test.ts Removed tests for deprecated HTML functions, updated selector keys to escaped form.
src/__tests__/js-ast.test.ts Improved type imports, converted functions to constants, updated variable declarations.
src/__tests__/js.test.ts Added new tests for searchForwardComponent (see note below).
src/__tests__/utils.test.ts Removed tests for deprecated/random string functions, updated imports, minor formatting.
src/handlers/css.test.ts, src/handlers/js.test.ts Deleted: removed comprehensive CSS and JS test suites for deprecated or refactored logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Config
    participant CSSObfuscator
    participant ConversionTables
    participant FileSystem
    participant HTMLObfuscator
    participant JSObfuscator

    User->>CLI: Run obfuscateCli()
    CLI->>Config: Load and merge options
    CLI->>CSSObfuscator: obfuscateCssFiles (async)
    CSSObfuscator->>FileSystem: Find CSS files (with whitelist/blacklist)
    CSSObfuscator->>ConversionTables: Load and merge conversion tables
    CSSObfuscator->>FileSystem: Write obfuscated CSS/minified CSS
    CSSObfuscator->>CLI: Return conversionTables
    CLI->>FileSystem: Write conversionTables to conversion.json
    CLI->>HTMLObfuscator: Replace selectors in HTML files
    CLI->>JSObfuscator: Replace selectors in JS files
    CLI->>User: Done
Loading

Possibly related PRs

  • soranoo/next-css-obfuscator#68: Introduces the same release workflow, removes Prettier config, and updates documentation for TailwindCSS v4 support, directly related to this PR's release automation and documentation changes.

Poem

A bunny hopped through fields of code,
With carrots and configs in its load.
Out with old, in with the new—
CSS now seasoned, lightning too!
Prettier gone, Biome in place,
Release flows set at a rapid pace.
Upgraded and tidy, let’s hop to v3’s embrace! 🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76d2834 and 9f1c52c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (25)
  • .github/workflows/auto_test.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .prettierignore (0 hunks)
  • .prettierrc (0 hunks)
  • README.md (12 hunks)
  • bin/cli.mjs (1 hunks)
  • biome.json (1 hunks)
  • docs/upgrade-to-v3.md (1 hunks)
  • package.json (4 hunks)
  • release.config.cjs (1 hunks)
  • src/__tests__/html.test.ts (6 hunks)
  • src/__tests__/js-ast.test.ts (39 hunks)
  • src/__tests__/js.test.ts (1 hunks)
  • src/__tests__/utils.test.ts (2 hunks)
  • src/config.ts (1 hunks)
  • src/handlers/css.test.ts (0 hunks)
  • src/handlers/css.ts (1 hunks)
  • src/handlers/html.ts (4 hunks)
  • src/handlers/js-ast.ts (6 hunks)
  • src/handlers/js.test.ts (0 hunks)
  • src/handlers/js.ts (7 hunks)
  • src/index.ts (3 hunks)
  • src/types.ts (1 hunks)
  • src/utils.ts (17 hunks)
  • tsconfig.json (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@soranoo soranoo closed this Apr 25, 2025
@soranoo soranoo deleted the ci-upgrade-release-version branch April 25, 2025 11:11
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.

2 participants