Organize workspace: Frontend, Backend, and Tests in one repo

This commit is contained in:
2026-03-04 22:04:07 +00:00
parent a24e901b7f
commit c065cbf61e
5390 changed files with 844081 additions and 446 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
#!/bin/sh
unset NODE_OPTIONS
ELECTRON_RUN_AS_NODE=1 "/home/chloe/.vscode-server/cli/servers/Stable-072586267e68ece9a47aa43f8c108e0dcbf44622/server/node" "/home/chloe/.vscode-server/data/User/globalStorage/github.copilot-chat/copilotCli/copilotCLIShim.js" "$@"

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,219 @@
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#---------------------------------------------------------------------------------------------
# Windows GitHub Copilot CLI bootstrapper
#
# Responsibilities:
# 1. Locate the real Copilot CLI binary (avoid recursion if this file shadows it).
# 2. Offer to install if missing (npm -g @github/copilot).
# 3. Enforce minimum version (>= REQUIRED_VERSION) with interactive update.
# 4. Execute the real binary with original arguments and exit with its status.
#
# NOTE: This file intentionally keeps logic selfcontained (no external deps) so it can be dropped into PATH directly.
# Minimum required Copilot CLI version
$RequiredVersion = "0.0.394"
$PackageName = "@github/copilot"
function Invoke-NpmGlobalCommand {
param(
[Parameter(Mandatory = $true)][ValidateSet('install', 'update')][string]$Command,
[Parameter(Mandatory = $true)][string]$Package
)
$npmArgs = @($Command, '-g', $Package)
$npmCmd = Get-Command npm.cmd -ErrorAction SilentlyContinue
if ($npmCmd) {
& npm.cmd @npmArgs
} else {
& npm @npmArgs
}
}
function Find-RealCopilot {
# Find the real copilot binary, avoiding this script if it's in PATH
$CurrentScript = $MyInvocation.PSCommandPath
if (-not $CurrentScript) { $CurrentScript = $PSCommandPath }
$CopilotPath = (Get-Command copilot -ErrorAction SilentlyContinue).Source
# Check if the copilot command would point to this script
$CurrentScriptResolved = if ($CurrentScript) { (Resolve-Path $CurrentScript -ErrorAction SilentlyContinue).Path } else { $null }
$CopilotPathResolved = if ($CopilotPath) { (Resolve-Path $CopilotPath -ErrorAction SilentlyContinue).Path } else { $null }
if ($CurrentScript -eq $CopilotPath -or (Split-Path $CurrentScript -Parent) -eq (Split-Path $CopilotPath -Parent) -or ($CurrentScriptResolved -and $CopilotPathResolved -and $CurrentScriptResolved -eq $CopilotPathResolved)) {
# The copilot in PATH is this script, find the real one by temporarily removing this script's directory from PATH
$ScriptDir = Split-Path $CurrentScript -Parent
$OldPath = $env:PATH
# Use appropriate path delimiter based on OS
$PathDelimiter = if ($IsWindows -or $env:OS -eq "Windows_NT") { ';' } else { ':' }
$env:PATH = ($env:PATH -split $PathDelimiter | Where-Object { $_ -ne $ScriptDir }) -join $PathDelimiter
$RealCopilot = (Get-Command copilot -ErrorAction SilentlyContinue).Source
$env:PATH = $OldPath
if ($RealCopilot -and (Test-Path $RealCopilot)) {
return $RealCopilot
} else {
return $null
}
} else {
# The copilot in PATH is different from this script, use it
if ($CopilotPath -and (Test-Path $CopilotPath)) {
return $CopilotPath
} else {
return $null
}
}
}
function Test-VersionCompatibility {
param([string]$Version)
$cleanInstalled = $Version -replace '^v',''
$cleanRequired = $RequiredVersion -replace '^v',''
try {
$installedVer = [version]$cleanInstalled
$requiredVer = [version]$cleanRequired
} catch {
return $false
}
return ($installedVer -ge $requiredVer)
}
function Test-AndLaunchCopilot {
param([string[]]$Arguments)
# Check if real copilot command exists
$realCopilot = Find-RealCopilot
if (-not $realCopilot) {
Write-Host "Cannot find GitHub Copilot CLI (https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli)"
$answer = Read-Host "Install GitHub Copilot CLI? (y/N)"
if ($answer -eq "y" -or $answer -eq "Y") {
try {
Invoke-NpmGlobalCommand -Command 'install' -Package $PackageName
if ($LASTEXITCODE -eq 0) {
Test-AndLaunchCopilot $Arguments
return
} else {
Read-Host "Installation failed. Please check your npm configuration and try again (or run: npm install -g @github/copilot)."
return
}
} catch {
Read-Host "Installation failed. Please check your npm configuration and try again (or run: npm install -g @github/copilot)."
return
}
} else {
exit 0
}
}
# Check version compatibility
$realCopilot = Find-RealCopilot
if (-not $realCopilot) {
Write-Host "Error: Unable to find copilot binary."
$answer = Read-Host "Would you like to reinstall GitHub Copilot CLI? (y/N)"
if ($answer -eq "y" -or $answer -eq "Y") {
Write-Host "Reinstalling GitHub Copilot CLI..."
try {
Invoke-NpmGlobalCommand -Command 'install' -Package $PackageName
if ($LASTEXITCODE -eq 0) {
Test-AndLaunchCopilot $Arguments
return
} else {
Read-Host "Reinstallation failed. Please check your npm configuration and try again (or run: npm install -g @github/copilot)."
return
}
} catch {
Read-Host "Reinstallation failed. Please check your npm configuration and try again (or run: npm install -g @github/copilot)."
return
}
} else {
exit 0
}
}
try {
$versionOutput = & $realCopilot --version 2>$null
if ($LASTEXITCODE -ne 0) {
throw "Command failed"
}
} catch {
# Write-Host "Error: Unable to check copilot version."
$answer = Read-Host "Would you like to reinstall GitHub Copilot CLI? (y/N)"
if ($answer -eq "y" -or $answer -eq "Y") {
try {
Invoke-NpmGlobalCommand -Command 'install' -Package $PackageName
if ($LASTEXITCODE -eq 0) {
Test-AndLaunchCopilot $Arguments
return
} else {
Read-Host "Reinstallation failed. Please check your npm configuration and try again (or run: npm install -g @github/copilot)."
return
}
} catch {
Read-Host "Reinstallation failed. Please check your npm configuration and try again (or run: npm install -g @github/copilot)."
return
}
} else {
exit 0
}
}
# Extract version number from output (search through all lines)
$version = $null
if ($versionOutput) {
foreach ($line in ($versionOutput -split "`n")) {
$trimmedLine = $line.Trim()
if ($trimmedLine -match '[0-9]+\.[0-9]+\.[0-9]+') {
$version = $matches[0]
break
}
}
}
# Command succeeded - assume CLI is installed even if we can't parse the version
# Only check version compatibility if we have a valid version
if ($version -and -not (Test-VersionCompatibility $version)) {
Write-Host "GitHub Copilot CLI version $version is not compatible."
Write-Host "Version $RequiredVersion or later is required."
$answer = Read-Host "Update GitHub Copilot CLI? (y/N)"
if ($answer -eq "y" -or $answer -eq "Y") {
try {
Invoke-NpmGlobalCommand -Command 'update' -Package $PackageName
if ($LASTEXITCODE -eq 0) {
Test-AndLaunchCopilot $Arguments
return
} else {
Read-Host "Update failed. Please check your npm configuration and try again (or run: npm update -g @github/copilot)."
return
}
} catch {
Read-Host "Update failed. Please check your npm configuration and try again (or run: npm update -g @github/copilot)."
return
}
} else {
exit 0
}
}
# All checks passed, execute the real copilot binary
$realCopilot = Find-RealCopilot
if ($realCopilot -and (Test-Path $realCopilot)) {
& $realCopilot @Arguments
} else {
Write-Host "Error: Could not find the real GitHub Copilot CLI binary"
Read-Host "Please ensure it's properly installed with: npm install -g @github/copilot"
return
}
}
# Start the check and launch process
$finalArgs = $args
# Handle --clear argument
if ($args.Length -gt 0 -and $args[0] -eq '--clear') {
Clear-Host
$finalArgs = $args[1..($args.Length - 1)]
}
Test-AndLaunchCopilot $finalArgs

