diff --git a/.gitignore b/.gitignore index a050116236c5d..065ed71f3ea10 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ packages/*/node_modules packages/*/data docs/public/*.st docs/public/*.toml +docs/public/schema.json !cli/cmd/turbo cli/npm/turbo-android-arm64/bin diff --git a/docs/package.json b/docs/package.json index d75716fdaf78c..cb02b65c9e092 100644 --- a/docs/package.json +++ b/docs/package.json @@ -8,7 +8,7 @@ "start": "next start", "build": "next build", "lint": "next lint", - "schema": "ts-json-schema-generator -p ./schema.d.ts -o ./public/schema.json -t Schema" + "schema": "ts-json-schema-generator -p ./schema.d.ts -o ./public/schema.json -t Schema --minify" }, "author": "Jared Palmer", "license": "MPL-2.0", @@ -66,7 +66,7 @@ "eslint-config-prettier": "^8.3.0", "postcss": "^8.3.5", "tailwindcss": "^3.0.15", - "ts-json-schema-generator": "^0.97.0", + "ts-json-schema-generator": "^0.98.0-next.0", "typescript": "^4.5.5", "webpack": "^5.65.0" }, diff --git a/docs/public/schema.json b/docs/public/schema.json deleted file mode 100644 index d1164c1089101..0000000000000 --- a/docs/public/schema.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "$ref": "#/definitions/Schema", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "Pipeline": { - "additionalProperties": false, - "properties": { - "cache": { - "default": true, - "description": "Whether or not to cache the task outputs. Setting cache to false is useful for daemon or long-running \"watch\" or development mode tasks that you don't want to cache.", - "type": "boolean" - }, - "dependsOn": { - "default": [], - "description": "The list of tasks and environment variables that this task depends on.\n\nPrefixing an item in dependsOn with a ^ tells turbo that this pipeline task depends on the package's topological dependencies completing the task with the ^ prefix first (e.g. \"a package's build tasks should only run once all of its dependencies and devDependencies have completed their own build commands\").\n\nItems in dependsOn without ^ prefix, express the relationships between tasks at the package level (e.g. \"a package's test and lint commands depend on build being completed first\").\n\nPrefixing an item in dependsOn with a $ tells turbo that this pipeline task depends the value of that environment variable.", - "items": { - "type": "string" - }, - "type": "array" - }, - "outputs": { - "default": [ - "dist/**", - "build/**" - ], - "description": "The set of glob patterns of a task's cacheable filesystem outputs.\n\nNote: turbo automatically logs stderr/stdout to .turbo/run-.log. This file is always treated as a cacheable artifact and never needs to be specified.\n\nPassing an empty array can be used to tell turbo that a task is a side-effect and thus doesn't emit any filesystem artifacts (e.g. like a linter), but you still want to cache its logs (and treat them like an artifact).", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "Schema": { - "additionalProperties": false, - "properties": { - "$schema": { - "default": "https://turborepo.org/schema.json", - "type": "string" - }, - "baseBranch": { - "default": "origin/master", - "description": "The base branch or your git repository. Git is used by turbo in its hashing algorithm and --since CLI flag.", - "type": "string" - }, - "globalDependencies": { - "default": [], - "description": "A list of globs and environment variables for implicit global hash dependencies. Environment variables should be prefixed with $ (e.g. $GITHUB_TOKEN).\n\nAny other entry without this prefix, will be considered filesystem glob. The contents of these files will be included in the global hashing algorithm and affect the hashes of all tasks.\n\nThis is useful for busting the cache based on .env files (not in Git), environment variables, or any root level file that impacts package tasks (but are not represented in the traditional dependency graph\n\n(e.g. a root tsconfig.json, jest.config.js, .eslintrc, etc.)).", - "items": { - "type": "string" - }, - "type": "array" - }, - "pipeline": { - "additionalProperties": { - "$ref": "#/definitions/Pipeline", - "description": "The name of a task that can be executed by turbo run. If turbo finds a workspace package with a package.json scripts object with a matching key, it will apply the pipeline task configuration to that NPM script during execution. This allows you to use pipeline to set conventions across your entire Turborepo." - }, - "default": {}, - "description": "An object representing the task dependency graph of your project. turbo interprets these conventions to properly schedule, execute, and cache the outputs of tasks in your project.", - "type": "object" - } - }, - "required": [ - "pipeline" - ], - "type": "object" - } - } -} \ No newline at end of file diff --git a/turbo.json b/turbo.json index 769a7f33276c1..e52d98e127b79 100644 --- a/turbo.json +++ b/turbo.json @@ -37,6 +37,11 @@ ], "dependsOn": [] }, + "schema": { + "outputs": [ + "docs/public/schema.json" + ] + }, "create-turbo#test": { "dependsOn": [ "create-turbo#build" diff --git a/yarn.lock b/yarn.lock index 0436f02074a24..f1fa311183ae1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2214,11 +2214,16 @@ commander@^4.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== -commander@^8.2.0, commander@^8.3.0: +commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== +commander@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.0.0.tgz#86d58f24ee98126568936bd1d3574e0308a99a40" + integrity sha512-JJfP2saEKbQqvW+FI93OYUB4ByV5cizMpFMiiJI8xDbBvQvSkIk0VvQdn1CZ8mqAO8Loq2h0gYTYtDFUZUeERw== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -6263,7 +6268,7 @@ safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-stable-stringify@^2.2.0: +safe-stable-stringify@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz#ab67cbe1fe7d40603ca641c5e765cb942d04fc73" integrity sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg== @@ -6927,17 +6932,17 @@ ts-jest@^27.1.1: semver "7.x" yargs-parser "20.x" -ts-json-schema-generator@^0.97.0: - version "0.97.0" - resolved "https://registry.yarnpkg.com/ts-json-schema-generator/-/ts-json-schema-generator-0.97.0.tgz#ea4f2ddbcba1fb6c0a2f97d242783b7fdc8e203b" - integrity sha512-kPDq4ut8Mu1ZgSN7OeTXz+ueb1juFt2eyGd23lMr3WoN5sq4Xa9m22kDI46OlwapE0aF8e1pUesOFgDcATHcuA== +ts-json-schema-generator@^0.98.0-next.0: + version "0.98.0-next.0" + resolved "https://registry.yarnpkg.com/ts-json-schema-generator/-/ts-json-schema-generator-0.98.0-next.0.tgz#731f088f3fbcb4de050bf1559f9c9fa256098a69" + integrity sha512-3kdpdPOJhaFpiK55XZe9pzTBELG8eStp7B7hl2rRh8BUu3170u2v/JqqGeB2pvY3ecH4eXq6fZZ6odQnO7J/pg== dependencies: "@types/json-schema" "^7.0.9" - commander "^8.2.0" + commander "^9.0.0" glob "^7.2.0" json5 "^2.2.0" - safe-stable-stringify "^2.2.0" - typescript "~4.4.3" + safe-stable-stringify "^2.3.1" + typescript "~4.5.4" tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: version "3.12.0" @@ -7041,16 +7046,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.5.5: +typescript@^4.5.5, typescript@~4.5.4: version "4.5.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== -typescript@~4.4.3: - version "4.4.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== - unbox-primitive@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471"