From 3647b28c7c26c5842edf77d6a81c232d7cea23fd Mon Sep 17 00:00:00 2001 From: verytactical <186486509+verytactical@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:46:25 +0400 Subject: [PATCH] refactor: move `configSchema.json` (#1317) --- CONTRIBUTING.md | 2 +- bin/test/fail.config.json | 2 +- bin/test/success.config.json | 2 +- bin/test/success.config.with.decompilation.json | 2 +- docs/src/content/docs/book/config.mdx | 6 +++--- docs/src/content/docs/zh-cn/book/config.mdx | 6 +++--- package.json | 2 +- {schemas => src/config}/configSchema.json | 2 +- src/test/compilation-failed/tact.config.json | 2 +- tact.config.json | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) rename {schemas => src/config}/configSchema.json (99%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 257c6cf74..a230d0bb4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,7 +107,7 @@ Tact uses the [meow](https://github.com/sindresorhus/meow) CLI arguments parser. The main entry point for the Tact CLI is [src/node.ts](./src/node.ts) and [src/pipeline/build.ts](./src/pipeline/build.ts) is the platform-independent compiler driver which contains the high-level compiler pipeline logic described above. -The Tact CLI gets Tact settings from a `tact.config.json` file or creates a default config for a single-file compilation mode. The format of `tact.config.json` files is specified in [schemas/configSchema.json](./schemas/configSchema.json). +The Tact CLI gets Tact settings from a `tact.config.json` file or creates a default config for a single-file compilation mode. The format of `tact.config.json` files is specified in [src/config/configSchema.json](src/config/configSchema.json). The so-called "pre-compilation" steps that include imports resolution, type-checking, building schemas for high-level Tact data structures to be serialized/deserialized as cells (this step is dubbed "allocation") are located in [src/pipeline/precompile.ts](src/pipeline/precompile.ts). diff --git a/bin/test/fail.config.json b/bin/test/fail.config.json index 78579f791..90c3b1357 100644 --- a/bin/test/fail.config.json +++ b/bin/test/fail.config.json @@ -1,5 +1,5 @@ { - "$schema": "../../schemas/configSchema.json", + "$schema": "../../src/config/configSchema.json", "projects": [ { "name": "fail", diff --git a/bin/test/success.config.json b/bin/test/success.config.json index 26d3ab935..30294bd47 100644 --- a/bin/test/success.config.json +++ b/bin/test/success.config.json @@ -1,5 +1,5 @@ { - "$schema": "../../schemas/configSchema.json", + "$schema": "../../src/config/configSchema.json", "projects": [ { "name": "success", diff --git a/bin/test/success.config.with.decompilation.json b/bin/test/success.config.with.decompilation.json index 53d3ca3ac..4eecdf3d0 100644 --- a/bin/test/success.config.with.decompilation.json +++ b/bin/test/success.config.with.decompilation.json @@ -1,5 +1,5 @@ { - "$schema": "../../schemas/configSchema.json", + "$schema": "../../src/config/configSchema.json", "projects": [ { "name": "success", diff --git a/docs/src/content/docs/book/config.mdx b/docs/src/content/docs/book/config.mdx index 0b3f1791d..61dabb860 100644 --- a/docs/src/content/docs/book/config.mdx +++ b/docs/src/content/docs/book/config.mdx @@ -15,13 +15,13 @@ This page lists all the configuration options as they're structured in the [sche ## `$schema` {#schema} -A [JSON schema](https://json-schema.org/) file is available for editors to provide autocompletion and hover hints: [configSchema.json](http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json). +A [JSON schema](https://json-schema.org/) file is available for editors to provide autocompletion and hover hints: [configSchema.json](http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json). Simply add the `$schema` field on top your configuration file: ```json filename="tact.config.json" {2} { - "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json", + "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json", "projects": [] } ``` @@ -369,7 +369,7 @@ In [Blueprint][bp], `mode` is always set to `"full"{:json}` and cannot be overwr ```json filename="tact.config.json" copy=false { - "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json", + "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json", "projects": [ { "name": "basic", diff --git a/docs/src/content/docs/zh-cn/book/config.mdx b/docs/src/content/docs/zh-cn/book/config.mdx index 4d41ca9fc..ebffe9b61 100644 --- a/docs/src/content/docs/zh-cn/book/config.mdx +++ b/docs/src/content/docs/zh-cn/book/config.mdx @@ -14,13 +14,13 @@ title: 配置 ## `$schema` {#schema} -编辑器可使用[JSON 模式](https://json-schema.org/) 文件提供自动完成和悬停提示:[configSchema.json](http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json)。 +编辑器可使用[JSON 模式](https://json-schema.org/) 文件提供自动完成和悬停提示:[configSchema.json](http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json)。 只需在配置文件顶部添加 `$schema` 字段即可: ```json filename="tact.config.json" {2} { - "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json", + "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json", "projects":[] } ``` @@ -372,7 +372,7 @@ Value | Description ```json filename="tact.config.json" copy=false { - "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json", + "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json", "projects": [ { "name": "basic", diff --git a/package.json b/package.json index 18059cbad..76f1f7c95 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "release": "yarn clean && yarn build && yarn coverage && yarn release-it --npm.yarn1", "type": "tsc --noEmit", "lint": "yarn eslint .", - "lint:schema": "ajv validate -s schemas/configSchema.json -d tact.config.json", + "lint:schema": "ajv validate -s src/config/configSchema.json -d tact.config.json", "fmt": "yarn prettier -l -w .", "fmt:check": "yarn prettier --check .", "spell": "yarn cspell --no-progress \"**\"", diff --git a/schemas/configSchema.json b/src/config/configSchema.json similarity index 99% rename from schemas/configSchema.json rename to src/config/configSchema.json index 7b627f50f..3b33b1f42 100644 --- a/schemas/configSchema.json +++ b/src/config/configSchema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/schema#", - "$id": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json", + "$id": "http://raw.githubusercontent.com/tact-lang/tact/main/src/config/configSchema.json", "title": "Tact configuration schema", "description": "JSON Schema for tact.config.json", "type": "object", diff --git a/src/test/compilation-failed/tact.config.json b/src/test/compilation-failed/tact.config.json index 29a952d88..bccd4298d 100644 --- a/src/test/compilation-failed/tact.config.json +++ b/src/test/compilation-failed/tact.config.json @@ -1,5 +1,5 @@ { - "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json", + "$schema": "../../config/configSchema.json", "projects": [ { "name": "const-eval-invalid-address", diff --git a/tact.config.json b/tact.config.json index 3453dd029..761e46f0b 100644 --- a/tact.config.json +++ b/tact.config.json @@ -1,5 +1,5 @@ { - "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json", + "$schema": "./src/config/configSchema.json", "projects": [ { "name": "echo",