View File

@@ -0,0 +1,3 @@
#!/bin/sh
unset NODE_OPTIONS
ELECTRON_RUN_AS_NODE=1 "/home/chloe/.vscode-server/cli/servers/Stable-072586267e68ece9a47aa43f8c108e0dcbf44622/server/node" "/home/chloe/.vscode-server/data/User/globalStorage/github.copilot-chat/debugCommand/copilotDebugCommand.js" "vscode://github.copilot-chat" "code --openExternal " "$@"

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,108 @@
---
name: Plan
description: Researches and outlines multi-step plans
argument-hint: Outline the goal or problem to research
target: vscode
disable-model-invocation: true
tools: ['agent', 'search', 'read', 'execute/getTerminalOutput', 'execute/testFailure', 'web', 'github/issue_read', 'github.vscode-pull-request-github/issue_fetch', 'github.vscode-pull-request-github/activePullRequest', 'vscode/askQuestions']
agents: []
handoffs:
- label: Start Implementation
agent: agent
prompt: 'Start implementation'
send: true
- label: Open in Editor
agent: agent
prompt: '#createFile the plan as is into an untitled file (`untitled:plan-${camelCaseName}.prompt.md` without frontmatter) for further refinement.'
send: true
showContinueOn: false
---
You are a PLANNING AGENT, pairing with the user to create a detailed, actionable plan.
Your job: research the codebase → clarify with the user → produce a comprehensive plan. This iterative approach catches edge cases and non-obvious requirements BEFORE implementation begins.
Your SOLE responsibility is planning. NEVER start implementation.
<rules>
- STOP if you consider running file editing tools — plans are for others to execute
- Use #tool:vscode/askQuestions freely to clarify requirements — don't make large assumptions
- Present a well-researched plan with loose ends tied BEFORE implementation
</rules>
<workflow>
Cycle through these phases based on user input. This is iterative, not linear.
## 1. Discovery
Run #tool:agent/runSubagent to gather context and discover potential blockers or ambiguities.
MANDATORY: Instruct the subagent to work autonomously following <research_instructions>.
<research_instructions>
- Research the user's task comprehensively using read-only tools.
- Start with high-level code searches before reading specific files.
- Pay special attention to instructions and skills made available by the developers to understand best practices and intended usage.
- Identify missing information, conflicting requirements, or technical unknowns.
- DO NOT draft a full plan yet — focus on discovery and feasibility.
</research_instructions>
After the subagent returns, analyze the results.
## 2. Alignment
If research reveals major ambiguities or if you need to validate assumptions:
- Use #tool:vscode/askQuestions to clarify intent with the user.
- Surface discovered technical constraints or alternative approaches.
- If answers significantly change the scope, loop back to **Discovery**.
## 3. Design
Once context is clear, draft a comprehensive implementation plan per <plan_style_guide>.
The plan should reflect:
- Critical file paths discovered during research.
- Code patterns and conventions found.
- A step-by-step implementation approach.
Present the plan as a **DRAFT** for review.
## 4. Refinement
On user input after showing a draft:
- Changes requested → revise and present updated plan.
- Questions asked → clarify, or use #tool:vscode/askQuestions for follow-ups.
- Alternatives wanted → loop back to **Discovery** with new subagent.
- Approval given → acknowledge, the user can now use handoff buttons.
The final plan should:
- Be scannable yet detailed enough to execute.
- Include critical file paths and symbol references.
- Reference decisions from the discussion.
- Leave no ambiguity.
Keep iterating until explicit approval or handoff.
</workflow>
<plan_style_guide>
```markdown
## Plan: {Title (2-10 words)}
{TL;DR — what, how, why. Reference key decisions. (30-200 words, depending on complexity)}
**Steps**
1. {Action with [file](path) links and `symbol` refs}
2. {Next step}
3. {…}
**Verification**
{How to test: commands, tests, manual checks}
**Decisions** (if applicable)
- {Decision: chose X over Y}
```
Rules:
- NO code blocks — describe changes, link to files/symbols
- NO questions at the end — ask during workflow via #tool:vscode/askQuestions
- Keep scannable
</plan_style_guide>

