Skip to content

Commit

Permalink
chore: add nx
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored and Jack Hsu committed Dec 21, 2022
1 parent d3c9c0b commit e80cdcf
Show file tree
Hide file tree
Showing 8 changed files with 457 additions and 53 deletions.
86 changes: 86 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": [
"build",
"lint",
"typecheck",
"test-unit",
"test-build",
"test-docs",
"docs-build"
],
"accessToken": "NjYwZGFlNWYtZGYyNS00MTIzLTkzYTEtYzAxZTZiYzUwYTVifHJlYWQtd3JpdGU="
}
}
},
"namedInputs": {
"default": [
"{workspaceRoot}/packages/**/*",
{
"runtime": "node -e \"console.log(process.platform)\""
}
],
"production": [
"default",
"!{workspaceRoot}/packages/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{workspaceRoot}/vitest.config.e2e.ts",
"!{workspaceRoot}/vitest.config.ts",
"!{workspaceRoot}/.eslintignore",
"!{workspaceRoot}/.eslintrc.cjs",
"!{projectRoot}/tsconfig.check.json"
],
"playground": [
"default",
"{workspaceRoot}/playground/**/*",
{
"env": "VITE_TEST_BUILD"
},
{
"env": "VITE_TEST_WITHOUT_PLUGIN_COMMONJS"
}
]
},
"targetDefaults": {
"typecheck": {
"dependsOn": [
"default",
"{projectRoot}/tsconfig.check.json",
"{projectRoot}/**/*.[jt]sx?"
]
},
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "!{projectRoot}/LICENSE.md"],
"outputs": ["{projectRoot}/dist"]
},
"test-unit": {
"dependsOn": ["^build"],
"inputs": ["default", "^production", "{workspaceRoot}/vitest.config.ts"]
},
"test-build": {
"dependsOn": ["^build"],
"inputs": ["playground", "{workspaceRoot}/vitest.config.e2e.ts"]
},
"test-serve": {
"dependsOn": ["^build"],
"inputs": ["playground", "{workspaceRoot}/vitest.config.e2e.ts"]
},
"docs": {
"dependsOn": ["^build"],
"inputs": ["{workspaceRoot}/docs/**/*"]
},
"docs-build": {
"dependsOn": ["^build"],
"inputs": ["{workspaceRoot}/docs/**/*"],
"outputs": ["{workspaceRoot}/docs/.vitepress/dist"]
},
"docs-serve": {
"dependsOn": ["^build"],
"inputs": ["{workspaceRoot}/docs/**/*"]
}
},
"defaultBase": "main"
}
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"lint": "eslint --cache .",
"typecheck": "tsc -p scripts --noEmit && pnpm -r --parallel run typecheck",
"test": "run-s test-unit test-serve test-build",
"test-serve": "vitest run -c vitest.config.e2e.ts",
"test-build": "VITE_TEST_BUILD=1 vitest run -c vitest.config.e2e.ts",
"test-serve": "nx exec -- vitest run -c vitest.config.e2e.ts",
"test-build": "VITE_TEST_BUILD=1 nx exec -- vitest run -c vitest.config.e2e.ts",
"test-build-without-plugin-commonjs": "VITE_TEST_WITHOUT_PLUGIN_COMMONJS=1 pnpm test-build",
"test-unit": "vitest run",
"test-docs": "pnpm run docs-build",
"test-unit": "nx exec -- vitest run",
"test-docs": "nx exec -- pnpm run docs-build",
"debug-serve": "VITE_DEBUG_SERVE=1 vitest run -c vitest.config.e2e.ts",
"debug-build": "VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 vitest run -c vitest.config.e2e.ts",
"docs": "vitepress dev docs",
"docs-build": "vitepress build docs",
"docs-serve": "vitepress serve docs",
"build": "pnpm -r --filter='./packages/*' run build",
"docs": "nx exec -- vitepress dev docs",
"docs-build": "nx exec -- vitepress build docs",
"docs-serve": "nx exec -- vitepress serve docs",
"build": "nx run-many --target=build --projects=vite,@vitejs/plugin-legacy,create-vite",
"dev": "pnpm -r --parallel --filter='./packages/*' run dev",
"release": "tsx scripts/release.ts",
"ci-publish": "tsx scripts/publishCI.ts",
Expand Down Expand Up @@ -90,7 +90,9 @@
"vite": "workspace:*",
"vitepress": "^1.0.0-alpha.31",
"vitest": "^0.25.7",
"vue": "^3.2.45"
"vue": "^3.2.45",
"nx": "15.3.3",
"@nrwl/nx-cloud": "latest"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged --concurrent false"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild",
"typecheck": "tsc --noEmit",
"typecheck": "nx exec -- tsc --noEmit",
"prepublishOnly": "npm run build"
},
"engines": {
Expand Down
31 changes: 1 addition & 30 deletions packages/vite/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2933,35 +2933,6 @@ Repository: lukeed/sirv

---------------------------------------

## sourcemap-codec
License: MIT
By: Rich Harris
Repository: https://github.com/Rich-Harris/sourcemap-codec

> The MIT License
>
> Copyright (c) 2015 Rich Harris
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
---------------------------------------

## statuses
License: MIT
By: Douglas Christopher Wilson, Jonathan Ong
Expand Down Expand Up @@ -3163,7 +3134,7 @@ Repository: unjs/ufo

> MIT License
>
> Copyright (c) 2020 Nuxt Contrib
> Copyright (c) Pooya Parsa <pooya@pi0.io>
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"build-types-roll": "api-extractor run && rimraf temp",
"build-types-post-patch": "tsx scripts/postPatchTypes.ts",
"build-types-check": "tsx scripts/checkBuiltTypes.ts && tsc --project tsconfig.check.json",
"typecheck": "tsc --noEmit",
"typecheck": "nx exec -- tsc --noEmit",
"lint": "eslint --cache --ext .ts src/**",
"format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
"prepublishOnly": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "1.0.0",
"scripts": {
"typecheck": "tsc --noEmit"
"typecheck": "nx exec -- tsc --noEmit"
},
"devDependencies": {
"convert-source-map": "^2.0.0",
Expand Down
Loading

0 comments on commit e80cdcf

Please sign in to comment.