mirror of
https://github.com/Silverquark/dance.git
synced 2024-08-16 14:20:52 +03:00
Misc dev improvements.
This commit is contained in:
parent
66fb04d607
commit
5d78d72e86
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,3 +1,4 @@
|
|||||||
|
/src/api/keybindings/built-in.ts linguist-generated
|
||||||
/src/commands/load-all.ts linguist-generated
|
/src/commands/load-all.ts linguist-generated
|
||||||
/src/commands/README.md linguist-generated
|
/src/commands/README.md linguist-generated
|
||||||
/package.json linguist-generated
|
/package.json linguist-generated
|
||||||
|
10
meta.ts
10
meta.ts
@ -572,11 +572,17 @@ export function unindent(by: number, string: string) {
|
|||||||
async function buildFile(fileName: string, builder: Builder) {
|
async function buildFile(fileName: string, builder: Builder) {
|
||||||
const relativeName = path.relative(__dirname, fileName),
|
const relativeName = path.relative(__dirname, fileName),
|
||||||
relativeNameWithoutBuild = relativeName.replace(/build\.ts$/, ""),
|
relativeNameWithoutBuild = relativeName.replace(/build\.ts$/, ""),
|
||||||
modulePath = `./${relativeNameWithoutBuild}build`,
|
modulePath = `./${relativeNameWithoutBuild}build`;
|
||||||
module: { build(builder: Builder): Promise<string> } = require(modulePath),
|
|
||||||
|
// Clear module cache if any.
|
||||||
|
delete require.cache[require.resolve(modulePath)];
|
||||||
|
|
||||||
|
const module: { build(builder: Builder): Promise<string> } = require(modulePath),
|
||||||
generatedContent = await module.build(builder);
|
generatedContent = await module.build(builder);
|
||||||
|
|
||||||
if (typeof generatedContent === "string") {
|
if (typeof generatedContent === "string") {
|
||||||
|
// Write result of `build` to the first file we find that has the same name
|
||||||
|
// as the build.ts file, but with any extension.
|
||||||
const prefix = path.basename(relativeNameWithoutBuild),
|
const prefix = path.basename(relativeNameWithoutBuild),
|
||||||
outputName = (await fs.readdir(path.dirname(fileName)))
|
outputName = (await fs.readdir(path.dirname(fileName)))
|
||||||
.find((path) => path.startsWith(prefix) && !path.endsWith(".build.ts"))!,
|
.find((path) => path.startsWith(prefix) && !path.endsWith(".build.ts"))!,
|
||||||
|
4
package.json
generated
4
package.json
generated
@ -1044,7 +1044,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "dance.modes.set.temporarily.insert",
|
"command": "dance.modes.set.temporarily.insert",
|
||||||
"title": "Temporart Insert mode",
|
"title": "Temporary Insert mode",
|
||||||
"category": "Dance"
|
"category": "Dance"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2770,7 +2770,7 @@
|
|||||||
{
|
{
|
||||||
"key": "Ctrl+V",
|
"key": "Ctrl+V",
|
||||||
"when": "editorTextFocus && dance.mode == 'normal'",
|
"when": "editorTextFocus && dance.mode == 'normal'",
|
||||||
"title": "Temporart Insert mode",
|
"title": "Temporary Insert mode",
|
||||||
"command": "dance.modes.set.temporarily.insert"
|
"command": "dance.modes.set.temporarily.insert"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user