View File

@@ -0,0 +1,134 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/semantic-release.json",
"definitions": {
"branch-object": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"channel": {
"type": "string"
},
"range": {
"type": "string"
},
"prerelease": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
}
}
}
},
"properties": {
"extends": {
"description": "List of modules or file paths containing a shareable configuration. If multiple shareable configurations are set, they will be imported in the order defined with each configuration option taking precedence over the options defined in a previous shareable configuration",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"branches": {
"description": "The branches on which releases should happen.",
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/branch-object"
},
{
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/branch-object"
}
]
}
}
],
"default": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
]
},
"repositoryUrl": {
"type": "string",
"description": "The git repository URL"
},
"tagFormat": {
"type": "string",
"description": "The Git tag format used by semantic-release to identify releases. The tag name is generated with Lodash template and will be compiled with the version variable.",
"default": "v${version}"
},
"plugins": {
"type": "array",
"description": "Define the list of plugins to use. Plugins will run in series, in the order defined",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object",
"required": ["path"],
"properties": {
"path": { "type": "string" }
},
"additionalProperties": true
}
]
},
"default": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
},
"dryRun": {
"type": "boolean",
"description": "The objective of the dry-run mode is to get a preview of the pending release. Dry-run mode skips the following steps: prepare, publish, success and fail. In addition to this it prints the next version and release notes to the console"
},
"ci": {
"type": "boolean",
"description": "Set to false to skip Continuous Integration environment verifications. This allows for making releases from a local machine",
"default": true
}
},
"title": "semantic-release Schema",
"type": "object"
}

