Skip to content

v3.0.0 #74

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

Merged
merged 33 commits into from
May 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
16a4541
refactor: Move test files to `__tests__` directory
soranoo Apr 20, 2025
6b5f000
refactor(test): Moves test file to the `__tests__` directory
soranoo Apr 20, 2025
d38b38f
chore: Migrates from Prettier to Biome
soranoo Apr 20, 2025
0afd780
feat: Upgrades to v3 with new CSS transformation
soranoo Apr 20, 2025
10e0ac1
refactor: Remove deprecated functions and streamline path filtering l…
soranoo Apr 20, 2025
3c1ca32
refactor(css): Refactor CSS obfuscation with css-seasoning
soranoo Apr 20, 2025
7cb985d
fix(html): fix incorrect html class name truncation
soranoo Apr 21, 2025
a290b14
refactor: Simplify and export utility functions
soranoo Apr 21, 2025
668a5f6
feat: v3 migration with TailwindCSS 4 support
soranoo Apr 21, 2025
afe1bff
refactor: Standardize code formatting and improve readability across …
soranoo Apr 21, 2025
5492d56
refactor: Remove unused dependency 'recoverable-random' from package …
soranoo Apr 21, 2025
b43a194
feat: Enables semantic release for automated publishing
soranoo Apr 21, 2025
f517839
fix: fix html tests
soranoo Apr 21, 2025
e33c10f
refactor: Update string interpolation to use double quotes for consis…
soranoo Apr 21, 2025
38d4ac2
chore: Remove version field from package.json
soranoo Apr 21, 2025
8954a50
ci: Update semantic release configuration and dependencies
soranoo Apr 21, 2025
3002e5c
ci: Update Node.js setup in release workflow and change npm install t…
soranoo Apr 21, 2025
0ec8131
ci: Update GitHub Actions workflows to use actions/checkout@v4 and np…
soranoo Apr 21, 2025
935dde8
ci: Update release workflow to handle push and pull request events, a…
soranoo Apr 25, 2025
670ce7d
chore(release): 1.0.0-beta.1 [skip ci]
semantic-release-bot Apr 25, 2025
2da79e5
ci: Update release workflow to edit initial version and use npm scrip…
soranoo Apr 25, 2025
8072e37
chore(release): 3.0.0-beta.3 [skip ci]
semantic-release-bot Apr 25, 2025
7ccc78c
chore: update dependencies; disable GitHub release integration
soranoo May 30, 2025
32952bf
feat: support ident prefix/suffix options
soranoo May 30, 2025
b26b6cd
minor: formatting
soranoo May 30, 2025
cf7f33a
minor: CRLF to LF
soranoo May 30, 2025
63800ef
chore(release): 3.0.0-beta.4 [skip ci]
semantic-release-bot May 30, 2025
3d6035d
fix: update key names in loadConversionTables for consistency
soranoo May 30, 2025
88c2a54
chore(release): 3.0.0-beta.5 [skip ci]
semantic-release-bot May 30, 2025
0d6ebeb
deps: update css-seasoning dependency to version 1.9.0
soranoo May 30, 2025
5278bac
Merge branch 'beta' of https://github.com/soranoo/next-css-obfuscator…
soranoo May 30, 2025
7a54d90
minor(demo): update demo to version 3.0.0-beta.5 and add type annotat…
soranoo May 31, 2025
82e440e
docs: remove caution note about TailwindCSS 4 support from README
soranoo May 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/auto_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Tests
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -21,7 +21,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install dependencie using the runners shell
- name: Install dependencies
Expand All @@ -30,4 +30,3 @@ jobs:
# Runs test using the runners shell
- name: Test
run: npm run test

48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
branches:
- main
- beta
pull_request:
branches:
- main
- beta

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: npm install

- name: Build NPM package
run: npm run build

- name: Edit First Release Version
run: sed -i 's/\( FIRST_RELEASE\) = "1.0.0"/\1 = "3.0.0"/' node_modules/semantic-release/lib/definitions/constants.js

- name: Edit First Prerelease Version
run: sed -i 's/\( FIRSTPRERELEASE\) = "1"/\1 = "3"/' node_modules/semantic-release/lib/definitions/constants.js
Comment on lines +31 to +35
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider a more robust approach for version configuration.

The sed commands modifying semantic-release internal constants are fragile and could break with package updates. Consider using semantic-release configuration options instead.

A more maintainable approach would be to configure this in release.config.cjs:

module.exports = {
  branches: [
    'main',
    { name: 'beta', prerelease: true }
  ],
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    ['@semantic-release/npm', {
      tarballDir: 'dist'
    }],
    ['@semantic-release/github', {
      assets: 'dist/*.tgz'
    }]
  ],
  tagFormat: 'v${version}',
  preset: 'angular'
};

Then remove the sed commands from the workflow.

🤖 Prompt for AI Agents
In .github/workflows/release.yml around lines 31 to 35, the sed commands
directly modify semantic-release internal constants, which is fragile and prone
to break with updates. Instead, remove these sed commands and configure the
versioning and prerelease behavior properly in a release.config.cjs file by
specifying branches, plugins, tagFormat, and preset options as per
semantic-release documentation. This approach is more maintainable and less
error-prone.


- name: Create Release
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release

- name: Dry Run Release
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run semantic-release --dry-run
5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

177 changes: 116 additions & 61 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

import { obfuscateCli } from "../dist/index.js";

obfuscateCli();
obfuscateCli();
73 changes: 73 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": [
"node_modules",
".next",
"packages/tsconfig",
"demos",
"coverage",
"dist"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"lineWidth": 80,
"indentWidth": 2,
"lineEnding": "lf"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,

"complexity": {
"noUselessTypeConstraint": "error",
"useLiteralKeys": "error",
"useOptionalChain": "error",
"noForEach": "off"
},
"correctness": {
"noUnusedVariables": "info",
"useArrayLiterals": "error"
},
"style": {
"noInferrableTypes": "error",
"noNamespace": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "error",
"useConsistentArrayType": "error",
"useForOf": "error",
"useShorthandFunctionType": "error",
"useImportType": "error"
},
"suspicious": {
"noDebugger": "info",
"noEmptyBlockStatements": "error",
"noExplicitAny": "error",
"noExtraNonNullAssertion": "error",
"noMisleadingInstantiator": "error",
"noUnsafeDeclarationMerging": "error",
"useAwait": "warn",
"useNamespaceKeyword": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always",
"trailingCommas": "all"
}
}
}
1 change: 1 addition & 0 deletions demos/next14-app-router/next-css-obfuscator.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {import("next-css-obfuscator").Options} */
module.exports = {
enable: true,
mode: "random", // random | simplify
Expand Down
Loading