-
Notifications
You must be signed in to change notification settings - Fork 770
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[quick-edit] Typescript support through JSDoc (#3043)
* Typescript support through JSDoc * Add vscode to gitignore
- Loading branch information
Showing
19 changed files
with
974 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,4 +196,4 @@ packages/quick-edit/web | |
|
||
# VSCode Theme | ||
*.vsix | ||
./vendor/vscode | ||
vendor/vscode |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { readFile } from "fs/promises"; | ||
import * as esbuild from "esbuild"; | ||
|
||
type BuildFlags = { | ||
watch?: boolean; | ||
}; | ||
|
||
async function buildMain(flags: BuildFlags = {}) { | ||
const options: esbuild.BuildOptions = { | ||
entryPoints: ["./src/extension.ts"], | ||
bundle: true, | ||
outfile: "./dist/extension.js", | ||
format: "cjs", | ||
external: ["vscode"], | ||
logLevel: "info", | ||
plugins: [ | ||
{ | ||
name: "workers-types", | ||
setup(build) { | ||
build.onResolve({ filter: /^raw:.*/ }, async (args) => { | ||
const result = await build.resolve(args.path.slice(4), { | ||
kind: "import-statement", | ||
resolveDir: args.resolveDir, | ||
}); | ||
return { | ||
path: result.path, | ||
namespace: "raw-file", | ||
}; | ||
}); | ||
|
||
build.onLoad( | ||
{ filter: /.*/, namespace: "raw-file" }, | ||
async (args) => { | ||
const contents = await readFile(args.path); | ||
return { contents, loader: "text" }; | ||
} | ||
); | ||
}, | ||
}, | ||
], | ||
}; | ||
if (flags.watch) { | ||
const ctx = await esbuild.context(options); | ||
await ctx.watch(); | ||
} else { | ||
await esbuild.build(options); | ||
} | ||
} | ||
|
||
async function run() { | ||
await buildMain(); | ||
if (process.argv.includes("--watch")) { | ||
console.log("Built. Watching for changes..."); | ||
await Promise.all([buildMain({ watch: true })]); | ||
} | ||
} | ||
|
||
run().catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../../../tsconfig.json", | ||
"compilerOptions": { | ||
"module": "CommonJS", | ||
"types": ["node"] | ||
}, | ||
"include": ["bundle.ts"], | ||
"exclude": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module "raw:*" { | ||
const value: string; | ||
export default value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
"sourceMap": true, | ||
"rootDir": "src", | ||
"strict": true | ||
} | ||
}, | ||
"exclude": ["scripts"] | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/quick-edit/patches/0001-Add-Custom-workbench-for-Cloudflare.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/quick-edit/patches/0002-Remove-Themes-from-Setting-SubMenu.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/quick-edit/patches/0004-Remove-Profile-from-Setting-SubMenu.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/quick-edit/patches/0005-Remove-Account-Extension.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/quick-edit/patches/0006-Remove-Debug-Icon-other-default-views.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/quick-edit/patches/0008-Remove-Custom-Menu-hamburger.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.