View File

@@ -0,0 +1,433 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/prettierrc.json",
"definitions": {
"optionsDefinition": {
"type": "object",
"properties": {
"arrowParens": {
"description": "Include parentheses around a sole arrow function parameter.",
"default": "always",
"oneOf": [
{
"enum": ["always"],
"description": "Always include parens. Example: `(x) => x`"
},
{
"enum": ["avoid"],
"description": "Omit parens when possible. Example: `x => x`"
}
]
},
"bracketSameLine": {
"description": "Put > of opening tags on the last line instead of on a new line.",
"default": false,
"type": "boolean"
},
"bracketSpacing": {
"description": "Print spaces between brackets.",
"default": true,
"type": "boolean"
},
"checkIgnorePragma": {
"description": "Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",
"default": false,
"type": "boolean"
},
"cursorOffset": {
"description": "Print (to stderr) where a cursor at the given position would move to after formatting.",
"default": -1,
"type": "integer"
},
"embeddedLanguageFormatting": {
"description": "Control how Prettier formats quoted code embedded in the file.",
"default": "auto",
"oneOf": [
{
"enum": ["auto"],
"description": "Format embedded code if Prettier can automatically identify it."
},
{
"enum": ["off"],
"description": "Never automatically format embedded code."
}
]
},
"endOfLine": {
"description": "Which end of line characters to apply.",
"default": "lf",
"oneOf": [
{
"enum": ["lf"],
"description": "Line Feed only (\\n), common on Linux and macOS as well as inside git repos"
},
{
"enum": ["crlf"],
"description": "Carriage Return + Line Feed characters (\\r\\n), common on Windows"
},
{
"enum": ["cr"],
"description": "Carriage Return character only (\\r), used very rarely"
},
{
"enum": ["auto"],
"description": "Maintain existing\n(mixed values within one file are normalised by looking at what's used after the first line)"
}
]
},
"experimentalOperatorPosition": {
"description": "Where to print operators when binary expressions wrap lines.",
"default": "end",
"oneOf": [
{
"enum": ["start"],
"description": "Print operators at the start of new lines."
},
{
"enum": ["end"],
"description": "Print operators at the end of previous lines."
}
]
},
"experimentalTernaries": {
"description": "Use curious ternaries, with the question mark after the condition.",
"default": false,
"type": "boolean"
},
"filepath": {
"description": "Specify the input filepath. This will be used to do parser inference.",
"type": "string"
},
"htmlWhitespaceSensitivity": {
"description": "How to handle whitespaces in HTML.",
"default": "css",
"oneOf": [
{
"enum": ["css"],
"description": "Respect the default value of CSS display property."
},
{
"enum": ["strict"],
"description": "Whitespaces are considered sensitive."
},
{
"enum": ["ignore"],
"description": "Whitespaces are considered insensitive."
}
]
},
"insertPragma": {
"description": "Insert @format pragma into file's first docblock comment.",
"default": false,
"type": "boolean"
},
"jsxSingleQuote": {
"description": "Use single quotes in JSX.",
"default": false,
"type": "boolean"
},
"objectWrap": {
"description": "How to wrap object literals.",
"default": "preserve",
"oneOf": [
{
"enum": ["preserve"],
"description": "Keep as multi-line, if there is a newline between the opening brace and first property."
},
{
"enum": ["collapse"],
"description": "Fit to a single line when possible."
}
]
},
"parser": {
"description": "Which parser to use.",
"anyOf": [
{
"enum": ["flow"],
"description": "Flow"
},
{
"enum": ["babel"],
"description": "JavaScript"
},
{
"enum": ["babel-flow"],
"description": "Flow"
},
{
"enum": ["babel-ts"],
"description": "TypeScript"
},
{
"enum": ["typescript"],
"description": "TypeScript"
},
{
"enum": ["acorn"],
"description": "JavaScript"
},
{
"enum": ["espree"],
"description": "JavaScript"
},
{
"enum": ["meriyah"],
"description": "JavaScript"
},
{
"enum": ["css"],
"description": "CSS"
},
{
"enum": ["less"],
"description": "Less"
},
{
"enum": ["scss"],
"description": "SCSS"
},
{
"enum": ["json"],
"description": "JSON"
},
{
"enum": ["json5"],
"description": "JSON5"
},
{
"enum": ["jsonc"],
"description": "JSON with Comments"
},
{
"enum": ["json-stringify"],
"description": "JSON.stringify"
},
{
"enum": ["graphql"],
"description": "GraphQL"
},
{
"enum": ["markdown"],
"description": "Markdown"
},
{
"enum": ["mdx"],
"description": "MDX"
},
{
"enum": ["vue"],
"description": "Vue"
},
{
"enum": ["yaml"],
"description": "YAML"
},
{
"enum": ["glimmer"],
"description": "Ember / Handlebars"
},
{
"enum": ["html"],
"description": "HTML"
},
{
"enum": ["angular"],
"description": "Angular"
},
{
"enum": ["lwc"],
"description": "Lightning Web Components"
},
{
"enum": ["mjml"],
"description": "MJML"
},
{
"type": "string",
"description": "Custom parser"
}
]
},
"plugins": {
"description": "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"printWidth": {
"description": "The line length where Prettier will try wrap.",
"default": 80,
"type": "integer"
},
"proseWrap": {
"description": "How to wrap prose.",
"default": "preserve",
"oneOf": [
{
"enum": ["always"],
"description": "Wrap prose if it exceeds the print width."
},
{
"enum": ["never"],
"description": "Do not wrap prose."
},
{
"enum": ["preserve"],
"description": "Wrap prose as-is."
}
]
},
"quoteProps": {
"description": "Change when properties in objects are quoted.",
"default": "as-needed",
"oneOf": [
{
"enum": ["as-needed"],
"description": "Only add quotes around object properties where required."
},
{
"enum": ["consistent"],
"description": "If at least one property in an object requires quotes, quote all properties."
},
{
"enum": ["preserve"],
"description": "Respect the input use of quotes in object properties."
}
]
},
"rangeEnd": {
"description": "Format code ending at a given character offset (exclusive).\nThe range will extend forwards to the end of the selected statement.",
"default": null,
"type": "integer"
},
"rangeStart": {
"description": "Format code starting at a given character offset.\nThe range will extend backwards to the start of the first line containing the selected statement.",
"default": 0,
"type": "integer"
},
"requirePragma": {
"description": "Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",
"default": false,
"type": "boolean"
},
"semi": {
"description": "Print semicolons.",
"default": true,
"type": "boolean"
},
"singleAttributePerLine": {
"description": "Enforce single attribute per line in HTML, Vue and JSX.",
"default": false,
"type": "boolean"
},
"singleQuote": {
"description": "Use single quotes instead of double quotes.",
"default": false,
"type": "boolean"
},
"tabWidth": {
"description": "Number of spaces per indentation level.",
"default": 2,
"type": "integer"
},
"trailingComma": {
"description": "Print trailing commas wherever possible when multi-line.",
"default": "all",
"oneOf": [
{
"enum": ["all"],
"description": "Trailing commas wherever possible (including function arguments)."
},
{
"enum": ["es5"],
"description": "Trailing commas where valid in ES5 (objects, arrays, etc.)"
},
{
"enum": ["none"],
"description": "No trailing commas."
}
]
},
"useTabs": {
"description": "Indent with tabs instead of spaces.",
"default": false,
"type": "boolean"
},
"vueIndentScriptAndStyle": {
"description": "Indent script and style tags in Vue files.",
"default": false,
"type": "boolean"
}
}
},
"overridesDefinition": {
"type": "object",
"properties": {
"overrides": {
"type": "array",
"description": "Provide a list of patterns to override prettier configuration.",
"items": {
"type": "object",
"required": ["files"],
"properties": {
"files": {
"description": "Include these files in this override.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"excludeFiles": {
"description": "Exclude these files from this override.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"options": {
"$ref": "#/definitions/optionsDefinition",
"type": "object",
"description": "The options to apply for this override."
}
},
"additionalProperties": false
}
}
}
}
},
"oneOf": [
{
"type": "object",
"allOf": [
{
"$ref": "#/definitions/optionsDefinition"
},
{
"$ref": "#/definitions/overridesDefinition"
}
]
},
{
"type": "string"
}
],
"title": "Schema for .prettierrc"
}

