Skip to content

Commit

Permalink
Rewrite Dance for v0.5.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
71 committed May 4, 2021
1 parent c6ea85d commit 2d38438
Show file tree
Hide file tree
Showing 177 changed files with 37,790 additions and 16,366 deletions.
21 changes: 15 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ module.exports = {
"max-len": "off",
},
},
{
files: ["test/suite/commands/*.ts"],
rules: {
"no-useless-escape": "off",
},
}
],
rules: {
"indent": ["error", 2, {
Expand All @@ -25,6 +31,7 @@ module.exports = {
"VariableDeclarator": "first",
"flatTernaryExpressions": true,
"offsetTernaryExpressions": true,
"ignoredNodes": ["TemplateLiteral *"],
}],
"curly": ["error", "all"],
"dot-location": ["error", "property"],
Expand All @@ -41,7 +48,7 @@ module.exports = {
{
code: 100,
comments: 80,
ignorePattern: "^ *(\\*|//) ([sS]ee )?http\\S+\\)?.?$|^ *// =+( [^=]+ =+)?$",
ignorePattern: "^ *(\\*|//) ([sS]ee )?http\\S+\\)?.?$|^ *// =+( [^=]+ =+)?$|\|$",
},
],
"multiline-ternary": ["error", "always-multiline"],
Expand All @@ -50,21 +57,19 @@ module.exports = {
"no-unexpected-multiline": "error",
"no-unneeded-ternary": "error",
"object-curly-spacing": ["error", "always"],
"operator-linebreak": ["error", "before"],
"operator-linebreak": ["error", "before", { overrides: { "=": "after" } }],
"object-shorthand": "error",
"quotes": ["error", "double", { avoidEscape: true, allowTemplateLiterals: true }],
"semi": ["error", "always"],
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
memberSyntaxSortOrder: ["none", "all", "single", "multiple"],
},
],
"space-before-function-paren": [
"error",
{ anonymous: "always", named: "never", asyncArrow: "always" },
],
"space-before-function-paren": "off",
"space-before-blocks": "error",
"space-infix-ops": "error",
"unicode-bom": "error",
Expand All @@ -73,5 +78,9 @@ module.exports = {
"no-case-declarations": "off",
"no-cond-assign": "off",
"@typescript-eslint/explicit-member-accessibility": ["error"],
"@typescript-eslint/space-before-function-paren": [
"error",
{ anonymous: "always", named: "never", asyncArrow: "always" },
],
},
};
11 changes: 11 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ jobs:

- name: Check formatting and lints
run: yarn run check

- name: Ensure auto-generated files are up-to-date
run: yarn run ts-node ./meta.ts --ensure-up-to-date --check

- name: Check tests
run: yarn run test

- uses: butlerlogic/action-autotag@ade8d2e19bfcd1e6a91272e2849b4bf4c37a67f1
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
tag_prefix: v
44 changes: 37 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,55 @@
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"name": "Launch extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Extension Tests",
"name": "Run all tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite"
"--extensionTestsPath=${workspaceFolder}/out/test/suite",
],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: watch"
}
]
},
{
"name": "Run tests in this file",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite",
],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"env": {
"CURRENT_FILE": "${relativeFile}",
},
},
{
"name": "Run test on this line",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite",
],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"env": {
"CURRENT_FILE": "${relativeFile}",
"CURRENT_LINE": "${lineNumber}",
},
},
],
}
31 changes: 25 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
{
"files.associations": {
"test/suite/commands/*": "text"
},
"search.exclude": {
"out": true
},
"[typescript]": {
"editor.rulers": [80, 100]
"editor.rulers": [80, 100],
"typescript.tsdk": "node_modules/typescript/lib",

// Disable italic on doc comments since they contain a lot of Markdown:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment.block.documentation",
"settings": {
"fontStyle": "",
},
},
],
},

"dance.menus": {
"dancedev": {
"items": {
"b": {
"text": "toggle character selection behavior",
"command": "dance.dev.setSelectionBehavior",
"args": [{ "mode": "normal" }],
},
},
},
},
"typescript.tsdk": "node_modules/typescript/lib"
}
25 changes: 21 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"version": "2.0.0",
"tasks": [
// These tasks run automatically when loading Dance in VS Code. Make sure to
// enable them (Command palette > Manage automatic tasks in folder > Allow).
{
"type": "npm",
"script": "watch",
"script": "compile:watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
Expand All @@ -12,7 +14,22 @@
"group": {
"kind": "build",
"isDefault": true
}
}
]
},
"runOptions": {
"runOn": "folderOpen",
},
},
{
"type": "npm",
"script": "generate:watch",
"problemMatcher": [],
"isBackground": true,
"presentation": {
"reveal": "never"
},
"runOptions": {
"runOn": "folderOpen",
},
},
],
}
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ test/**
**/*.map
**/*.ts
**/*.lock
out/src/build.js
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2020 Grégoire Geis
Copyright 2020-2021 Grégoire Geis

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Expand Down
Loading

0 comments on commit 2d38438

Please sign in to comment.