denoland / deno_config Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
To better support workspaces, we need to compute various configurations like linter, formatter, test and TSC settings.
We need an API that given the specifier will return correct setting, eg.:
get_lint_options_for_specifier(specifier: &Url) -> Result<LintConfig, AnyError>;
get_compiler_options_for_specifier(specifier: &Url) -> Result<TsConfig, AnyError>;
get_fmt_options_for_specifier(specifier: &Url) -> Result<FmtConfig, AnyError>;
get_test_options_for_specifier(specifier: &Url) -> Result<TestConfig, AnyError>;
For format
and lint
we want to collect all specifiers that are to be
linted/formatted, and then group them based on the configuration that should be
applied to them.
We should work on include
and exclude
configurations first.
This will be applied to all tools using configuration and it makes little sense to resolving
compiler options/lint rules/formatter rules/etc.
Eg. if you omit test.include
we still need to get all the files ending with .test.ts
and _test.ts
.
Similarly if you omit fmt.exclude
we still want to exclude .git
and node_modules/
etc.
So far we landed on these options supported in workspace and package settings:
Option | Workspace | Package | Notes |
---|---|---|---|
compilerOptions | ✅ | ❌ | For now we only allow one set of compilerOptions per workspace this because it will require multiple changes to both deno_graph and the TSC integration to allow it. Also we’d have to determine what compilerOptions apply to remote dependencies. We can revisit this in the future. |
importMap | ✅ | ❌ | Exclusive with imports and scopes per config file. It is allowed to have importMap in the workspace config, and imports in the package config. |
imports | ✅ | ✅ | Exclusive with importMap per config file. |
scopes | ✅ | ❌ | Exclusive with importMap per config file. |
exclude | ✅ | ✅ | |
lint.include | ✅ | ✅ | |
lint.exclude | ✅ | ✅ | |
lint.files | ❌ | Deprecated | |
lint.rules.tags | ✅ | ✅ | Tags are merged by appending package to workspace list. Duplicates are ignored. |
lint.rules.include | |||
lint.rules.exclude | ✅ | ✅ | Rules are merged per package, with package taking priority over workspace (package include is stronger than workspace exclude). |
lint.report | ✅ | ❌ | Only one reporter can be active at a time, so allowing different reporters per workspace would not work in the case where you lint files spanning multiple packages. |
fmt.include | ✅ | ✅ | |
fmt.exclude | ✅ | ✅ | |
fmt.files | ❌ | Deprecated | |
fmt.useTabs | ✅ | ✅ | Package takes priority over workspace. |
fmt.indentWidth | ✅ | ✅ | Package takes priority over workspace. |
fmt.singleQuote | ✅ | ✅ | Package takes priority over workspace. |
fmt.proseWrap | ✅ | ✅ | Package takes priority over workspace. |
fmt.semiColons | ✅ | ✅ | Package takes priority over workspace. |
fmt.options.* | ❌ | Deprecated | |
nodeModulesDir | ✅ | ❌ | Resolution behaviour must be the same in the entire workspace. |
vendor | ✅ | ❌ | Resolution behaviour must be the same in the entire workspace. |
tasks | ✅ | ✅ | Package tasks take priority over workspace. cwd used is the cwd of the config file that the task was inside of. |
test.include | ✅ | ✅ | |
test.exclude | ✅ | ✅ | |
test.files | ❌ | Deprecated | |
publish.include | ✅ | ✅ | |
publish.exclude | ✅ | ✅ | |
bench.include | ✅ | ✅ | |
bench.exclude | ✅ | ✅ | |
bench.files | ❌ | Deprecated | |
lock | ✅ | ❌ | Only a single lock file may exist per resolver, and only resolver may exist per workspace, so conditional enablement of the lockfile per package does not make sense. |
unstable | ✅ | ❌ | For simplicities sake, we do not allow unstable flags, because a lot of the CLI assumes that unstable flags are immutable and global to the entire process. Also weird interaction with DENO_UNSTABLE_* flags. |
name | ❌ | ✅ | |
version | ❌ | ✅ | |
exports | ❌ | ✅ | |
workspace | ✅ | ❌ | Nested workspaces are not supported. |
Doesn't suit include-by-default semantics. If remote URLs aren't applicable to the exclude
/include
they should just pass through. I've had to bypass this in denoland/deno@701525a.
Line 91 in bb552f1
Make this true instead.
Because it has information about the start directory. This will make it less confusing in the LSP.
Example:
{
"workspaces": ["packages/*"] // or whatever it is
}
Not sure if this is handled, but should there be a way to opt-out of a top level exclude? Should this work?
{
"publish": {
"include": "./dist"
},
"exclude": ["./dist"]
}
Someone may want to exclude the dist folder from the lsp, fmt, lint, etc, but then include it for publishing because it contains a build of the package.
Originally posted by @dsherret in #34 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.