View File

@@ -0,0 +1,405 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/jscpd.json",
"additionalProperties": false,
"definitions": {
"colorPreset": {
"enum": [
"green",
"blue",
"red",
"yellow",
"orange",
"purple",
"pink",
"grey",
"gray",
"cyan",
"black"
]
},
"colorHex": {
"type": "string",
"pattern": "([0-9a-fA-F]{3}){1,2}"
},
"color": {
"oneOf": [
{
"$ref": "#/definitions/colorPreset"
},
{
"$ref": "#/definitions/colorHex"
}
]
},
"format": {
"enum": [
"abap",
"actionscript",
"ada",
"apacheconf",
"apl",
"applescript",
"arduino",
"arff",
"asciidoc",
"asm6502",
"aspnet",
"autohotkey",
"autoit",
"bash",
"basic",
"batch",
"bison",
"brainfuck",
"bro",
"c",
"c-header",
"clike",
"clojure",
"coffeescript",
"comments",
"cpp",
"cpp-header",
"crystal",
"csharp",
"csp",
"css-extras",
"css",
"d",
"dart",
"diff",
"django",
"docker",
"eiffel",
"elixir",
"elm",
"erb",
"erlang",
"flow",
"fortran",
"fsharp",
"gedcom",
"gherkin",
"git",
"glsl",
"go",
"graphql",
"groovy",
"haml",
"handlebars",
"haskell",
"haxe",
"hpkp",
"hsts",
"http",
"ichigojam",
"icon",
"inform7",
"ini",
"io",
"j",
"java",
"javascript",
"jolie",
"json",
"jsx",
"julia",
"keymap",
"kotlin",
"latex",
"less",
"liquid",
"lisp",
"livescript",
"lolcode",
"lua",
"makefile",
"markdown",
"markup",
"matlab",
"mel",
"mizar",
"monkey",
"n4js",
"nasm",
"nginx",
"nim",
"nix",
"nsis",
"objectivec",
"ocaml",
"opencl",
"oz",
"parigp",
"pascal",
"perl",
"php",
"plsql",
"powershell",
"processing",
"prolog",
"properties",
"protobuf",
"pug",
"puppet",
"pure",
"python",
"q",
"qore",
"r",
"reason",
"renpy",
"rest",
"rip",
"roboconf",
"ruby",
"rust",
"sas",
"sass",
"scala",
"scheme",
"scss",
"smalltalk",
"smarty",
"soy",
"sql",
"stylus",
"swift",
"tap",
"tcl",
"textile",
"tsx",
"tt2",
"twig",
"typescript",
"vbnet",
"velocity",
"verilog",
"vhdl",
"vim",
"visual-basic",
"wasm",
"url",
"wiki",
"xeora",
"xojo",
"xquery",
"yaml"
]
}
},
"properties": {
"minLines": {
"type": "integer",
"default": 5,
"description": "minimum size of code block in lines to check for duplication"
},
"maxLines": {
"type": "integer",
"default": 1000,
"description": "maximum size of source file in lines to check for duplication"
},
"maxSize": {
"anyOf": [
{
"type": "string",
"pattern": "^\\+?[0-9]+(\\.[0-9]+)? *[kKmMgGtTpP][bB]$"
},
{
"type": "integer"
}
],
"default": "100kb",
"description": "maximum size of source file in bytes to check for duplication (e.g.,: 1kb, 1mb, 120kb)"
},
"minTokens": {
"type": "integer",
"default": 50,
"description": "minimum size of code block in tokens to check for duplication"
},
"threshold": {
"type": "number",
"description": "maximum allowed duplicate lines expressed as a percentage; exit with error and exit code 1 when threshold exceeded"
},
"formatsExts": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
},
"default": {},
"description": "custom mapping from formats to file extensions (default: https://github.com/kucherenko/jscpd/blob/master/packages/tokenizer/src/formats.ts); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md"
},
"output": {
"type": "string",
"default": "./report",
"description": "path to directory for non-console reports"
},
"path": {
"type": "array",
"items": {
"type": "string"
},
"description": "paths that should be included in duplicate detection (default: [process.cwd()])"
},
"pattern": {
"type": "string",
"default": "**/*",
"description": "glob pattern for files that should be included in duplicate detection (e.g., **/*.txt); only used to filter directories configured via path option"
},
"ignorePattern": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "ignore code blocks matching these regular expressions"
},
"mode": {
"enum": ["mild", "strict", "weak"],
"default": "mild",
"description": "mode of detection quality; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode"
},
"ignore": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "glob pattern for files that should be excluded from duplicate detection"
},
"format": {
"type": "array",
"items": {
"$ref": "#/definitions/format"
},
"description": "list of formats for which to detect duplication (default: all); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md"
},
"store": {
"enum": ["leveldb", "redis"],
"description": "store used to collect information about code (default: in-memory store); install @jscpd/leveldb-store and use leveldb for big repositories"
},
"reporters": {
"type": "array",
"items": {
"enum": [
"xml",
"json",
"csv",
"markdown",
"consoleFull",
"html",
"console",
"silent",
"threshold",
"xcode"
]
},
"default": ["console"],
"description": "a list of reporters to use to output information about duplication; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#reporters"
},
"blame": {
"type": "boolean",
"default": false,
"description": "get information about authors and dates of duplicated blocks from Git"
},
"silent": {
"type": "boolean",
"default": false,
"description": "do not write duplicate detection progress and result to console"
},
"verbose": {
"type": "boolean",
"default": false,
"description": "show full information during duplicate detection"
},
"absolute": {
"type": "boolean",
"default": false,
"description": "use absolute paths in reports"
},
"noSymlinks": {
"type": "boolean",
"default": false,
"description": "do not follow symlinks"
},
"skipLocal": {
"type": "boolean",
"default": false,
"description": "skip duplicates within folders; just detect cross-folder duplicates"
},
"ignoreCase": {
"type": "boolean",
"default": false,
"description": "ignore case of symbols in code (experimental)"
},
"gitignore": {
"type": "boolean",
"default": false,
"description": "ignore all files from .gitignore file"
},
"reportersOptions": {
"type": "object",
"default": {},
"additionalProperties": false,
"properties": {
"badge": {
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"type": "string",
"description": "output path for duplication level badge (default: path.join(output, 'jscpd-badge.svg'))"
},
"label": {
"type": "string",
"default": "Copy/Paste",
"description": "badge subject text (URL-encoding needed for spaces or special characters)"
},
"labelColor": {
"$ref": "#/definitions/color",
"default": "555",
"description": "badge label color (name or RGB code without #); see https://github.com/badgen/badgen/blob/master/src/color-presets.ts"
},
"status": {
"type": "string",
"description": "badge value text (URL-encoding needed for spaces or special characters, default: duplication %)"
},
"color": {
"$ref": "#/definitions/color",
"description": "badge color (name or RGB code without #, default: green if beneath threshold, red if above threshold, grey if threshold not set); see https://github.com/badgen/badgen/blob/master/src/color-presets.ts"
},
"style": {
"enum": ["flat", "classic"],
"default": "classic",
"description": "badge look: flat or classic"
},
"icon": {
"type": "string",
"description": "URL for icon to display in front of badge subject text (e.g., data:image/svg+xml;base64,...)"
},
"iconWidth": {
"type": "number",
"default": 13,
"description": "SVG width of icon to display in front of badge subject text; set this if icon is not square"
},
"scale": {
"type": "number",
"default": 1,
"description": "size of badge relative to default of 1"
}
}
}
}
},
"exitCode": {
"type": "integer",
"default": 0,
"description": "exit code to use when at least one duplicate code block is detected but threshold is not exceeded"
}
},
"type": "object"
}

