Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move configSchema.json #1317

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion bin/test/fail.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../../schemas/configSchema.json",
"$schema": "../../src/config/configSchema.json",
"projects": [
{
"name": "fail",
Expand Down
2 changes: 1 addition & 1 deletion bin/test/success.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../../schemas/configSchema.json",
"$schema": "../../src/config/configSchema.json",
"projects": [
{
"name": "success",
Expand Down
2 changes: 1 addition & 1 deletion bin/test/success.config.with.decompilation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../../schemas/configSchema.json",
"$schema": "../../src/config/configSchema.json",
"projects": [
{
"name": "success",
Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/docs/book/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
```
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/docs/zh-cn/book/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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":[]
}
```
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 \"**\"",
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/test/compilation-failed/tact.config.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tact.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json",
"$schema": "./src/config/configSchema.json",
"projects": [
{
"name": "echo",
Expand Down
Loading