diff --git a/.eslintrc.js b/.eslintrc.js index 24a9d6a62..c2bb5f439 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -43,7 +43,7 @@ module.exports = { 'n/no-extraneous-import': [ 'error', { - allowModules: ['vite'] + allowModules: ['vite', 'vitest'] } ], 'n/no-extraneous-require': [ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 254c2be5a..9dc89965e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,21 +54,22 @@ jobs: cache-dependency-path: '**/pnpm-lock.yaml' - name: install run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts - - name: build - id: build - run: pnpm build + - name: format + run: pnpm check:format - name: lint if: (${{ success() }} || ${{ failure() }}) - run: pnpm lint + run: pnpm check:lint + - name: types + if: (${{ success() }} || ${{ failure() }}) + run: pnpm check:types - name: audit if: (${{ success() }} || ${{ failure() }}) - run: pnpm audit + run: pnpm check:audit + - name: publint + if: (${{ success() }} || ${{ failure() }}) + run: pnpm check:publint - # this is the test matrix, it runs with node16 on linux,windows,macos + node14,18 on linux - # it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail) test: - needs: checks - if: (${{ success() }} || ${{ failure() }}) && (${{ needs.checks.output.build_successful }}) timeout-minutes: 10 runs-on: ${{ matrix.os }} strategy: @@ -111,8 +112,6 @@ jobs: - name: install for node14 if: matrix.node == 14 run: pnpm install --no-frozen-lockfile --prefer-offline --ignore-scripts - - name: build - run: pnpm build - name: install playwright chromium run: pnpm playwright install chromium - name: run tests diff --git a/.gitignore b/.gitignore index c90a9da58..113f1eb0c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ temp **/temp *.tmp **/*.tmp +.eslintcache # build and dist build diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..c5e9233f7 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +aggregate-output=true +reporter=append-only diff --git a/package.json b/package.json index caad19f33..a13e89261 100644 --- a/package.json +++ b/package.json @@ -2,18 +2,20 @@ "name": "vite-plugin-svelte-monorepo", "private": true, "scripts": { - "dev": "pnpm --dir packages/vite-plugin-svelte dev", - "build": "pnpm --dir packages/vite-plugin-svelte build", "test": "run-s -c test:unit test:build test:serve", "test:unit": "vitest run", "test:serve": "vitest run -c vitest.config.e2e.ts", "test:build": "cross-env TEST_BUILD=1 vitest run -c vitest.config.e2e.ts", - "lint": "eslint --ignore-path .gitignore '**/*.{js,ts,svelte,html,svx,md}'", - "lint:fix": "pnpm lint --fix", - "format": "prettier --ignore-path .gitignore '**/*.{css,scss,svelte,html,js,ts,svx,md}' --check", - "format:fix": "pnpm format --write", - "fixup": "run-s lint:fix format:fix", - "release": "pnpm build && pnpm changeset publish", + "check": "run-p -c check:*", + "check:audit": "pnpm audit --prod", + "check:publint": "pnpm --filter \"./packages/*\" --parallel check:publint", + "check:types": "pnpm --filter \"./packages/*\" --parallel check:types", + "check:lint": "eslint --cache --ignore-path .gitignore '**/*.{js,ts,svelte,html,svx,md}'", + "check:format": "prettier --cache --ignore-path .gitignore '**/*.{css,scss,svelte,html,js,ts,svx,md}' --check", + "lint": "pnpm check:lint --fix", + "format": "pnpm check:format --write", + "fixup": "run-s lint format", + "release": "pnpm changeset publish", "prepare": "husky install" }, "devDependencies": { @@ -42,6 +44,7 @@ "playwright-core": "^1.33.0", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", + "publint": "^0.1.12", "rimraf": "^5.0.0", "svelte": "^3.59.1", "typescript": "^5.0.4", @@ -49,9 +52,9 @@ "vitest": "^0.31.0" }, "lint-staged": { - "*.{js,ts,svelte,html,md,svx}": "eslint --fix", + "*.{js,ts,svelte,html,md,svx}": "eslint --cache --fix", "*.{css,scss,svelte,html,js,ts,svx,md}": [ - "prettier --write" + "prettier --cache --write" ] }, "packageManager": "pnpm@8.5.0", @@ -61,8 +64,7 @@ }, "pnpm": { "overrides": { - "@sveltejs/vite-plugin-svelte": "workspace:^", - "tsup>postcss-load-config@<4": "^4.0.0" + "@sveltejs/vite-plugin-svelte": "workspace:^" }, "peerDependencyRules": { "allowedVersions": { diff --git a/packages/e2e-tests/_test_dependencies/svelte-nested/package.json b/packages/e2e-tests/_test_dependencies/svelte-nested/package.json index 2d548a776..f029e57d0 100644 --- a/packages/e2e-tests/_test_dependencies/svelte-nested/package.json +++ b/packages/e2e-tests/_test_dependencies/svelte-nested/package.json @@ -4,6 +4,7 @@ "name": "e2e-test-dep-svelte-nested", "svelte": "src/index.js", "main": "src/index.js", + "type": "module", "files": [ "src" ], diff --git a/packages/e2e-tests/vite-ssr/index.html b/packages/e2e-tests/vite-ssr/index.html index c60ac7f81..500ac651c 100644 --- a/packages/e2e-tests/vite-ssr/index.html +++ b/packages/e2e-tests/vite-ssr/index.html @@ -8,6 +8,6 @@
- +