View File

@@ -0,0 +1,167 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/ava.json",
"additionalProperties": false,
"definitions": {
"path": {
"type": "string",
"minLength": 1
},
"array-of-strings": {
"type": "array",
"items": {
"type": "string"
}
},
"array-of-paths": {
"type": "array",
"items": {
"$ref": "#/definitions/path"
}
}
},
"description": "Configuration Schema for the JavaScript test runner AVA",
"properties": {
"files": {
"$ref": "#/definitions/array-of-paths",
"description": "An array of glob patterns to select test files. Files with an underscore prefix are ignored. By default only selects files with `cjs`, `mjs` & `js` extensions, even if the pattern matches other files. Specify `extensions` to allow other file extensions"
},
"ignoredByWatcher": {
"$ref": "#/definitions/array-of-paths",
"description": "An array of glob patterns to match files that, even if changed, are ignored by the watcher"
},
"match": {
"$ref": "#/definitions/array-of-paths",
"description": "Not typically useful in the `package.json` configuration, but equivalent to specifying `--match` on the CLI"
},
"cache": {
"type": "boolean",
"default": true,
"description": "Defaults to `true` to cache compiled files under `node_modules/.cache/ava.` If `false`, files are cached in a temporary directory instead"
},
"concurrency": {
"type": "number",
"description": "Max number of test files running at the same time (default: CPU cores)"
},
"workerThreads": {
"type": "boolean",
"default": true,
"description": "Use worker threads to run tests (enabled by default). If `false`, tests will run in child processes"
},
"failFast": {
"type": "boolean",
"default": false,
"description": "Stop running further tests once a test fails"
},
"failWithoutAssertions": {
"type": "boolean",
"default": true,
"description": "If `false`, does not fail a test if it doesn't run assertions"
},
"environmentVariables": {
"title": "environment variables",
"type": "object",
"description": "Specifies environment variables to be made available to the tests. The environment variables defined here override the ones from `process.env`",
"additionalProperties": {
"type": "string"
}
},
"serial": {
"type": "boolean",
"default": false,
"description": "if `true`, prevents parallel execution of tests within a file"
},
"tap": {
"type": "boolean",
"default": false,
"description": "If `true`, enables the TAP reporter"
},
"verbose": {
"type": "boolean",
"default": false,
"description": "If `true`, enables verbose output (though currently non-verbose output is not supported)"
},
"snapshotDir": {
"$ref": "#/definitions/path",
"description": "Specifies a fixed location for storing snapshot files. Use this if your snapshots are ending up in the wrong location"
},
"extensions": {
"anyOf": [
{
"$ref": "#/definitions/array-of-strings"
},
{
"title": "extensions",
"type": "object",
"patternProperties": {
"^(c|m)?js$": {
"enum": [true]
}
},
"additionalProperties": {
"enum": ["commonjs", "module"]
}
}
],
"default": ["cjs", "mjs", "js"],
"description": "Extensions of test files. Setting this overrides the default `[\"cjs\", \"mjs\", \"js\"]` value, so make sure to include those extensions in the list. Experimentally you can configure how files are loaded"
},
"require": {
"$ref": "#/definitions/array-of-paths",
"description": "Extra modules to require before tests are run. Modules are required in the worker processes"
},
"timeout": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "string",
"pattern": "^(\\d+)(s|m)$"
}
],
"default": "10s",
"description": "Timeouts in AVA behave differently than in other test frameworks. AVA resets a timer after each test, forcing tests to quit if no new test results were received within the specified timeout. This can be used to handle stalled tests. See our timeout documentation for more options"
},
"nodeArguments": {
"$ref": "#/definitions/array-of-strings",
"description": "Configure Node.js arguments used to launch worker processes"
},
"utilizeParallelBuilds": {
"type": "boolean",
"default": true,
"description": "If `false`, disable parallel builds (default: `true`)"
},
"typescript": {
"title": "configuration",
"type": "object",
"description": "Configures @ava/typescript for projects that precompile TypeScript. Alternatively, you can use `ts-node` to do live testing without transpiling, in which case you shouldn't use the `typescript` property",
"properties": {
"extensions": {
"$ref": "#/definitions/array-of-paths",
"default": ["ts"],
"description": "You can configure AVA to recognize additional file extensions as TypeScript (e.g., `[\"ts\", \"tsx\"]` to add partial JSX support). Note that the preserve mode for JSX is not (yet) supported. See also AVA's `extensions` object"
},
"rewritePaths": {
"title": "paths",
"type": "object",
"description": "AVA searches your entire project for `*.js`, `*.cjs`, `*.mjs` and `*.ts` files (or other extensions you've configured). It will ignore such files found in the `rewritePaths` targets (e.g. `build/`). If you use more specific paths, for instance `build/main/`, you may need to change AVA's `files` configuration to ignore other directories. Paths are relative to your project directory",
"patternProperties": {
"/$": {
"type": "string",
"pattern": "/$"
}
}
},
"compile": {
"enum": [false, "tsc"],
"default": false,
"description": "If `false`, AVA will assume you have already compiled your project. If set to `'tsc'`, AVA will run the TypeScript compiler before running your tests. This can be inefficient when using AVA in watch mode"
}
}
}
},
"title": "AVA Config Schema",
"type": "object"
}