diff --git a/.cursor/rules/dev-standard.mdc b/.cursor/rules/dev-standard.mdc index e45ff299043..53d0543562f 100644 --- a/.cursor/rules/dev-standard.mdc +++ b/.cursor/rules/dev-standard.mdc @@ -18,6 +18,11 @@ Apache Superset is a data visualization platform with Flask/Python backend and R - **NO Enzyme** - Use React Testing Library/Jest (Enzyme fully removed) - **Use @superset-ui/core** - Don't import Ant Design directly +### Package Manager Migration +- **Use Bun instead of npm** - The frontend uses Bun as the package manager (e.g., `bun install`, `bun run build`) +- **Use Turborepo for builds** - Use `bun run build:packages` to build packages with caching +- **Use Changesets for versioning** - Use `bun run changeset:add` to track version changes + ### Testing Strategy Migration - **Prefer unit tests** over integration tests - **Prefer integration tests** over Cypress end-to-end tests diff --git a/.devcontainer/setup-dev.sh b/.devcontainer/setup-dev.sh index f8521189009..4343266015e 100755 --- a/.devcontainer/setup-dev.sh +++ b/.devcontainer/setup-dev.sh @@ -21,9 +21,15 @@ curl -LsSf https://astral.sh/uv/install.sh | sh echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc -# Install Claude Code CLI via npm +# Install Bun +echo "📦 Installing Bun..." +curl -fsSL https://bun.sh/install | bash +echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.bashrc +echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.zshrc + +# Install Claude Code CLI echo "🤖 Installing Claude Code..." -npm install -g @anthropic-ai/claude-code +~/.bun/bin/bun install -g @anthropic-ai/claude-code # Make the start script executable chmod +x .devcontainer/start-superset.sh diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index f1aa42b686f..0cfc86ed0d3 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -38,15 +38,15 @@ jobs: echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR" >>"${GITHUB_ENV}" echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >>"${GITHUB_ENV}" brew install norwoodj/tap/helm-docs - - name: Setup Node.js - uses: actions/setup-node@v6 + - name: Install Bun + uses: oven-sh/setup-bun@v2 with: - node-version: '20' + bun-version: latest - name: Install Frontend Dependencies run: | cd superset-frontend - npm ci + bun install --frozen-lockfile - name: Install Docs Dependencies run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96d43df857c..906284baa5c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v6 with: - # pulls all commits (needed for lerna / semantic release to correctly version) + # pulls all commits (needed for changesets to correctly version) fetch-depth: 0 - name: Get tags and filter trigger tags run: | @@ -66,7 +66,7 @@ jobs: - name: Build packages if: env.HAS_TAGS working-directory: ./superset-frontend - run: bun run turbo:build + run: bun run build:packages - name: Configure npm and git if: env.HAS_TAGS diff --git a/.github/workflows/superset-frontend.yml b/.github/workflows/superset-frontend.yml index e0e56524cbc..864d51b0f0b 100644 --- a/.github/workflows/superset-frontend.yml +++ b/.github/workflows/superset-frontend.yml @@ -143,7 +143,7 @@ jobs: - name: tsc run: | docker run --rm $TAG bash -c \ - "bun install && bun run turbo:build && bun run type" + "bun install && bun run build:packages && bun run type" validate-frontend: needs: frontend-build @@ -161,7 +161,7 @@ jobs: - name: Build Plugins Packages run: | docker run --rm $TAG bash -c \ - "bun run turbo:build" + "bun run build:packages" - name: Build Plugins Storybook run: | diff --git a/.github/workflows/tech-debt.yml b/.github/workflows/tech-debt.yml index aaa2ae4f6a6..7947f837950 100644 --- a/.github/workflows/tech-debt.yml +++ b/.github/workflows/tech-debt.yml @@ -29,19 +29,19 @@ jobs: - name: Checkout Repository uses: actions/checkout@v6 - - name: Set up Node.js - uses: actions/setup-node@v6 + - name: Install Bun + uses: oven-sh/setup-bun@v2 with: - node-version-file: './superset-frontend/.nvmrc' + bun-version: latest - name: Install Dependencies - run: npm ci + run: bun install --frozen-lockfile working-directory: ./superset-frontend - name: Run Script env: SPREADSHEET_ID: "1oABNnzxJYzwUrHjr_c9wfYEq9dFL1ScVof9LlaAdxvo" SERVICE_ACCOUNT_KEY: ${{ secrets.GSHEET_KEY }} - run: npm run lint-stats + run: bun run lint-stats continue-on-error: true working-directory: ./superset-frontend diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc34e39bc24..f75d21b5436 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: exclude: ^helm/superset/templates/ - id: debug-statements - id: end-of-file-fixer - exclude: .*/lerna\.json$|^docs/static/img/logos/ + exclude: ^docs/static/img/logos/ - id: trailing-whitespace exclude: ^.*\.(snap) args: ["--markdown-linebreak-ext=md"] diff --git a/AGENTS.md b/AGENTS.md index 16f085e4e86..e92ed3e2faa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,6 +34,11 @@ Common pre-commit failures: - **Use antd theming tokens** - Prefer antd tokens over legacy theming tokens - **Avoid custom css and styles** - Follow antd best practices and avoid styling and custom CSS whenever possible +### Package Manager Migration +- **Use Bun instead of npm** - The frontend uses Bun as the package manager (e.g., `bun install`, `bun run build`) +- **Use Turborepo for builds** - Use `bun run build:packages` to build packages with caching +- **Use Changesets for versioning** - Use `bun run changeset:add` to track version changes + ### Testing Strategy Migration - **Prefer unit tests** over integration tests - **Prefer integration tests** over end-to-end tests @@ -154,22 +159,22 @@ The Developer Portal auto-generates MDX documentation from Storybook stories. ** ### Running Tests ```bash # Frontend -npm run test # All tests -npm run test -- filename.test.tsx # Single file +bun run test # All tests +bun run test -- filename.test.tsx # Single file # E2E Tests (Playwright - NEW) -npm run playwright:test # All Playwright tests -npm run playwright:ui # Interactive UI mode -npm run playwright:headed # See browser during tests -npx playwright test tests/auth/login.spec.ts # Single file -npm run playwright:debug tests/auth/login.spec.ts # Debug specific file +bun run playwright:test # All Playwright tests +bun run playwright:ui # Interactive UI mode +bun run playwright:headed # See browser during tests +bun x playwright test tests/auth/login.spec.ts # Single file +bun run playwright:debug tests/auth/login.spec.ts # Debug specific file # E2E Tests (Cypress - DEPRECATED) cd superset-frontend/cypress-base npm run cypress-run-chrome # All Cypress tests (headless) npm run cypress-debug # Interactive Cypress UI -# Backend +# Backend pytest # All tests pytest tests/unit_tests/specific_test.py # Single file pytest tests/unit_tests/ # Directory @@ -190,7 +195,8 @@ curl -f http://localhost:8088/health || echo "❌ Setup required - see https://s "It appears you aren't set up properly. Please refer to the [Working with LLMs](https://superset.apache.org/docs/contributing/development#working-with-llms) section in the development docs for setup instructions." **Key Project Files:** -- `superset-frontend/package.json` - Frontend build scripts (`npm run dev` on port 9000, `npm run test`, `npm run lint`) +- `superset-frontend/package.json` - Frontend build scripts (`bun run dev` on port 9000, `bun run test`, `bun run lint`) +- `superset-frontend/turbo.json` - Turborepo build configuration for packages/plugins - `pyproject.toml` - Python tooling (ruff, mypy configs) - `requirements/` folder - Python dependencies (base.txt, development.txt) diff --git a/RELEASING/README.md b/RELEASING/README.md index af001ad6af9..cf6af10f510 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -391,7 +391,7 @@ RSA key verified There are also additional support scripts leveraging this to make it easy for those downloading a release to test it in-situ. You can do either of the following to validate these release assets: -- `cd` into `superset-frontend` and run `npm run validate-release` +- `cd` into `superset-frontend` and run `bun run validate-release` - `cd` into `RELEASES` and run `./validate_this_release.sh` ## Publishing a successful release @@ -444,9 +444,9 @@ Create the distribution ```bash cd superset-frontend/ -npm ci && npm run build +bun install --frozen-lockfile && bun run build # Compile translations for the frontend -npm run build-translation +bun run build-translation cd ../ @@ -524,23 +524,171 @@ generated images. **NOTE:** If the docker image isn't built, you'll need to run this [GH action](https://github.com/apache/superset/actions/workflows/tag-release.yml) where you provide it the tag sha. -### Npm Release +### Npm Package Release -You might want to publish the latest @superset-ui release to npm +Superset publishes `@superset-ui/*` and `@apache-superset/*` packages to npm. These are considered +"convenience releases" (not official ASF releases) and can be published independently of Superset releases. + +Superset uses [Changesets](https://github.com/changesets/changesets) for version management and +[Turborepo](https://turbo.build/) for building packages. + +#### Two Publishing Workflows + +**1. Periodic Publishing (on master)** - For ongoing development, packages are versioned based on +accumulated changesets and published periodically by maintainers. + +**2. Release Publishing (on release branches)** - When cutting a Superset release, packages are +synced to match the Superset version (e.g., all packages become 6.1.0). + +--- + +#### Workflow 1: Periodic Publishing on Master + +##### During Development: Adding Changesets + +When a PR changes publishable packages, the author should add a changeset: ```bash -cd superset/superset-frontend +cd superset-frontend +bun run changeset:add ``` -An automated GitHub action will run and generate a new tag, which will contain a version number provided as a parameter. +This interactive CLI asks: +1. Which packages changed? (multi-select) +2. Bump type? (major / minor / patch) +3. Summary for changelog + +A markdown file is created in `.changeset/` describing the change. + +##### Periodic Publishing (Maintainers) + +When ready to publish accumulated changes: ```bash -export GH_TOKEN={GITHUB_TOKEN} -npx lerna version {VERSION} --conventional-commits --create-release github --no-private --yes --message {COMMIT_MESSAGE} +cd superset-frontend + +# 1. Check what's pending +bun run changeset:status + +# 2. Bump versions (consumes changesets, updates CHANGELOGs) +bun run changeset:version + +# 3. Review and commit +git diff +git add . +git commit -m "chore(packages): version packages" + +# 4. Dry run to verify +bun run publish:packages:dry + +# 5. Publish to npm +bun run publish:packages + +# 6. Push the version commit +git push ``` -This action will publish the specified version to npm registry. +--- + +#### Workflow 2: Release Branch Publishing + +When cutting a Superset release (e.g., 6.1.0), sync all packages to match: + +##### For Release Candidates ```bash -npx lerna publish from-package --yes +cd superset-frontend + +# Sync all packages to RC version +bun run sync-versions 6.1.0-rc.1 + +# Review changes +git diff + +# Commit +git add . +git commit -m "chore(packages): bump versions to 6.1.0-rc.1" + +# Dry run +bun run publish:packages:dry + +# Publish (goes to npm with version tag, not @latest) +bun run publish:packages ``` + +##### For Final Release + +After the vote passes: + +```bash +cd superset-frontend + +# Sync all packages to final version +bun run sync-versions 6.1.0 + +# Commit +git add . +git commit -m "chore(packages): bump versions to 6.1.0" + +# Publish +bun run publish:packages +``` + +##### Dry Run + +Always preview before publishing: + +```bash +# Preview version sync without making changes +bun run sync-versions:dry 6.1.0 + +# Preview what would be published +bun run publish:packages:dry +``` + +--- + +#### Quick Reference + +| Task | Command | +|------|---------| +| Add a changeset (during PR) | `bun run changeset:add` | +| Check pending changes | `bun run changeset:status` | +| Bump versions (from changesets) | `bun run changeset:version` | +| Sync versions (for releases) | `bun run sync-versions ` | +| Sync versions (dry run) | `bun run sync-versions:dry ` | +| Build packages | `bun run build:packages` | +| Preview publish | `bun run publish:packages:dry` | +| Publish to npm | `bun run publish:packages` | + +--- + +#### npm Credentials + +To publish, you need npm credentials with publish access to `@superset-ui` and `@apache-superset` scopes. + +```bash +# Login to npm +npm login + +# Verify access +npm whoami +npm access ls-packages +``` + +Contact a PMC member if you need publish access granted. + +--- + +#### Troubleshooting + +**"You do not have permission to publish"** +- Ensure you're logged in: `npm whoami` +- Request access from a PMC member + +**"Version already exists"** +- The version was already published; bump to a new version + +**Build failures** +- Run `bun run build:packages:force` to rebuild from scratch +- Check for TypeScript errors: `bun run turbo:type-check` diff --git a/docs/developer_portal/contributing/development-setup.md b/docs/developer_portal/contributing/development-setup.md index a543eb24442..c2b69cc2cf1 100644 --- a/docs/developer_portal/contributing/development-setup.md +++ b/docs/developer_portal/contributing/development-setup.md @@ -348,10 +348,10 @@ curl -f http://localhost:8088/health && echo "✅ Superset ready" ```bash # Frontend development cd superset-frontend -npm run dev # Development server on http://localhost:9000 -npm run test # Run all tests -npm run test -- filename.test.tsx # Run single test file -npm run lint # Linting and type checking +bun run dev # Development server on http://localhost:9000 +bun run test # Run all tests +bun run test -- filename.test.tsx # Run single test file +bun run lint # Linting and type checking # Backend validation pre-commit run mypy # Type checking @@ -481,19 +481,36 @@ Frontend assets (TypeScript, JavaScript, CSS, and images) must be compiled in or #### Prerequisite -##### nvm and node +##### Bun (Recommended) -First, be sure you are using the following versions of Node.js and npm: +Superset uses [Bun](https://bun.sh) as its JavaScript runtime and package manager. Bun is significantly faster than npm (up to 10x faster installs) and includes native TypeScript support. -- `Node.js`: Version 20 -- `npm`: Version 10 +**Install Bun:** + +```bash +# macOS, Linux, or WSL +curl -fsSL https://bun.sh/install | bash + +# Or using Homebrew (macOS) +brew install oven-sh/bun/bun + +# Verify installation +bun --version +``` + +##### Node.js (Alternative) + +If you prefer Node.js, ensure you have: + +- `Node.js`: Version 20+ +- `npm`: Version 10+ We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage your node environment: ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash -in case it shows '-bash: nvm: command not found' +# In case it shows '-bash: nvm: command not found' export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion @@ -503,13 +520,9 @@ nvm install --lts nvm use --lts ``` -Or if you use the default macOS starting with Catalina shell `zsh`, try: - -```zsh -sh -c "$(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh)" -``` - -For those interested, you may also try out [avn](https://github.com/nvm-sh/nvm#deeper-shell-integration) to automatically switch to the node version that is required to run Superset frontend. +:::note +While Node.js/npm will work, the project is optimized for Bun. CI/CD pipelines and Docker builds use Bun. +::: #### Install dependencies @@ -519,11 +532,14 @@ Install third-party dependencies listed in `package.json` via: # From the root of the repository cd superset-frontend -# Install dependencies from `package-lock.json` -npm ci +# Install dependencies from `bun.lock` +bun install + +# Or with frozen lockfile (recommended for CI/reproducible builds) +bun install --frozen-lockfile ``` -Note that Superset uses [Scarf](https://docs.scarf.sh) to capture telemetry/analytics about versions being installed, including the `scarf-js` npm package and an analytics pixel. As noted elsewhere in this documentation, Scarf gathers aggregated stats for the sake of security/release strategy and does not capture/retain PII. [You can read here](https://docs.scarf.sh/package-analytics/) about the `scarf-js` package, and various means to opt out of it, but you can opt out of the npm package _and_ the pixel by setting the `SCARF_ANALYTICS` environment variable to `false` or opt out of the pixel by adding this setting in `superset-frontent/package.json`: +Note that Superset uses [Scarf](https://docs.scarf.sh) to capture telemetry/analytics about versions being installed, including the `scarf-js` package and an analytics pixel. As noted elsewhere in this documentation, Scarf gathers aggregated stats for the sake of security/release strategy and does not capture/retain PII. [You can read here](https://docs.scarf.sh/package-analytics/) about the `scarf-js` package, and various means to opt out of it, but you can opt out of the package _and_ the pixel by setting the `SCARF_ANALYTICS` environment variable to `false` or opt out of the pixel by adding this setting in `superset-frontend/package.json`: ```json // your-package/package.json @@ -540,9 +556,9 @@ Note that Superset uses [Scarf](https://docs.scarf.sh) to capture telemetry/anal There are three types of assets you can build: -1. `npm run build`: the production assets, CSS/JSS minified and optimized -2. `npm run dev-server`: local development assets, with sourcemaps and hot refresh support -3. `npm run build-instrumented`: instrumented application code for collecting code coverage from Cypress tests +1. `bun run build`: the production assets, CSS/JSS minified and optimized +2. `bun run dev-server`: local development assets, with sourcemaps and hot refresh support +3. `bun run build-instrumented`: instrumented application code for collecting code coverage from E2E tests If while using the above commands you encounter an error related to the limit of file watchers: @@ -591,7 +607,7 @@ So a typical development workflow is the following: 2. in parallel, run the Webpack dev server locally on port `9000`,
```bash - npm run dev-server + bun run dev-server ``` 3. access `http://localhost:9000` (the Webpack server, _not_ Flask) in your web browser. This will use the hot-reloading front-end assets from the Webpack development server while redirecting back-end queries to Flask/Superset: your changes on Superset codebase — either front or back-end — will then be reflected live in the browser. @@ -600,36 +616,52 @@ It's possible to change the Webpack server settings: ```bash # Start the dev server at http://localhost:9000 -npm run dev-server +bun run dev-server # Run the dev server on a non-default port -npm run dev-server -- --port=9001 +bun run dev-server -- --port=9001 # Proxy backend requests to a Flask server running on a non-default port -npm run dev-server -- --env=--supersetPort=8081 +bun run dev-server -- --env=--supersetPort=8081 # Proxy to a remote backend but serve local assets -npm run dev-server -- --env=--superset=https://superset-dev.example.com +bun run dev-server -- --env=--superset=https://superset-dev.example.com ``` The `--superset=` option is useful in case you want to debug a production issue or have to setup Superset behind a firewall. It allows you to run Flask server in another environment while keep assets building locally for the best developer experience. -#### Other npm commands +#### Other bun commands -Alternatively, there are other NPM commands you may find useful: +Alternatively, there are other commands you may find useful: -1. `npm run build-dev`: build assets in development mode. -2. `npm run dev`: built dev assets in watch mode, will automatically rebuild when a file changes +1. `bun run build-dev`: build assets in development mode. +2. `bun run dev`: built dev assets in watch mode, will automatically rebuild when a file changes +3. `bun run build:packages`: build all packages/plugins with Turborepo (intelligent caching) +4. `bun run build:packages:force`: rebuild all packages ignoring cache #### Docker (docker compose) See docs [here](https://superset.apache.org/docs/installation/docker-compose) -#### Updating NPM packages +#### Updating packages -Use npm in the prescribed way, making sure that -`superset-frontend/package-lock.json` is updated according to `npm`-prescribed -best practices. +Use bun to add or update packages: + +```bash +# Add a new package +bun add package-name + +# Add a dev dependency +bun add -d package-name + +# Update a package +bun update package-name + +# Update all packages +bun update +``` + +The `bun.lock` file will be automatically updated. #### Feature flags @@ -792,13 +824,13 @@ We use [Jest](https://jestjs.io/) and [React Testing Library](https://testing-li ```bash cd superset-frontend -npm run test +bun run test ``` To run a single test file: ```bash -npm run test -- path/to/file.js +bun run test -- path/to/file.js ``` #### Known Issues and Workarounds @@ -983,7 +1015,7 @@ Superset includes a [Storybook](https://storybook.js.org/) to preview the layout ```bash cd superset-frontend -npm run storybook +bun run storybook ``` When contributing new React components to Superset, please try to add a Story alongside the component's `jsx/tsx` file. diff --git a/docs/developer_portal/contributing/howtos.md b/docs/developer_portal/contributing/howtos.md index e4469dfb07a..5a5eaac5757 100644 --- a/docs/developer_portal/contributing/howtos.md +++ b/docs/developer_portal/contributing/howtos.md @@ -36,8 +36,8 @@ To set up your local environment for documentation development: ```bash cd docs -npm install -npm run start +bun install +bun run start ``` The site will be available at http://localhost:3000 @@ -47,8 +47,8 @@ The site will be available at http://localhost:3000 To create a production build: ```bash -npm run build -npm run serve # Test the build locally +bun run build +bun run serve # Test the build locally ``` ### Deployment @@ -61,15 +61,14 @@ Visualization plugins allow you to add custom chart types to Superset. They are ### Prerequisites -- Node.js 18+ -- npm or yarn +- Bun (recommended) or Node.js 20+ - A local Superset development environment ### Creating a simple Hello World viz plugin 1. **Install the Superset Yeoman generator**: ```bash -npm install -g @superset-ui/generator-superset +bun add -g @superset-ui/generator-superset ``` 2. **Create a new plugin**: @@ -89,14 +88,14 @@ The generator creates a complete plugin structure with TypeScript, React compone 5. **Test your plugin locally**: ```bash -npm run dev +bun run dev ``` 6. **Link to your local Superset**: ```bash -npm link +bun link # In your Superset frontend directory: -npm link superset-plugin-chart-hello-world +bun link superset-plugin-chart-hello-world ``` 7. **Import and register in Superset**: @@ -147,16 +146,16 @@ Run frontend tests using Jest: cd superset-frontend # Run all tests -npm run test +bun run test # Run with coverage -npm run test -- --coverage +bun run test -- --coverage # Run in watch mode -npm run test -- --watch +bun run test -- --watch # Run specific test file -npm run test -- MyComponent.test.tsx +bun run test -- MyComponent.test.tsx ``` ### E2E Integration Testing @@ -172,26 +171,26 @@ Playwright is our new E2E testing framework, gradually replacing Cypress. cd superset-frontend # Run all Playwright tests -npm run playwright:test -# or: npx playwright test +bun run playwright:test +# or: bun x playwright test # Run with interactive UI for debugging -npm run playwright:ui -# or: npx playwright test --ui +bun run playwright:ui +# or: bun x playwright test --ui # Run in headed mode (see browser) -npm run playwright:headed -# or: npx playwright test --headed +bun run playwright:headed +# or: bun x playwright test --headed # Run specific test file -npx playwright test tests/auth/login.spec.ts +bun x playwright test tests/auth/login.spec.ts # Run with debug mode (step through tests) -npm run playwright:debug tests/auth/login.spec.ts -# or: npx playwright test --debug tests/auth/login.spec.ts +bun run playwright:debug tests/auth/login.spec.ts +# or: bun x playwright test --debug tests/auth/login.spec.ts # Generate test report -npm run playwright:report +bun run playwright:report ``` #### Cypress (DEPRECATED - will be removed) @@ -290,7 +289,7 @@ pybabel init -i superset/translations/messages.pot -d superset/translations -l d pybabel extract -F babel.cfg -o superset/translations/messages.pot -k lazy_gettext superset # Extract JavaScript strings -npm run build-translation +bun run build-translation ``` ### Updating language files @@ -305,7 +304,7 @@ pybabel update -i superset/translations/messages.pot -d superset/translations ```bash # Frontend cd superset-frontend -npm run build-translation +bun run build-translation # Backend pybabel compile -d superset/translations @@ -340,22 +339,22 @@ We use a hybrid linting approach combining OXC (Oxidation Compiler) for standard cd superset-frontend # Run both OXC and custom rules -npm run lint:full +bun run lint:full # Run OXC linter only (faster for most checks) -npm run lint +bun run lint # Fix auto-fixable issues with OXC -npm run lint-fix +bun run lint-fix # Run custom rules checker only -npm run check:custom-rules +bun run check:custom-rules # Run tsc (typescript) checks -npm run type +bun run type # Format with Prettier -npm run prettier +bun run prettier ``` #### Architecture @@ -481,15 +480,15 @@ alias sfront='cd superset-frontend && npm run dev-server' ## Common Issues and Solutions -### Node/npm Issues +### Bun/Node Issues ```bash -# Clear npm cache -npm cache clean --force +# Clear bun cache +bun pm cache rm # Reinstall dependencies -rm -rf node_modules package-lock.json -npm install +rm -rf node_modules bun.lock +bun install ``` ### Python Environment Issues diff --git a/docs/developer_portal/contributing/release-process.md b/docs/developer_portal/contributing/release-process.md index 32d375b2943..92f8203b7ab 100644 --- a/docs/developer_portal/contributing/release-process.md +++ b/docs/developer_portal/contributing/release-process.md @@ -270,6 +270,26 @@ docker tag apache/superset:X.Y.Z apache/superset:latest docker push apache/superset:latest ``` +#### Publish npm Packages + +Superset publishes frontend packages to npm for use by plugin developers and embedders. +See [RELEASING/README.md](https://github.com/apache/superset/blob/master/RELEASING/README.md#npm-package-publishing) +for the complete npm publishing guide. + +```bash +cd superset-frontend + +# Sync package versions to release version +bun run sync-versions X.Y.Z + +# Review and commit version changes +git diff +git add -A && git commit -m "chore(packages): bump versions to X.Y.Z" + +# Build and publish (requires npm auth) +bun run publish:packages +``` + ### 6. Post-Release Tasks #### Update Documentation @@ -277,7 +297,7 @@ docker push apache/superset:latest # Update docs version cd docs # Update docusaurus.config.js with new version -npm run build +bun run build ``` #### Announcement Email @@ -461,6 +481,7 @@ Credit: - [Apache Release Policy](https://www.apache.org/legal/release-policy.html) - [Superset Release History](https://github.com/apache/superset/releases) - [Version Strategy Discussion](https://github.com/apache/superset/discussions) +- [npm Publishing Guide](https://github.com/apache/superset/blob/master/RELEASING/README.md#npm-package-publishing) - Detailed instructions for publishing frontend packages ### Tools - [Release Scripts](https://github.com/apache/superset/tree/master/scripts/release) diff --git a/docs/developer_portal/contributing/submitting-pr.md b/docs/developer_portal/contributing/submitting-pr.md index 18479ae1cb8..ca57e605f57 100644 --- a/docs/developer_portal/contributing/submitting-pr.md +++ b/docs/developer_portal/contributing/submitting-pr.md @@ -63,7 +63,7 @@ edit files... # Run tests pytest tests/unit_tests/ -cd superset-frontend && npm run test +cd superset-frontend && bun run test # Run linting pre-commit run --all-files @@ -226,7 +226,7 @@ pytest tests/integration_tests/ -v #### Frontend Test Failures ```bash cd superset-frontend -npm run test -- --coverage +bun run test -- --coverage ``` #### Linting Failures diff --git a/docs/developer_portal/extensions/development.md b/docs/developer_portal/extensions/development.md index e26c9b00e51..fd1d0417d66 100644 --- a/docs/developer_portal/extensions/development.md +++ b/docs/developer_portal/extensions/development.md @@ -220,7 +220,7 @@ LOCAL_EXTENSIONS = [ ] ``` -This instructs Superset to load and serve extensions directly from disk, so you can iterate quickly. Running `superset-extensions dev` watches for file changes and rebuilds assets automatically, while the Webpack development server (started separately with `npm run dev-server`) serves updated files as soon as they're modified. This enables immediate feedback for React components, styles, and other frontend code. Changes to backend files are also detected automatically and immediately synced, ensuring that both frontend and backend updates are reflected in your development environment. +This instructs Superset to load and serve extensions directly from disk, so you can iterate quickly. Running `superset-extensions dev` watches for file changes and rebuilds assets automatically, while the Webpack development server (started separately with `bun run dev-server`) serves updated files as soon as they're modified. This enables immediate feedback for React components, styles, and other frontend code. Changes to backend files are also detected automatically and immediately synced, ensuring that both frontend and backend updates are reflected in your development environment. Example output when running in development mode: @@ -285,7 +285,7 @@ InteractiveMyComponent.argTypes = { ### How Documentation is Generated -When the docs site is built (`yarn start` or `yarn build` in the `docs/` directory): +When the docs site is built (`bun run start` or `bun run build` in the `docs/` directory): 1. The `generate-extension-components` script scans all stories in `superset-core` 2. For each story, it generates an MDX page with: diff --git a/docs/developer_portal/extensions/quick-start.md b/docs/developer_portal/extensions/quick-start.md index 9241d088a4e..6a1f80c5af8 100644 --- a/docs/developer_portal/extensions/quick-start.md +++ b/docs/developer_portal/extensions/quick-start.md @@ -30,7 +30,7 @@ This guide walks you through creating your first Superset extension - a simple " Before starting, ensure you have: -- Node.js and npm compatible with your Superset version +- [Bun](https://bun.sh) (recommended) or Node.js 20+ compatible with your Superset version - Python compatible with your Superset version - A running Superset development environment - Basic knowledge of React, TypeScript, and Flask @@ -422,7 +422,7 @@ Install the frontend dependencies: ```bash cd frontend -npm install +bun install cd .. ``` diff --git a/docs/developer_portal/testing/e2e-testing.md b/docs/developer_portal/testing/e2e-testing.md index a4536123767..26a9f567c9b 100644 --- a/docs/developer_portal/testing/e2e-testing.md +++ b/docs/developer_portal/testing/e2e-testing.md @@ -34,23 +34,23 @@ Apache Superset uses Playwright for end-to-end testing, migrating from the legac cd superset-frontend # Run all tests -npm run playwright:test -# or: npx playwright test +bun run playwright:test +# or: bun x playwright test # Run specific test file -npx playwright test tests/auth/login.spec.ts +bun x playwright test tests/auth/login.spec.ts # Run with UI mode for debugging -npm run playwright:ui -# or: npx playwright test --ui +bun run playwright:ui +# or: bun x playwright test --ui # Run in headed mode (see browser) -npm run playwright:headed -# or: npx playwright test --headed +bun run playwright:headed +# or: bun x playwright test --headed # Debug specific test file -npm run playwright:debug tests/auth/login.spec.ts -# or: npx playwright test --debug tests/auth/login.spec.ts +bun run playwright:debug tests/auth/login.spec.ts +# or: bun x playwright test --debug tests/auth/login.spec.ts ``` ### Cypress (Deprecated) @@ -152,11 +152,11 @@ Playwright generates multiple reports for better visibility: ```bash # View interactive HTML report (opens automatically on failure) -npm run playwright:report -# or: npx playwright show-report +bun run playwright:report +# or: bun x playwright show-report # View test trace for debugging failures -npx playwright show-trace test-results/[test-name]/trace.zip +bun x playwright show-trace test-results/[test-name]/trace.zip ``` ### Report Types diff --git a/docs/developer_portal/testing/frontend-testing.md b/docs/developer_portal/testing/frontend-testing.md index e33bb1095bc..9cd3de6c76c 100644 --- a/docs/developer_portal/testing/frontend-testing.md +++ b/docs/developer_portal/testing/frontend-testing.md @@ -44,16 +44,16 @@ Comprehensive guide for testing Superset's frontend components and features. ```bash # Run all frontend tests -npm run test +bun run test # Run tests in watch mode -npm run test -- --watch +bun run test -- --watch # Run tests with coverage -npm run test -- --coverage +bun run test -- --coverage # Run specific test file -npm run test -- MyComponent.test.tsx +bun run test -- MyComponent.test.tsx ``` --- diff --git a/docs/developer_portal/testing/overview.md b/docs/developer_portal/testing/overview.md index 856b3990ae9..f66d6ab12fb 100644 --- a/docs/developer_portal/testing/overview.md +++ b/docs/developer_portal/testing/overview.md @@ -80,16 +80,16 @@ Superset embraces a testing pyramid approach: ### Quick Commands ```bash # Frontend unit tests -npm run test +bun run test -# Backend unit tests +# Backend unit tests pytest tests/unit_tests/ # End-to-end tests -npm run playwright:test +bun run playwright:test # All tests with coverage -npm run test:coverage +bun run test:coverage ``` ### Test Development Workflow diff --git a/docs/developer_portal/testing/storybook.md b/docs/developer_portal/testing/storybook.md index 0e190220f15..e234f3bf087 100644 --- a/docs/developer_portal/testing/storybook.md +++ b/docs/developer_portal/testing/storybook.md @@ -42,10 +42,10 @@ To run the main Superset Storybook locally: cd superset-frontend # Start Storybook (opens at http://localhost:6006) -npm run storybook +bun run storybook # Build static Storybook -npm run build-storybook +bun run build-storybook ``` ### @superset-ui Package Storybook @@ -55,12 +55,11 @@ The `@superset-ui` packages have a separate Storybook for component library deve ```bash cd superset-frontend -# Install dependencies and bootstrap packages -npm ci && npm run bootstrap +# Install dependencies and build packages +bun install && bun run turbo:build # Start the @superset-ui Storybook (opens at http://localhost:9001) -cd packages/superset-ui-demo -npm run storybook +bun run plugins:storybook ``` ## Adding Stories @@ -78,7 +77,7 @@ storybook/stories//index.js 1. Add package dependencies: ```bash - npm install + bun add ``` 2. Create a story folder matching the package name: diff --git a/scripts/eslint.sh b/scripts/eslint.sh index b5d5dd4915e..641044eba13 100755 --- a/scripts/eslint.sh +++ b/scripts/eslint.sh @@ -27,4 +27,4 @@ if [[ ! -d "$root_dir/$frontend_dir" ]]; then fi cd "$root_dir/$frontend_dir" -npm run lint-fix -- "${@//$frontend_dir\//}" +bun run lint-fix -- "${@//$frontend_dir\//}" diff --git a/superset-frontend/.changeset/config.json b/superset-frontend/.changeset/config.json index 3933a262624..46fb17e63df 100644 --- a/superset-frontend/.changeset/config.json +++ b/superset-frontend/.changeset/config.json @@ -5,6 +5,7 @@ { "repo": "apache/superset" } ], "commit": false, + "gitTag": false, "fixed": [], "linked": [ ["@superset-ui/*", "@apache-superset/*"] diff --git a/superset-frontend/cypress_build.sh b/superset-frontend/cypress_build.sh index b454b8bc9ca..a3802ce9bc7 100755 --- a/superset-frontend/cypress_build.sh +++ b/superset-frontend/cypress_build.sh @@ -29,8 +29,8 @@ PORT='8081' flask run -p $PORT --with-threads --reload --debugger & #block on the longer running javascript process -time npm ci -time npm run build-instrumented +time bun install --frozen-lockfile +time bun run build-instrumented echo "[completed js build steps]" #setup cypress diff --git a/superset-frontend/js_build.sh b/superset-frontend/js_build.sh index cbd994dd51e..67a5b6bb884 100755 --- a/superset-frontend/js_build.sh +++ b/superset-frontend/js_build.sh @@ -17,10 +17,10 @@ # set -e cd "$(dirname "$0")" -npm --version +bun --version node --version -time npm ci -time npm run lint -time npm run check -time npm run cover # this also runs the tests, so no need to 'npm run test' -time npm run build +time bun install --frozen-lockfile +time bun run lint +time bun run check +time bun run cover # this also runs the tests, so no need to 'bun run test' +time bun run build diff --git a/superset-frontend/package.json b/superset-frontend/package.json index d106e45cac8..c9897285961 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -60,21 +60,20 @@ "check:custom-rules": "node scripts/check-custom-rules.js", "ensure-oxc": "echo 'OXC linter is ready' && npx oxlint --version", "lint-stats": "node ./scripts/oxlint-metrics-uploader.js", - "plugins:build": "node ./scripts/build.js", - "plugins:build-assets": "node ./scripts/copyAssets.js", - "plugins:build-storybook": "cd packages/superset-ui-demo && npm run build-storybook", - "changeset": "changeset", + "build:packages": "turbo run build", + "build:packages:force": "turbo run build --force", + "build:packages:assets": "node ./scripts/copyAssets.js", + "publish:packages": "bun run build:packages && changeset publish", + "publish:packages:dry": "bun run build:packages && changeset publish --dry-run", "changeset:add": "changeset add", "changeset:version": "changeset version", - "changeset:publish": "npm run turbo:build && changeset publish", "changeset:status": "changeset status", - "turbo:build": "turbo run build", - "turbo:build:force": "turbo run build --force", + "sync-versions": "node scripts/sync-package-versions.js", + "sync-versions:dry": "node scripts/sync-package-versions.js --dry-run", "turbo:type-check": "turbo run type-check", "turbo:lint": "turbo run lint", "turbo:test": "turbo run test", "turbo:clean": "turbo run clean && rm -rf .turbo", - "plugins:storybook": "cd packages/superset-ui-demo && npm run storybook", "playwright:test": "playwright test", "playwright:ui": "playwright test --ui", "playwright:headed": "playwright test --headed", diff --git a/superset-frontend/scripts/build.js b/superset-frontend/scripts/build.js deleted file mode 100755 index f03f8407c0b..00000000000 --- a/superset-frontend/scripts/build.js +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/env node - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable no-console */ -/** - * Build packages/plugins filtered by globs - */ -process.env.PATH = `./node_modules/.bin:${process.env.PATH}`; - -const { spawnSync } = require('child_process'); -const fastGlob = require('fast-glob'); -const { argv } = require('yargs'); - -const { _: globs } = argv; -const glob = globs.length > 1 ? `{${globs.join(',')}}` : globs[0] || '*'; - -const BABEL_CONFIG = '--config-file=../../babel.config.js'; - -// packages that do not need tsc -const META_PACKAGES = new Set(['demo', 'generator-superset']); - -function run(cmd, options) { - console.log(`\n>> ${cmd}\n`); - const [p, ...args] = cmd.split(' '); - const runner = spawnSync; - const { status } = runner(p, args, { stdio: 'inherit', ...options }); - if (status !== 0) { - process.exit(status); - } -} - -function getPackages(packagePattern, tsOnly = false) { - let pattern = packagePattern; - if (pattern === '*' && !tsOnly) { - return `{@superset-ui/!(${[...META_PACKAGES].join('|')}),@apache-superset/*}`; - } - if (!pattern.includes('*')) { - pattern = `*${pattern}`; - } - - // Find packages in both @superset-ui and @apache-superset scopes - const supersetUiPackages = [ - ...new Set( - fastGlob - .sync([ - `./node_modules/@superset-ui/${pattern}/src/**/*.${ - tsOnly ? '{ts,tsx}' : '{ts,tsx,js,jsx}' - }`, - ]) - .map(x => x.split('/')[3]) - .filter(x => !META_PACKAGES.has(x)), - ), - ]; - - const apachePackages = [ - ...new Set( - fastGlob - .sync([ - `./node_modules/@apache-superset/${pattern}/src/**/*.${ - tsOnly ? '{ts,tsx}' : '{ts,tsx,js,jsx}' - }`, - ]) - .map(x => x.split('/')[3]), - ), - ]; - - const allScopes = []; - if (supersetUiPackages.length > 0) { - allScopes.push( - `@superset-ui/${ - supersetUiPackages.length > 1 - ? `{${supersetUiPackages.join(',')}}` - : supersetUiPackages[0] - }`, - ); - } - if (apachePackages.length > 0) { - allScopes.push( - `@apache-superset/${ - apachePackages.length > 1 - ? `{${apachePackages.join(',')}}` - : apachePackages[0] - }`, - ); - } - - if (allScopes.length === 0) { - throw new Error('No matching packages'); - } - - return allScopes.length > 1 ? `{${allScopes.join(',')}}` : allScopes[0]; -} - -let scope = getPackages(glob); - -console.log('--- Run babel --------'); -const babelCommand = `lerna exec --stream --concurrency 10 --scope ${scope} - -- babel ${BABEL_CONFIG} src --extensions ".ts,.tsx,.js,.jsx" --copy-files`; -run(`${babelCommand} --out-dir lib`); - -console.log('--- Run babel esm ---'); -// run again with -run(`${babelCommand} --out-dir esm`, { - env: { ...process.env, NODE_ENV: 'production', BABEL_OUTPUT: 'esm' }, -}); - -console.log('--- Run tsc ---'); -// only run tsc for packages with ts files -scope = getPackages(glob, true); -run(`lerna exec --stream --concurrency 3 --scope ${scope} \ - -- ../../scripts/tsc.sh --build`); diff --git a/superset-frontend/scripts/lernaVersion.sh b/superset-frontend/scripts/lernaVersion.sh deleted file mode 100755 index f023f634f0f..00000000000 --- a/superset-frontend/scripts/lernaVersion.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -rootDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" - -lernaVersionArg="$1" -if [[ -z $lernaVersionArg ]]; then - echo '[ERROR] Please provide argument for "lerna version".' - exit 1 -fi - -currentNpm=$(npm --version) -npmVersion=$(node -e "process.stdout.write(require('./package.json').engines.npm)"); -isSatisfiedNpm=$(node -e "process.stdout.write(require('semver').satisfies('$currentNpm', '$npmVersion').toString())"); - -currentNode=$(node --version) -nodeVersion=$(node -e "process.stdout.write(require('./package.json').engines.node)"); -isSatisfiedNode=$(node -e "process.stdout.write(require('semver').satisfies('$currentNode', '$nodeVersion').toString())"); - -# Check node version compatible with package.json -if [[ $isSatisfiedNode != 'true' ]]; then - echo "[ERROR] Your node version($currentNode) is not compatible with package.json($nodeVersion)" - exit 1 -fi - -# Check npm version compatible with package.json -if [[ $isSatisfiedNpm != 'true' ]]; then - echo "[ERROR] Your npm version($currentNpm) is not compatible with package.json($npmVersion)" - exit 1 -fi - -# Ignore Lerna's tag and push -lerna version $1 --no-push --no-git-tag-version --yes - -if [[ -z $(git diff --stat) ]]; then - echo '[ERROR] No changed packages to version.' - exit 1 -fi - -# Get the current tag version -tag=v$(node -e "process.stdout.write(require('./lerna.json').version)"); -message="chore(plugins): publish $tag" - -if [[ $? -ne 0 ]]; then - echo '[ERROR] Can not update package-lock.json' - exit 1 -fi - -# Auto-tag and auto-commit like usual -git commit --all -m "${message}" -git tag -a ${tag} -m ${tag} -git push origin ${tag} -git push diff --git a/superset-frontend/scripts/sync-package-versions.js b/superset-frontend/scripts/sync-package-versions.js new file mode 100644 index 00000000000..d4a8a666d52 --- /dev/null +++ b/superset-frontend/scripts/sync-package-versions.js @@ -0,0 +1,150 @@ +#!/usr/bin/env node + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Sync all publishable package versions to a specific version. + * Used during Superset releases to align npm package versions. + * + * Usage: + * node scripts/sync-package-versions.js + * node scripts/sync-package-versions.js 6.1.0 + * node scripts/sync-package-versions.js 6.1.0-rc.1 + * node scripts/sync-package-versions.js 6.1.0 --dry-run + */ + +const fs = require('fs'); +const path = require('path'); +const { execSync } = require('child_process'); + +const args = process.argv.slice(2); +const dryRun = args.includes('--dry-run'); +const version = args.find(arg => !arg.startsWith('--')); + +if (!version) { + console.error('Usage: node scripts/sync-package-versions.js [--dry-run]'); + console.error('Example: node scripts/sync-package-versions.js 6.1.0'); + console.error('Example: node scripts/sync-package-versions.js 6.1.0-rc.1 --dry-run'); + process.exit(1); +} + +// Validate version format (semver with optional prerelease) +const semverRegex = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/; +if (!semverRegex.test(version)) { + console.error(`Invalid version format: ${version}`); + console.error('Expected format: MAJOR.MINOR.PATCH or MAJOR.MINOR.PATCH-prerelease'); + process.exit(1); +} + +const rootDir = path.resolve(__dirname, '..'); + +// Find all publishable packages (those with "private": false or no "private" field) +// Exclude demo and generator packages per changeset config +const excludePackages = new Set(['@superset-ui/demo', '@superset-ui/generator-superset']); + +function findPackages() { + const packages = []; + + // Check packages directory + const packagesDir = path.join(rootDir, 'packages'); + if (fs.existsSync(packagesDir)) { + for (const dir of fs.readdirSync(packagesDir)) { + const pkgPath = path.join(packagesDir, dir, 'package.json'); + if (fs.existsSync(pkgPath)) { + packages.push(pkgPath); + } + } + } + + // Check plugins directory + const pluginsDir = path.join(rootDir, 'plugins'); + if (fs.existsSync(pluginsDir)) { + for (const dir of fs.readdirSync(pluginsDir)) { + const pkgPath = path.join(pluginsDir, dir, 'package.json'); + if (fs.existsSync(pkgPath)) { + packages.push(pkgPath); + } + } + } + + return packages; +} + +function updatePackage(pkgPath, newVersion) { + const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); + + // Skip private packages + if (pkg.private === true) { + return { skipped: true, reason: 'private', name: pkg.name }; + } + + // Skip excluded packages + if (excludePackages.has(pkg.name)) { + return { skipped: true, reason: 'excluded', name: pkg.name }; + } + + const oldVersion = pkg.version; + pkg.version = newVersion; + + if (!dryRun) { + fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n'); + } + + return { + skipped: false, + name: pkg.name, + oldVersion, + newVersion, + path: pkgPath + }; +} + +console.log(`\n${dryRun ? '[DRY RUN] ' : ''}Syncing package versions to ${version}\n`); + +const packages = findPackages(); +const results = packages.map(pkgPath => updatePackage(pkgPath, version)); + +// Print results +console.log('Updated packages:'); +results + .filter(r => !r.skipped) + .forEach(r => { + console.log(` ${r.name}: ${r.oldVersion} -> ${r.newVersion}`); + }); + +console.log('\nSkipped packages:'); +results + .filter(r => r.skipped) + .forEach(r => { + console.log(` ${r.name} (${r.reason})`); + }); + +const updatedCount = results.filter(r => !r.skipped).length; +console.log(`\n${dryRun ? 'Would update' : 'Updated'} ${updatedCount} packages.`); + +if (dryRun) { + console.log('\nRun without --dry-run to apply changes.'); +} else { + console.log('\nNext steps:'); + console.log(' 1. Review changes: git diff'); + console.log(' 2. Commit: git add . && git commit -m "chore(packages): bump versions to ' + version + '"'); + console.log(' 3. Dry run publish: bun run publish:packages:dry'); + console.log(' 4. Publish: bun run publish:packages'); +} diff --git a/superset/static/service-worker.js b/superset/static/service-worker.js index 43cb14a4894..6f1fa9b8844 100644 --- a/superset/static/service-worker.js +++ b/superset/static/service-worker.js @@ -1,27 +1 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Minimal service worker for PWA file handling support -self.addEventListener('install', event => { - event.waitUntil(self.skipWaiting()); -}); - -self.addEventListener('activate', event => { - event.waitUntil(self.clients.claim()); -}); +(()=>{"use strict";let e;var r,t,n,o,a,i,f,l,u,s,d,p,c,h,v,g,y={89159(){self.addEventListener("install",e=>{e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",e=>{e.waitUntil(self.clients.claim())})}},b={};function m(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={id:e,loaded:!1,exports:{}};return y[e].call(t.exports,t,t.exports,m),t.loaded=!0,t.exports}m.m=y,m.c=b,m.amdD=function(){throw Error("define cannot be used indirect")},r=[],m.O=(e,t,n,o)=>{if(t){o=o||0;for(var a=r.length;a>0&&r[a-1][2]>o;a--)r[a]=r[a-1];r[a]=[t,n,o];return}for(var i=1/0,a=0;a=o)&&Object.keys(m.O).every(e=>m.O[e](t[l]))?t.splice(l--,1):(f=!1,o{var r=e&&e.__esModule?()=>e.default:()=>e;return m.d(r,{a:r}),r},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,m.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);m.r(o);var a={};t=t||[null,n({}),n([]),n(n)];for(var i=2&r&&e;("object"==typeof i||"function"==typeof i)&&!~t.indexOf(i);i=n(i))Object.getOwnPropertyNames(i).forEach(r=>a[r]=()=>e[r]);return a.default=()=>e,m.d(o,a),o},m.d=(e,r)=>{for(var t in r)m.o(r,t)&&!m.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},m.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),m.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},m.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),m.S={},o={},a={},m.I=(e,r)=>{r||(r=[]);var t=a[e];if(t||(t=a[e]={}),!(r.indexOf(t)>=0)){if(r.push(t),o[e])return o[e];m.o(m.S,e)||(m.S[e]={});var n=m.S[e],i="superset",f=(e,r,t,o)=>{var a=n[e]=n[e]||{},f=a[r];(!f||!f.loaded&&(!o!=!f.eager?o:i>f.from))&&(a[r]={get:t,from:i,eager:!!o})},l=[];return("default"===e&&(f("antd","5.27.6",()=>()=>m(2672),1),f("react-dom","17.0.2",()=>()=>m(40961),1),f("react","17.0.2",()=>()=>m(96540),1)),l.length)?o[e]=Promise.all(l).then(()=>o[e]=1):o[e]=1}},i=e=>{var r=e=>e.split(".").map(e=>+e==e?+e:e),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},f=(e,r)=>{e=i(e),r=i(r);for(var t=0;;){if(t>=e.length)return t=r.length)return"u"==o;var a=r[t],f=(typeof a)[0];if(o!=f)return"o"==o&&"n"==f||"s"==f||"u"==o;if("o"!=o&&"u"!=o&&n!=a)return n{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o0?".":"")+(n=2,i);return t}var a=[];for(o=1;o{if(0 in e){r=i(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var o=0,a=1,f=!0;;a++,o++){var l,s,d=a=r.length||"o"==(s=(typeof(l=r[o]))[0]))return!f||("u"==d?a>t&&!n:""==d!=n);if("u"==s){if(!f||"u"!=d)return!1}else if(f)if(d==s)if(a<=t){if(l!=e[a])return!1}else{if(n?l>e[a]:lObject.keys(e).reduce((r,t)=>(e[t].eager&&(r[t]=e[t]),r),{}),e=(e,r,t,n,o,a)=>{if(!((e,r)=>e&&m.o(e,r))(r,t))return((e,r,t)=>t?t():(e=>{throw Error(e)})("Shared module "+r+" doesn't exist in shared scope "+e))(e,t,a);var i=((e,r,t)=>{var n=t?s(e[r]):e[r];return Object.keys(n).reduce((e,r)=>!e||!n[e].loaded&&f(e,r)?r:e,0)})(r,t,n);return u(o,i)||(e=>{"u">typeof console&&console.warn&&console.warn(e)})(((e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+l(n)+")")(r,t,i,o)),(e=>(e.loaded=1,e.get()))(r[t][i])},d=function(r,t,n,o,a){var i=m.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,m.S[r],t,!1,o,a)):e(r,m.S[r],t,n,o,a)},p={},c={18036:()=>d("default","react-dom",!0,[1,17,0,2],()=>()=>m(40961)),24002:()=>d("default","react",!0,[1,17,0,2],()=>()=>m(96540))},[18036,24002].forEach(e=>{m.m[e]=r=>{p[e]=0,delete m.c[e];var t=c[e]();if("function"!=typeof t)throw Error("Shared module is not available for eager consumption: "+e);r.exports=t()}}),h={2771:0,9742:0},m.O.j=e=>0===h[e],v=(e,r)=>{var t,n,[o,a,i]=r,f=0;if(o.some(e=>0!==h[e])){for(t in a)m.o(a,t)&&(m.m[t]=a[t]);if(i)var l=i(m)}for(e&&e(r);fm(89159));O=m.O(O)})(); \ No newline at end of file