-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
616 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist | ||
node_modules | ||
target | ||
**/.local* | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
src | ||
target | ||
util | ||
**/.local* | ||
*.tgz | ||
tsconfig.json | ||
rollup.config.js | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Core utilities and types for Taplo, not intended for standalone use. | ||
|
||
All the documentation and information is available on the [website](https://taplo.tamasfe.dev). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "@taplo/core", | ||
"version": "0.1.0", | ||
"description": "Commonly used types for Taplo", | ||
"author": { | ||
"name": "tamasfe", | ||
"url": "https://github.com/tamasfe" | ||
}, | ||
"scripts": { | ||
"build": "yarn rollup --silent -c rollup.config.js", | ||
"prepack": "yarn build" | ||
}, | ||
"types": "dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"autoTag": { | ||
"enabled": true | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^22.0.0", | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"@types/node": "^17.0.41", | ||
"esbuild": "^0.14.45", | ||
"rollup": "^2.75.6", | ||
"rollup-plugin-esbuild": "^4.9.1", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.7.3" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import path from "path"; | ||
import process from "process"; | ||
import { minify } from "rollup-plugin-esbuild"; | ||
import typescript from "rollup-plugin-typescript2"; | ||
|
||
export default { | ||
input: { | ||
index: "src/index.ts", | ||
}, | ||
output: { | ||
sourcemap: false, | ||
name: "taploCore", | ||
format: "umd", | ||
dir: "dist", | ||
}, | ||
plugins: [ | ||
typescript(), | ||
commonjs(), | ||
resolve({ | ||
jsnext: true, | ||
preferBuiltins: true, | ||
rootDir: path.join(process.cwd(), ".."), | ||
}), | ||
minify(), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
import { FormatterOptions } from "./formatter"; | ||
|
||
export interface Config { | ||
/** | ||
* Files to exclude (ignore). | ||
* | ||
* A list of Unix-like [glob](https://en.wikipedia.org/wiki/Glob_(programming)) path patterns. Globstars (`**`) are supported. | ||
* | ||
* Relative paths are **not** relative to the configuration file, but rather depends on the tool using the configuration. | ||
* | ||
* This has priority over `include`. | ||
*/ | ||
exclude?: string[]; | ||
/** | ||
* Formatting options. | ||
*/ | ||
formatting?: FormatterOptions; | ||
/** | ||
* Files to include. | ||
* | ||
* A list of Unix-like [glob](https://en.wikipedia.org/wiki/Glob_(programming)) path patterns. Globstars (`**`) are supported. | ||
* | ||
* Relative paths are **not** relative to the configuration file, but rather depends on the tool using the configuration. | ||
* | ||
* Omitting this property includes all files, **however an empty array will include none**. | ||
*/ | ||
include?: string[]; | ||
/** | ||
* Rules are used to override configurations by path and keys. | ||
*/ | ||
rule?: Rule[]; | ||
/** | ||
* Schema validation options. | ||
*/ | ||
schema?: SchemaOptions; | ||
} | ||
|
||
/** | ||
* A plugin to extend Taplo's capabilities. | ||
*/ | ||
export interface Plugin { | ||
/** | ||
* Optional settings for the plugin. | ||
*/ | ||
settings?: { | ||
[k: string]: unknown; | ||
}; | ||
[k: string]: unknown; | ||
} | ||
/** | ||
* A rule to override options by either name or file. | ||
*/ | ||
export interface Rule { | ||
/** | ||
* Files that are excluded from this rule. | ||
* | ||
* A list of Unix-like [glob](https://en.wikipedia.org/wiki/Glob_(programming)) path patterns. | ||
* | ||
* Relative paths are **not** relative to the configuration file, but rather depends on the tool using the configuration. | ||
* | ||
* This has priority over `include`. | ||
*/ | ||
exclude?: string[]; | ||
/** | ||
* Formatting options. | ||
*/ | ||
formatting?: FormatterOptions; | ||
/** | ||
* Files this rule is valid for. | ||
* | ||
* A list of Unix-like [glob](https://en.wikipedia.org/wiki/Glob_(programming)) path patterns. | ||
* | ||
* Relative paths are **not** relative to the configuration file, but rather depends on the tool using the configuration. | ||
* | ||
* Omitting this property includes all files, **however an empty array will include none**. | ||
*/ | ||
include?: string[]; | ||
/** | ||
* Keys the rule is valid for in a document. | ||
* | ||
* A list of Unix-like [glob](https://en.wikipedia.org/wiki/Glob_(programming)) dotted key patterns. | ||
* | ||
* This allows enabling the rule for specific paths in the document. | ||
* | ||
* For example: | ||
* | ||
* - `package.metadata` will enable the rule for everything inside the `package.metadata` table, including itself. | ||
* | ||
* If omitted, the rule will always be valid for all keys. | ||
*/ | ||
keys?: string[]; | ||
/** | ||
* The name of the rule. | ||
* | ||
* Used in `taplo::<name>` comments. | ||
*/ | ||
name?: string; | ||
/** | ||
* Schema validation options. | ||
*/ | ||
schema?: SchemaOptions; | ||
} | ||
/** | ||
* Options for schema validation and completion. | ||
* | ||
* Schemas in rules with defined keys are ignored. | ||
*/ | ||
export interface SchemaOptions { | ||
/** | ||
* Whether the schema should be enabled or not. | ||
* | ||
* Defaults to true if omitted. | ||
*/ | ||
enabled?: boolean; | ||
/** | ||
* A local file path to the schema, overrides `url` if set. | ||
* | ||
* For URLs, please use `url` instead. | ||
*/ | ||
path?: string; | ||
/** | ||
* A full absolute Url to the schema. | ||
* | ||
* The url of the schema, supported schemes are `http`, `https`, `file` and `taplo`. | ||
*/ | ||
url?: string; | ||
} |
Oops, something went wrong.