diff --git a/.changeset/config.json b/.changeset/config.json index 89b1506960a..593e5f24cd5 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@3.0.1/schema.json", "changelog": ["./changelog-github-custom.cjs", { "repo": "QwikDev/qwik" }], "commit": false, - "fixed": [["@qwik.dev/core", "@qwik.dev/city", "eslint-plugin-qwik", "create-qwik"]], + "fixed": [["@qwik.dev/core", "@qwik.dev/router", "eslint-plugin-qwik", "create-qwik"]], "linked": [], "access": "public", "baseBranch": "build/v2", diff --git a/.changeset/pre.json b/.changeset/pre.json index 8e900b5e2c5..dddeb41ca0a 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -6,7 +6,7 @@ "qwik-docs": "0.0.1", "eslint-plugin-qwik": "2.0.0-0", "@qwik.dev/core": "2.0.0-0", - "@qwik.dev/city": "2.0.0-0", + "@qwik.dev/router": "2.0.0-0", "insights": "0.1.0", "@qwik.dev/dom": "2.1.19", "@qwik.dev/react": "2.0.0-0", diff --git a/.changeset/tricky-meals-heal.md b/.changeset/tricky-meals-heal.md new file mode 100644 index 00000000000..28de7b4c58f --- /dev/null +++ b/.changeset/tricky-meals-heal.md @@ -0,0 +1,5 @@ +--- +'@qwik.dev/router': major +--- + +Renamed "Qwik City" to "Qwik Router" and package to "@qwik.dev/router" diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml index cb2cefd937e..777e9044583 100644 --- a/.github/ISSUE_TEMPLATE/bug.yaml +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -17,7 +17,7 @@ body: - Qwik Rollup / Vite plugin - Qwik Optimizer (rust) - Qwik React - - Qwik City (routing) + - Qwik Router - Starters / CLI - Qwik Playground validations: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ced9b838139..f320590f558 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,12 +148,12 @@ jobs: with: lookup-only: true path: | - packages/qwik-city/lib + packages/qwik-router/lib packages/qwik-react/lib packages/eslint-plugin-qwik/dist packages/create-qwik/dist # note that all inputs need to be listed here, including qwik, for correct cache invalidation - key: ${{ hashfiles('qwik-key.txt', 'rust-key.txt', 'packages/qwik-city/**/*', 'packages/qwik-react/**/*', 'packages/eslint-plugin-qwik/**/*', 'packages/create-qwik/**/*', '!**/*.unit.*') }} + key: ${{ hashfiles('qwik-key.txt', 'rust-key.txt', 'packages/qwik-router/**/*', 'packages/qwik-react/**/*', 'packages/eslint-plugin-qwik/**/*', 'packages/create-qwik/**/*', '!**/*.unit.*') }} - run: 'echo ${{ steps.cache-others.outputs.cache-primary-key }} > others-key.txt' - name: 'check cache: docs' id: cache-docs @@ -397,40 +397,40 @@ jobs: if: needs.changes.outputs.build-others == 'true' run: corepack pnpm install - - name: 'build: qwik-city & others' + - name: 'build: qwik-router & others' if: needs.changes.outputs.build-others == 'true' - run: pnpm build --tsc --api --qwikcity --cli --qwikreact --eslint --set-dist-tag="${{ needs.changes.outputs.disttag }}" + run: pnpm build --tsc --api --qwikrouter --cli --qwikreact --eslint --set-dist-tag="${{ needs.changes.outputs.disttag }}" - name: Save others cache if: needs.changes.outputs.build-others == 'true' uses: actions/cache/save@v4 with: key: ${{ needs.changes.outputs.hash-others }} path: | - packages/qwik-city/lib + packages/qwik-router/lib packages/qwik-react/lib packages/eslint-plugin-qwik/dist packages/create-qwik/dist - - name: 'restore: qwik-city & others' + - name: 'restore: qwik-router & others' if: needs.changes.outputs.build-others != 'true' uses: actions/cache/restore@v4 with: path: | - packages/qwik-city/lib + packages/qwik-router/lib packages/qwik-react/lib packages/eslint-plugin-qwik/dist packages/create-qwik/dist key: ${{ needs.changes.outputs.hash-others }} - - name: Print QwikCity Lib Build - run: tree -a packages/qwik-city/lib/ + - name: Print QwikRouter Lib Build + run: tree -a packages/qwik-router/lib/ - - name: Upload QwikCity Build Artifacts + - name: Upload QwikRouter Build Artifacts uses: actions/upload-artifact@v4 with: - name: artifact-qwikcity + name: artifact-qwikrouter include-hidden-files: true - path: packages/qwik-city/lib/ + path: packages/qwik-router/lib/ if-no-files-found: error - name: Print qwik-react Lib Build @@ -491,8 +491,8 @@ jobs: - name: Move Distribution Artifacts run: | mv artifact-qwik/* packages/qwik/ - mkdir -p packages/qwik-city/lib/ - mv artifact-qwikcity/* packages/qwik-city/lib/ + mkdir -p packages/qwik-router/lib/ + mv artifact-qwikrouter/* packages/qwik-router/lib/ mkdir -p packages/create-qwik/dist/ mv artifact-create-qwik/* packages/create-qwik/dist/ mkdir -p packages/eslint-plugin-qwik/dist/ @@ -549,8 +549,8 @@ jobs: - name: Move Distribution Artifacts run: | mv artifact-qwik/* packages/qwik/ - mkdir -p packages/qwik-city/lib/ - mv artifact-qwikcity/* packages/qwik-city/lib/ + mkdir -p packages/qwik-router/lib/ + mv artifact-qwikrouter/* packages/qwik-router/lib/ mkdir -p packages/create-qwik/dist/ mv artifact-create-qwik/* packages/create-qwik/dist/ mkdir -p packages/eslint-plugin-qwik/dist/ @@ -608,8 +608,8 @@ jobs: - name: Move Distribution Artifacts run: | mv artifact-qwik/* packages/qwik/ - mkdir -p packages/qwik-city/lib/ - mv artifact-qwikcity/* packages/qwik-city/lib/ + mkdir -p packages/qwik-router/lib/ + mv artifact-qwikrouter/* packages/qwik-router/lib/ mkdir -p packages/create-qwik/dist/ mv artifact-create-qwik/* packages/create-qwik/dist/ mkdir -p packages/eslint-plugin-qwik/dist/ @@ -672,8 +672,8 @@ jobs: - name: Move Distribution Artifacts run: | mv artifact-qwik/* packages/qwik/ - mkdir -p packages/qwik-city/lib/ - mv artifact-qwikcity/* packages/qwik-city/lib/ + mkdir -p packages/qwik-router/lib/ + mv artifact-qwikrouter/* packages/qwik-router/lib/ mkdir -p packages/create-qwik/dist/ mv artifact-create-qwik/* packages/create-qwik/dist/ mkdir -p packages/eslint-plugin-qwik/dist/ @@ -730,8 +730,8 @@ jobs: - name: Move Distribution Artifacts run: | mv artifact-qwik/* packages/qwik/ - mkdir -p packages/qwik-city/lib/ - mv artifact-qwikcity/* packages/qwik-city/lib/ + mkdir -p packages/qwik-router/lib/ + mv artifact-qwikrouter/* packages/qwik-router/lib/ mkdir -p packages/create-qwik/dist/ mv artifact-create-qwik/* packages/create-qwik/dist/ mkdir -p packages/eslint-plugin-qwik/dist/ @@ -830,8 +830,8 @@ jobs: - name: Move Distribution Artifacts run: | mv artifact-qwik/* packages/qwik/ - mkdir -p packages/qwik-city/lib/ - mv artifact-qwikcity/* packages/qwik-city/lib/ + mkdir -p packages/qwik-router/lib/ + mv artifact-qwikrouter/* packages/qwik-router/lib/ mkdir -p packages/create-qwik/dist/ mv artifact-create-qwik/* packages/create-qwik/dist/ mkdir -p packages/eslint-plugin-qwik/dist/ @@ -870,7 +870,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ############ TRIGGER QWIKCITY E2E TEST ############ - trigger-qwikcity-e2e: + trigger-qwikrouter-e2e: name: Trigger Qwik City E2E runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' @@ -884,7 +884,7 @@ jobs: uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.QWIK_API_TOKEN_GITHUB }} - repository: builderIO/qwik-city-e2e + repository: QwikDev/qwik-city-e2e event-type: main-updated ############ Everything is fine ############ diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f8bda961746..6fe6446c816 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,7 +6,6 @@ "ms-playwright.playwright", "rust-lang.rust-analyzer", "ms-azuretools.vscode-docker", - "manucorporat.vermoji", "vadimcn.vscode-lldb", "streetsidesoftware.code-spell-checker", "vitest.explorer" diff --git a/CONTINUOUS_BUILD.md b/CONTINUOUS_BUILD.md index 652270d0c23..5081b175046 100644 --- a/CONTINUOUS_BUILD.md +++ b/CONTINUOUS_BUILD.md @@ -5,7 +5,7 @@ This repo contains build artifacts that are generated as part of the continues b Currently supported artifacts: - [`@qwik.dev/core`](https://github.com/QwikDev/qwik-build) -- [`@qwik.dev/city`](https://github.com/QwikDev/qwik-city-build) +- [`@qwik.dev/router`](https://github.com/QwikDev/qwik-city-build) The build artifact is created if: @@ -27,7 +27,7 @@ To install a specific build artifact change you `package.json` like so (not all { "dependencies": { "@qwik.dev/core": "github:QwikDev/qwik-build#SHA", - "@qwik.dev/city": "github:QwikDev/qwik-city-build#SHA" + "@qwik.dev/router": "github:QwikDev/qwik-city-build#SHA" } } ``` @@ -36,10 +36,10 @@ Where `#SHA` is one of the following: - `#SHA` - Install a specific build SHA. You can get the SHA from: - [`@qwik.dev/core`](https://github.com/QwikDev/qwik-build/commits/) commits - - [`@qwik.dev/city`](https://github.com/QwikDev/qwik-city-build/commits/) commits + - [`@qwik.dev/router`](https://github.com/QwikDev/qwik-city-build/commits/) commits - `#build/name` (or `#main`) - Install a specific `build/*` (or `#main`) branch: - [`@qwik.dev/core`](https://github.com/QwikDev/qwik-build/branches/) branches - - [`@qwik.dev/city`](https://github.com/QwikDev/qwik-city-build/branches/) branches + - [`@qwik.dev/router`](https://github.com/QwikDev/qwik-city-build/branches/) branches > NOTE: Package managers will treat any SHA in the lock file which is on the branch as valid, and so they will not auto upgrade to the latest. For this reason this is not recommended. ## Bisect for regression diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1bc07a75d27..2084cc84c19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -165,7 +165,7 @@ If you want to work on the Rust code, use `build.full` instead of `build.local`. ### Fast build -This will build only Qwik and Qwik City and their types. This is not enough to run the docs. +This will build only Qwik and Qwik Router and their types. This is not enough to run the docs. ```shell pnpm build.core @@ -173,10 +173,10 @@ pnpm build.core ### Custom build -Once you have done a full build, the types are built, and you can build just the code you're working on. For qwik and qwik-city, you can do very fast rebuilds with +Once you have done a full build, the types are built, and you can build just the code you're working on. For qwik and qwik-router, you can do very fast rebuilds with ```shell -pnpm build --dev --qwik --qwikcity +pnpm build --dev --qwik --qwikrouter ``` The `--dev` flag skips type checking and generating. @@ -186,7 +186,7 @@ You can run `pnpm build` without parameters to see which flags are available. No - `--tsc`: build types - `--api`: build API docs and type bundles. Requires `--tsc` to have run. - `--build`: Qwik (you'll probably also need `--dev`) -- `--qwikcity`: Qwik City (you'll probably also need `--dev`) +- `--qwikrouter`: Qwik Router (you'll probably also need `--dev`) - `--qwikreact`: Qwik React - `--eslint`: Eslint plugin @@ -229,12 +229,12 @@ Assuming qwik is in `../qwik`, run this inside the root of your app: ```shell pnpm link ../qwik/packages/qwik -pnpm link ../qwik/packages/qwik-city +pnpm link ../qwik/packages/qwik-router ``` -Other package managers probably need to first be told about the packages. For example, with `bun` you need to `cd ../qwik/packages/qwik` and `bun link`, repeat for `qwik-city`. Then in your app run `bun link @qwik.dev/core @qwik.dev/city`. +Other package managers probably need to first be told about the packages. For example, with `bun` you need to `cd ../qwik/packages/qwik` and `bun link`, repeat for `qwik-router`. Then in your app run `bun link @qwik.dev/core @qwik.dev/router`. -If you can't use package linking, just copy the contents of `packages/qwik` into your projects' `node_modules/@qwik.dev/core` folder, and/or the contents of `packages/qwik-city` into your projects' `node_modules/@qwik.dev/city` folder. +If you can't use package linking, just copy the contents of `packages/qwik` into your projects' `node_modules/@qwik.dev/core` folder, and/or the contents of `packages/qwik-router` into your projects' `node_modules/@qwik.dev/router` folder. ### Working on the docs site @@ -316,7 +316,7 @@ For larger PRs, it would really help if you follow these guidelines. - Keep your commits focused and atomic. Each commit should represent a single, coherent change. - If you have commits like `wip lol` or `fixup`, squash them. Use `git rebase -i`. - Commits must follow the format: `type(scope): description` - For example: `feat(qwik-city): confetti animations` or `chore: pnpm api.update` + For example: `feat(qwik-router): confetti animations` or `chore: pnpm api.update` Common types include: diff --git a/cspell.json b/cspell.json index b5845c42416..f7a61b211b7 100644 --- a/cspell.json +++ b/cspell.json @@ -188,6 +188,7 @@ "qvisible", "qwik", "qwikcity", + "qwikrouter", "qwikdeps", "qwikdom", "qwikevents", diff --git a/e2e/qwik-cli-e2e/README.md b/e2e/qwik-cli-e2e/README.md index 7caca8ec0d6..97bf788923e 100644 --- a/e2e/qwik-cli-e2e/README.md +++ b/e2e/qwik-cli-e2e/README.md @@ -10,7 +10,7 @@ Tests can be invoked by running `pnpm run test.e2e-cli`. E2E project does the following internally: -0. Vitest is configured to run a setup function once **PRIOR TO ALL** tests. During the setup `@qwik.dev/core`, `@qwik.dev/city` and `eslint-plugin-qwik` packages will be packed with `pnpm pack` Those will be used at a step 2 for every test. Tarballs are located in `temp/tarballs` folder within this repo. It is assumed that packages are built before E2E is executed. +0. Vitest is configured to run a setup function once **PRIOR TO ALL** tests. During the setup `@qwik.dev/core`, `@qwik.dev/router` and `eslint-plugin-qwik` packages will be packed with `pnpm pack` Those will be used at a step 2 for every test. Tarballs are located in `temp/tarballs` folder within this repo. It is assumed that packages are built before E2E is executed. 1. Simulates `npm create qwik` locally using direct command `node packages/create-qwik/create-qwik.cjs playground {outputDir}` @@ -21,7 +21,7 @@ E2E project does the following internally: Note that provided folder should exist. If custom path is used, generated application will not be removed after the test completes, which is helpful for debugging. -2. Uses packed `@qwik.dev/core`, `@qwik.dev/city` and `eslint-plugin-qwik` packages to update package.json file of the generated application with `file:path-to-package.tgz`. +2. Uses packed `@qwik.dev/core`, `@qwik.dev/router` and `eslint-plugin-qwik` packages to update package.json file of the generated application with `file:path-to-package.tgz`. 3. Runs actual tests. Please pay attention at the `beforeAll` hook in the spec file diff --git a/e2e/qwik-cli-e2e/utils/setup.ts b/e2e/qwik-cli-e2e/utils/setup.ts index 374ed642c5f..b772955f306 100644 --- a/e2e/qwik-cli-e2e/utils/setup.ts +++ b/e2e/qwik-cli-e2e/utils/setup.ts @@ -1,16 +1,16 @@ import { execSync } from 'child_process'; +import { existsSync, writeFileSync } from 'fs'; import { join } from 'path'; import { workspaceRoot } from '.'; -import { existsSync, writeFileSync } from 'fs'; const packageCfg = { '@qwik.dev/core': { packagePath: 'packages/qwik', distPath: 'packages/qwik/dist', }, - '@qwik.dev/city': { - packagePath: 'packages/qwik-city', - distPath: 'packages/qwik-city/lib', + '@qwik.dev/router': { + packagePath: 'packages/qwik-router', + distPath: 'packages/qwik-router/lib', }, 'eslint-plugin-qwik': { packagePath: 'packages/eslint-plugin-qwik', diff --git a/package.json b/package.json index c72a1d7ae66..5cde0ed33d1 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "comments": { "01": "devDependencies includes reference to @qwik.dev/core: workspace:*. This is needed or e2e tests will fail", "02": " It would be nice to be able to remove this dependency and fix the test.", - "03": "devDependencies can't include reference to @qwik.dev/city or e2e test will fail." + "03": "devDependencies can't include reference to @qwik.dev/router or e2e test will fail." }, "config": { "syncpack": { @@ -101,7 +101,7 @@ "@node-rs/helper": "1.6.0", "@octokit/action": "6.1.0", "@playwright/test": "1.47.0", - "@qwik.dev/city": "workspace:*", + "@qwik.dev/router": "workspace:*", "@qwik.dev/core": "workspace:*", "@types/brotli": "1.3.4", "@types/bun": "1.1.6", @@ -183,23 +183,23 @@ "api.update": "tsm scripts/index.ts --tsc --api --dev", "build": "tsm scripts/index.ts", "build.changelog-formatter": "tsc .changeset/changelog-github-custom.ts && mv .changeset/changelog-github-custom.js .changeset/changelog-github-custom.cjs", - "build.clean": "rm -rf packages/qwik/dist/ && rm -rf packages/qwik-city/lib/ && rm -rf packages/docs/dist/ && rm -rf packages/insights/dist/", + "build.clean": "rm -rf packages/qwik/dist/ && rm -rf packages/qwik-router/lib/ && rm -rf packages/docs/dist/ && rm -rf packages/insights/dist/", "build.cli": "tsm scripts/index.ts --cli --dev", "build.cli.prod": "tsm scripts/index.ts --cli", - "build.core": "tsm scripts/index.ts --tsc --build --qwikcity --api --platform-binding", + "build.core": "tsm scripts/index.ts --tsc --build --qwikrouter --api --platform-binding", "build.eslint": "tsm scripts/index.ts --eslint", - "build.full": "tsm scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwikreact --cli --platform-binding --wasm", - "build.local": "tsm scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikcity --qwikworker --qwikreact --cli --platform-binding-wasm-copy", + "build.full": "tsm scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikrouter --qwikworker --qwikreact --cli --platform-binding --wasm", + "build.local": "tsm scripts/index.ts --tsc --tsc-docs --build --supabaseauthhelpers --api --eslint --qwikrouter --qwikworker --qwikreact --cli --platform-binding-wasm-copy", "build.only_javascript": "tsm scripts/index.ts --tsc --build --api", "build.packages.docs": "pnpm -C ./packages/docs/ run build", "build.packages.insights": "pnpm -C ./packages/insights/ run build", "build.platform": "tsm scripts/index.ts --platform-binding", "build.platform.copy": "tsm scripts/index.ts --platform-binding-wasm-copy", - "build.qwik-city": "tsm scripts/index.ts --tsc --qwikcity", - "build.validate": "tsm scripts/index.ts --tsc --build --api --eslint --qwikcity --platform-binding --wasm --validate", - "build.vite": "tsm scripts/index.ts --tsc --build --api --qwikcity --eslint --platform-binding-wasm-copy", + "build.qwik-router": "tsm scripts/index.ts --tsc --qwikrouter", + "build.validate": "tsm scripts/index.ts --tsc --build --api --eslint --qwikrouter --platform-binding --wasm --validate", + "build.vite": "tsm scripts/index.ts --tsc --build --api --qwikrouter --eslint --platform-binding-wasm-copy", "build.wasm": "tsm scripts/index.ts --wasm", - "build.watch": "tsm scripts/index.ts --build --qwikcity --watch --dev --platform-binding", + "build.watch": "tsm scripts/index.ts --build --qwikrouter --watch --dev --platform-binding", "change": "changeset", "cli": "pnpm build.cli && node packages/create-qwik/dist/create-qwik.cjs && tsm scripts/validate-cli.ts --copy-local-qwik-dist", "cli.qwik": "pnpm build.cli && node packages/qwik/dist/qwik-cli.cjs", @@ -211,9 +211,9 @@ "eslint.update": "tsm scripts/eslint-docs.ts", "fmt": "pnpm prettier.fix && pnpm syncpack format", "fmt.staged": "pretty-quick --staged", - "link.dist": "cd packages/qwik && pnpm link --global && cd ../qwik-city && pnpm link --global && cd ../eslint-plugin-qwik && pnpm link --global && cd ../qwik-react && pnpm link --global", - "link.dist.npm": "cd packages/qwik && npm link && cd ../qwik-city && npm link && cd ../eslint-plugin-qwik && npm link && cd ../qwik-react && npm link", - "link.dist.yarn": "cd packages/qwik && yarn link && cd ../qwik-city && yarn link && cd ../eslint-plugin-qwik && yarn link && cd ../qwik-react && yarn link", + "link.dist": "cd packages/qwik && pnpm link --global && cd ../qwik-router && pnpm link --global && cd ../eslint-plugin-qwik && pnpm link --global && cd ../qwik-react && pnpm link --global", + "link.dist.npm": "cd packages/qwik && npm link && cd ../qwik-router && npm link && cd ../eslint-plugin-qwik && npm link && cd ../qwik-react && npm link", + "link.dist.yarn": "cd packages/qwik && yarn link && cd ../qwik-router && yarn link && cd ../eslint-plugin-qwik && yarn link && cd ../qwik-react && yarn link", "lint": "pnpm lint.eslint && pnpm lint.prettier && pnpm lint.rust", "lint.eslint": "eslint --cache \"**/*.ts*\"", "lint.fix": "eslint --fix \"**/*.ts*\" && pnpm prettier.fix", @@ -225,7 +225,7 @@ "prettier.fix": "prettier --cache --write .", "qwik-save-artifacts": "tsm ./scripts/qwik-save-artifacts.ts", "release": "changeset publish", - "release.pkg-pr-new": "pnpm dlx pkg-pr-new@^0.0.9 publish --pnpm ./packages/qwik ./packages/qwik-city ./packages/eslint-plugin-qwik ./packages/create-qwik", + "release.pkg-pr-new": "pnpm dlx pkg-pr-new@^0.0.9 publish --pnpm ./packages/qwik ./packages/qwik-router ./packages/eslint-plugin-qwik ./packages/create-qwik", "release.prepare": "pnpm build --prepare-release", "serve": "tsm --inspect --conditions=development starters/dev-server.ts 3300", "serve.debug": "tsm --inspect-brk --conditions=development starters/dev-server.ts 3300", @@ -235,7 +235,7 @@ "test.e2e-cli": "pnpm --filter qwik-cli-e2e e2e", "test.e2e.chromium": "playwright test starters --browser=chromium --config starters/playwright.config.ts", "test.e2e.chromium.debug": "PWDEBUG=1 playwright test starters --browser=chromium --config starters/playwright.config.ts", - "test.e2e.city": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts", + "test.e2e.router": "playwright test starters/e2e/qwikrouter --browser=chromium --config starters/playwright.config.ts", "test.e2e.cli": "tsm scripts/e2e-cli.ts", "test.e2e.firefox": "playwright test starters --browser=firefox --config starters/playwright.config.ts", "test.e2e.webkit": "playwright test starters --browser=webkit --config starters/playwright.config.ts", @@ -243,7 +243,7 @@ "test.rust.update": "make test-update", "test.unit": "vitest packages", "test.unit.debug": "vitest --inspect-brk packages", - "test.vite": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts", + "test.vite": "playwright test starters/e2e/qwikrouter --browser=chromium --config starters/playwright.config.ts", "tsc.check": "tsc --noEmit", "tsc.trace": "tsc -p tsconfig.json --traceResolution > tsc.log", "tsc.watch": "tsc --noEmit --watch --preserveWatchOutput", diff --git a/packages/docs/adapters/cloudflare-pages/vite.config.mts b/packages/docs/adapters/cloudflare-pages/vite.config.mts index d6bc5103122..6f86a91e07a 100644 --- a/packages/docs/adapters/cloudflare-pages/vite.config.mts +++ b/packages/docs/adapters/cloudflare-pages/vite.config.mts @@ -1,5 +1,5 @@ -import { cloudflarePagesAdapter } from '@qwik.dev/city/adapters/cloudflare-pages/vite'; -import { extendConfig } from '@qwik.dev/city/vite'; +import { cloudflarePagesAdapter } from '@qwik.dev/router/adapters/cloudflare-pages/vite'; +import { extendConfig } from '@qwik.dev/router/vite'; // @ts-ignore import baseConfig from '../../vite.config.mts'; @@ -8,7 +8,7 @@ export default extendConfig(baseConfig, () => { build: { ssr: true, rollupOptions: { - input: ['src/entry.cloudflare-pages.tsx', '@qwik-city-plan'], + input: ['src/entry.cloudflare-pages.tsx', '@qwik-router-config'], }, minify: false, }, diff --git a/packages/docs/package.json b/packages/docs/package.json index c34297d2e3e..86f7c62a669 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -9,6 +9,8 @@ "@algolia/client-search": "4.14.3", "@builder.io/partytown": "0.10.2", "@builder.io/sdk-qwik": "0.14.31", + "@builder.io/qwik": "../qwik", + "@builder.io/qwik-city": "../qwik-router", "@docsearch/css": "3.6.1", "@emotion/react": "11.13.0", "@emotion/styled": "11.13.0", @@ -17,7 +19,7 @@ "@mui/system": "5.16.4", "@mui/x-data-grid": "6.20.4", "@qwik-ui/headless": "0.5.0", - "@qwik.dev/city": "workspace:*", + "@qwik.dev/router": "workspace:*", "@qwik.dev/core": "workspace:*", "@qwik.dev/react": "workspace:*", "@supabase/supabase-js": "2.44.4", diff --git a/packages/docs/public/_redirects b/packages/docs/public/_redirects index 7670388f7d6..bc2a4af40c4 100644 --- a/packages/docs/public/_redirects +++ b/packages/docs/public/_redirects @@ -31,6 +31,7 @@ /qwikcity/routing/route-parameters/ /docs/routing/ 308 /qwikcity/routing/error-responses/ /docs/advanced/routing/ 308 /qwikcity/loader/ /docs/route-loader/ 308 +/qwikcity/adaptors/ /docs/deployments/ 308 /qwikcity/layout/overview/ /docs/layout/ 308 /qwikcity/layout/nested/ /docs/advanced/routing/ 308 /qwikcity/layout/grouped/ /docs/advanced/routing/ 308 @@ -61,9 +62,13 @@ /docs/components/projection/ /docs/components/slots/ 308 /docs/components/resource/ /docs/components/state/ 308 +/qwikcity/adaptors/* /docs/deployments/:splat 308 /qwikcity/* /docs/:splat 308 +/qwikrouter/* /docs/:splat 308 /integrations/* /docs/integrations/:splat 308 /deployments/* /docs/deployments/:splat 308 /docs/advanced/i18n/ /docs/integrations/i18n/ 308 /docs/components/inline-components/ /docs/components/overview/ 308 -/docs/think-qwik/ /docs/concepts/think-qwik/ 308 \ No newline at end of file +/docs/think-qwik/ /docs/concepts/think-qwik/ 308 +/docs/qwikcity/ /docs/qwikrouter/ 308 +/docs/qwikcity-deprecated-features/ /docs/qwikrouter-deprecated-features/ 308 \ No newline at end of file diff --git a/packages/docs/public/icons/qwikCity_and_routing.svg b/packages/docs/public/icons/qwikRouter_and_routing.svg similarity index 100% rename from packages/docs/public/icons/qwikCity_and_routing.svg rename to packages/docs/public/icons/qwikRouter_and_routing.svg diff --git a/packages/docs/src/components/builder-content/index.tsx b/packages/docs/src/components/builder-content/index.tsx index e775688a66e..94eb29bff06 100644 --- a/packages/docs/src/components/builder-content/index.tsx +++ b/packages/docs/src/components/builder-content/index.tsx @@ -1,5 +1,5 @@ import { component$, Resource, useResource$ } from '@qwik.dev/core'; -import { useLocation } from '@qwik.dev/city'; +import { useLocation } from '@qwik.dev/router'; import { QWIK_MODEL } from '../../constants'; export default component$<{ diff --git a/packages/docs/src/components/code-sandbox/index.tsx b/packages/docs/src/components/code-sandbox/index.tsx index 61670b9e149..f5cc6cb5379 100644 --- a/packages/docs/src/components/code-sandbox/index.tsx +++ b/packages/docs/src/components/code-sandbox/index.tsx @@ -1,7 +1,7 @@ -import { component$, useContext, useStylesScoped$, Slot, useSignal } from '@qwik.dev/core'; -import CSS from './index.css?inline'; +import { component$, Slot, useContext, useSignal, useStylesScoped$ } from '@qwik.dev/core'; import { GlobalStore } from '../../context'; import { EditIcon } from '../svgs/edit-icon'; +import CSS from './index.css?inline'; export default component$<{ src?: string; @@ -101,7 +101,7 @@ function examplePath( } = typeof opts === 'string' ? ({ path: opts } as any) : opts; const newPath = path .replace('/(qwik)/', '/') - .replace('/(qwikcity)/', '/') + .replace('/(qwikrouter)/', '/') .replace('/src/routes/demo', '/demo') .replace(/\/[\w\d]+\.tsx?$/, '/'); diff --git a/packages/docs/src/components/content-nav/content-nav.tsx b/packages/docs/src/components/content-nav/content-nav.tsx index ca5bd4eb63a..87f1c6ac5bd 100644 --- a/packages/docs/src/components/content-nav/content-nav.tsx +++ b/packages/docs/src/components/content-nav/content-nav.tsx @@ -1,5 +1,5 @@ -import { type ContentMenu, useContent, useLocation } from '@qwik.dev/city'; import { component$, useStyles$ } from '@qwik.dev/core'; +import { type ContentMenu, useContent, useLocation } from '@qwik.dev/router'; import styles from './content-nav.css?inline'; export const ContentNav = component$(() => { diff --git a/packages/docs/src/components/contributors/index.tsx b/packages/docs/src/components/contributors/index.tsx index ef59e5524fb..1c8d3fc7ad2 100644 --- a/packages/docs/src/components/contributors/index.tsx +++ b/packages/docs/src/components/contributors/index.tsx @@ -1,5 +1,5 @@ -import { useDocumentHead } from '@qwik.dev/city'; import { component$, useStylesScoped$ } from '@qwik.dev/core'; +import { useDocumentHead } from '@qwik.dev/router'; import styles from './contributors.css?inline'; export default component$(() => { diff --git a/packages/docs/src/components/docsearch/result.tsx b/packages/docs/src/components/docsearch/result.tsx index 836ae0f29e9..798e630d45f 100644 --- a/packages/docs/src/components/docsearch/result.tsx +++ b/packages/docs/src/components/docsearch/result.tsx @@ -1,6 +1,6 @@ import { Slot, component$, useContext, useSignal, useStore, useTask$ } from '@qwik.dev/core'; // import { QwikGPT } from '../qwik-gpt'; -import { Link } from '@qwik.dev/city'; +import { Link } from '@qwik.dev/router'; import { SearchContext } from './context'; import { AiResultOpenContext, type DocSearchState } from './doc-search'; import { Snippet } from './snippet'; diff --git a/packages/docs/src/components/footer/footer.tsx b/packages/docs/src/components/footer/footer.tsx index 0910423a53a..a8d29c44b60 100644 --- a/packages/docs/src/components/footer/footer.tsx +++ b/packages/docs/src/components/footer/footer.tsx @@ -1,14 +1,14 @@ import { component$ } from '@qwik.dev/core'; -import { QwikLogo } from '~/components/svgs/qwik-logo'; import { DiscordLogo } from '~/components/svgs/discord-logo'; import { GithubLogo } from '~/components/svgs/github-logo'; +import { QwikLogo } from '~/components/svgs/qwik-logo'; import { TwitterLogo } from '~/components/svgs/twitter-logo'; const baseUrl = 'https://qwik.dev'; const linkColumns = [ [ { title: 'Docs', href: `${baseUrl}/docs/` }, - { title: 'Qwik City', href: `${baseUrl}/docs/qwikcity/` }, + { title: 'Qwik Router', href: `${baseUrl}/docs/qwikrouter/` }, { title: 'Ecosystem', href: `${baseUrl}/ecosystem/` }, { title: 'Playground', href: `${baseUrl}/playground/` }, ], diff --git a/packages/docs/src/components/header/header.tsx b/packages/docs/src/components/header/header.tsx index 6765a7cd5ad..d31e5c13ad1 100644 --- a/packages/docs/src/components/header/header.tsx +++ b/packages/docs/src/components/header/header.tsx @@ -1,5 +1,5 @@ -import { useLocation } from '@qwik.dev/city'; import { component$, useContext, useStyles$, useVisibleTask$ } from '@qwik.dev/core'; +import { useLocation } from '@qwik.dev/router'; import { GlobalStore } from '../../context'; import { DocSearch } from '../docsearch/doc-search'; import { CloseIcon } from '../svgs/close-icon'; diff --git a/packages/docs/src/components/on-this-page/on-this-page.tsx b/packages/docs/src/components/on-this-page/on-this-page.tsx index 9a7337dc28f..b08b925d2af 100644 --- a/packages/docs/src/components/on-this-page/on-this-page.tsx +++ b/packages/docs/src/components/on-this-page/on-this-page.tsx @@ -1,5 +1,5 @@ -import { useContent, useLocation } from '@qwik.dev/city'; import { $, component$, useContext, useOnDocument, useSignal, useStyles$ } from '@qwik.dev/core'; +import { useContent, useLocation } from '@qwik.dev/router'; import { GlobalStore } from '../../context'; import { AlertIcon } from '../svgs/alert-icon'; import { ChatIcon } from '../svgs/chat-icon'; @@ -30,7 +30,7 @@ const QWIK_ADVANCED_GROUP = [ 'vite', ]; -const QWIKCITY_GROUP = [ +const QWIKROUTER_GROUP = [ 'action', 'api', 'caching', @@ -42,14 +42,14 @@ const QWIKCITY_GROUP = [ 'middleware', 'pages', 'project-structure', - 'qwikcity', + 'qwikrouter', 'route-loader', 'routing', 'server$', 'troubleshooting', 'validator', ]; -const QWIKCITY_ADVANCED_GROUP = [ +const QWIKROUTER_ADVANCED_GROUP = [ 'content-security-policy', 'menu', 'request-handling', @@ -68,13 +68,13 @@ const makeEditPageUrl = (url: string): string => { if (segments[1] == 'advanced') { if (QWIK_ADVANCED_GROUP.includes(segments[2])) { group = '(qwik)'; - } else if (QWIKCITY_ADVANCED_GROUP.includes(segments[2])) { - group = '(qwikcity)'; + } else if (QWIKROUTER_ADVANCED_GROUP.includes(segments[2])) { + group = '(qwikrouter)'; } } else if (QWIK_GROUP.includes(segments[1])) { group = '(qwik)'; - } else if (QWIKCITY_GROUP.includes(segments[1])) { - group = '(qwikcity)'; + } else if (QWIKROUTER_GROUP.includes(segments[1])) { + group = '(qwikrouter)'; } if (group) { diff --git a/packages/docs/src/components/package-manager-tabs/index.tsx b/packages/docs/src/components/package-manager-tabs/index.tsx index 75830a48aa5..df36a9ac9b6 100644 --- a/packages/docs/src/components/package-manager-tabs/index.tsx +++ b/packages/docs/src/components/package-manager-tabs/index.tsx @@ -1,5 +1,5 @@ -import { Slot, component$, useContext, useSignal, $, type PropsOf } from '@qwik.dev/core'; import { Tabs } from '@qwik-ui/headless'; +import { $, Slot, component$, useContext, useSignal, type PropsOf } from '@qwik.dev/core'; import { GlobalStore } from '~/context'; const pkgManagers = ['pnpm', 'npm', 'yarn', 'bun'] as const; diff --git a/packages/docs/src/components/qwik-gpt/gpt.md b/packages/docs/src/components/qwik-gpt/gpt.md index 5f659953178..7bee671db10 100644 --- a/packages/docs/src/components/qwik-gpt/gpt.md +++ b/packages/docs/src/components/qwik-gpt/gpt.md @@ -92,7 +92,7 @@ To link to other routes, you can use the `Link` component, it is like `` but ```tsx title="src/routes/user/[userID]/index.tsx" import { component$ } from '@qwik.dev/core'; -import { routeLoader$, useLocation, Link } from '@qwik.dev/city'; +import { routeLoader$, useLocation, Link } from '@qwik.dev/router'; export const useUserData = routeLoader$(async (requestEvent) => { const { userID } = requestEvent.params; diff --git a/packages/docs/src/components/qwik-gpt/search.tsx b/packages/docs/src/components/qwik-gpt/search.tsx index f8ae784ce1f..3a1187ce3a8 100644 --- a/packages/docs/src/components/qwik-gpt/search.tsx +++ b/packages/docs/src/components/qwik-gpt/search.tsx @@ -1,4 +1,4 @@ -// import { server$ } from '@qwik.dev/city'; +// import { server$ } from '@qwik.dev/router'; // import { createClient } from '@supabase/supabase-js'; import gpt from './gpt.md?raw'; // import { chatCompletion } from './streaming-gpt'; diff --git a/packages/docs/src/components/router-head/router-head.tsx b/packages/docs/src/components/router-head/router-head.tsx index 1c8c5d4dcba..c344efc897d 100644 --- a/packages/docs/src/components/router-head/router-head.tsx +++ b/packages/docs/src/components/router-head/router-head.tsx @@ -1,6 +1,6 @@ /* eslint-disable no-console */ -import { useDocumentHead, useLocation } from '@qwik.dev/city'; import { component$ } from '@qwik.dev/core'; +import { useDocumentHead, useLocation } from '@qwik.dev/router'; import { Social } from './social'; import { ThemeScript } from './theme-script'; import { Vendor } from './vendor'; diff --git a/packages/docs/src/components/sidebar/sidebar.tsx b/packages/docs/src/components/sidebar/sidebar.tsx index 45abec1021e..fe53a2aac02 100644 --- a/packages/docs/src/components/sidebar/sidebar.tsx +++ b/packages/docs/src/components/sidebar/sidebar.tsx @@ -1,5 +1,5 @@ -import { type ContentMenu, routeLoader$, useContent, useLocation } from '@qwik.dev/city'; import { component$, sync$, useContext, useOnDocument, useStyles$ } from '@qwik.dev/core'; +import { type ContentMenu, routeLoader$, useContent, useLocation } from '@qwik.dev/router'; import { GlobalStore } from '../../context'; import { CloseIcon } from '../svgs/close-icon'; import styles from './sidebar.css?inline'; @@ -11,7 +11,7 @@ export const useMarkdownItems = routeLoader$(async () => { return [ k .replace('../../routes', '') - .replace('(qwikcity)/', '') + .replace('(qwikrouter)/', '') .replace('(qwik)/', '') .replaceAll(/([()])/g, '') .replace('index.mdx', '') @@ -65,7 +65,7 @@ export const SideBar = component$((props: { allOpen?: boolean }) => { const { menu } = useContent(); const { url } = useLocation(); const markdownItems = useMarkdownItems(); - const allOpen = url.pathname.startsWith('/qwikcity/') || props.allOpen; + const allOpen = url.pathname.startsWith('/qwikrouter/') || props.allOpen; useOnDocument( 'DOMContentLoaded', diff --git a/packages/docs/src/entry.cloudflare-pages.tsx b/packages/docs/src/entry.cloudflare-pages.tsx index a04892d8341..c9b4f145629 100644 --- a/packages/docs/src/entry.cloudflare-pages.tsx +++ b/packages/docs/src/entry.cloudflare-pages.tsx @@ -1,7 +1,7 @@ -import qwikCityPlan from '@qwik-city-plan'; -import { createQwikCity } from '@qwik.dev/city/middleware/cloudflare-pages'; +import qwikRouterConfig from '@qwik-router-config'; +import { createQwikRouter } from '@qwik.dev/router/middleware/cloudflare-pages'; import render from './entry.ssr'; -const fetch = createQwikCity({ render, qwikCityPlan }); +const fetch = createQwikRouter({ render, qwikRouterConfig }); export { fetch }; diff --git a/packages/docs/src/entry.preview.tsx b/packages/docs/src/entry.preview.tsx index 383df20c1b7..01f08eb6761 100644 --- a/packages/docs/src/entry.preview.tsx +++ b/packages/docs/src/entry.preview.tsx @@ -1,6 +1,6 @@ -import qwikCityPlan from '@qwik-city-plan'; -import { createQwikCity } from '@qwik.dev/city/middleware/node'; +import qwikRouterConfig from '@qwik-router-config'; +import { createQwikRouter } from '@qwik.dev/router/middleware/node'; import render from './entry.ssr'; -/** The default export is the QwikCity adapter used by Vite preview. */ -export default createQwikCity({ render, qwikCityPlan }); +/** The default export is the QwikRouter adapter used by Vite preview. */ +export default createQwikRouter({ render, qwikRouterConfig }); diff --git a/packages/docs/src/media/docs/qwikcity/routing-files.png b/packages/docs/src/media/docs/qwikrouter/routing-files.png similarity index 100% rename from packages/docs/src/media/docs/qwikcity/routing-files.png rename to packages/docs/src/media/docs/qwikrouter/routing-files.png diff --git a/packages/docs/src/media/docs/qwikcity/routing.png b/packages/docs/src/media/docs/qwikrouter/routing.png similarity index 100% rename from packages/docs/src/media/docs/qwikcity/routing.png rename to packages/docs/src/media/docs/qwikrouter/routing.png diff --git a/packages/docs/src/media/icons/qwikCity_and_routing.svg b/packages/docs/src/media/icons/qwikRouter_and_routing.svg similarity index 100% rename from packages/docs/src/media/icons/qwikCity_and_routing.svg rename to packages/docs/src/media/icons/qwikRouter_and_routing.svg diff --git a/packages/docs/src/root.tsx b/packages/docs/src/root.tsx index e1f8ace3848..26c489b8ee0 100644 --- a/packages/docs/src/root.tsx +++ b/packages/docs/src/root.tsx @@ -1,6 +1,6 @@ -import { QwikCityProvider, RouterOutlet } from '@qwik.dev/city'; import { component$, useContextProvider, useStore } from '@qwik.dev/core'; import { Insights } from '@qwik.dev/core/insights'; +import { QwikRouterProvider, RouterOutlet } from '@qwik.dev/router'; import RealMetricsOptimization from './components/real-metrics-optimization/real-metrics-optimization'; import { RouterHead } from './components/router-head/router-head'; import { BUILDER_PUBLIC_API_KEY } from './constants'; @@ -65,7 +65,7 @@ export default component$(() => { useContextProvider(GlobalStore, store); return ( - +