Giter VIP home page Giter VIP logo

deno_config's Issues

Compute various configurations based on the workspace settings

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.

Rename to deno_workspace

  1. Config is a subset of workspace.
  2. I'd like to make more APIs on config private to force people to access them through the workspace instead to reduce bugs.

Support publishing files excluded at top level

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.