Skip to content

Commit 268e801

Browse files
1 parent 1f19d5c commit 268e801

File tree

8 files changed

+97
-103
lines changed

8 files changed

+97
-103
lines changed

generators/app/dependencyVersions/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"author": {
33
"email": "Source/[email protected]",
44
"name": "Source 🖋️ Open 👐🏻",
5-
"url": "HTTPS://Editor.Land"
5+
"url": "https://Editor.Land"
66
},
77
"bugs": {
8-
"url": "HTTPS://GitHub.Com/CodeEditorLand/LandGeneratorCode/issues"
8+
"url": "https://GitHub.Com/CodeEditorLand/LandGeneratorCode/issues"
99
},
1010
"dependencies": {
1111
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
@@ -26,7 +26,7 @@
2626
"devDependencies": {
2727
"@playform/build": "0.2.4"
2828
},
29-
"homepage": "HTTPS://GitHub.Com/CodeEditorLand/LandGeneratorCode#readme",
29+
"homepage": "https://GitHub.Com/CodeEditorLand/LandGeneratorCode#readme",
3030
"keywords": [
3131
"codeeditorland",
3232
"land",
@@ -40,7 +40,7 @@
4040
},
4141
"repository": {
4242
"type": "git",
43-
"url": "git+HTTPS://github.com/CodeEditorLand/LandGeneratorCode.git"
43+
"url": "git+https://github.com/CodeEditorLand/LandGeneratorCode.git"
4444
},
4545
"scripts": {
4646
"prepublishOnly": "Build 'Source/**/*.ts'"

generators/app/templates/ext-command-ts/Source/extension.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
// The module 'vscode' contains the VS Code extensibility API
22
// Import the module and reference it with the alias vscode in your code below
3-
import * as vscode from 'vscode';
3+
import * as vscode from "vscode";
44

55
// This method is called when your extension is activated
66
// Your extension is activated the very first time the command is executed
77
export function activate(context: vscode.ExtensionContext) {
8-
98
// Use the console to output diagnostic information (console.log) and errors (console.error)
109
// This line of code will only be executed once when your extension is activated
1110
console.log('Congratulations, your extension "<%= name %>" is now active!');
1211

1312
// The command has been defined in the package.json file
1413
// Now provide the implementation of the command with registerCommand
1514
// The commandId parameter must match the command field in package.json
16-
const disposable = vscode.commands.registerCommand('<%= name %>.helloWorld', () => {
17-
// The code you place here will be executed every time your command is executed
18-
// Display a message box to the user
19-
vscode.window.showInformationMessage('Hello World from <%= displayName %>!');
20-
});
15+
const disposable = vscode.commands.registerCommand(
16+
"<%= name %>.helloWorld",
17+
() => {
18+
// The code you place here will be executed every time your command is executed
19+
// Display a message box to the user
20+
vscode.window.showInformationMessage(
21+
"Hello World from <%= displayName %>!",
22+
);
23+
},
24+
);
2125

2226
context.subscriptions.push(disposable);
2327
}

generators/app/templates/ext-command-web/Source/web/extension.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
// The module 'vscode' contains the VS Code extensibility API
22
// Import the module and reference it with the alias vscode in your code below
3-
import * as vscode from 'vscode';
3+
import * as vscode from "vscode";
44

55
// This method is called when your extension is activated
66
// Your extension is activated the very first time the command is executed
77
export function activate(context: vscode.ExtensionContext) {
8-
98
// Use the console to output diagnostic information (console.log) and errors (console.error)
109
// This line of code will only be executed once when your extension is activated
11-
console.log('Congratulations, your extension "<%= name %>" is now active in the web extension host!');
10+
console.log(
11+
'Congratulations, your extension "<%= name %>" is now active in the web extension host!',
12+
);
1213

1314
// The command has been defined in the package.json file
1415
// Now provide the implementation of the command with registerCommand
1516
// The commandId parameter must match the command field in package.json
16-
const disposable = vscode.commands.registerCommand('<%= name %>.helloWorld', () => {
17-
// The code you place here will be executed every time your command is executed
17+
const disposable = vscode.commands.registerCommand(
18+
"<%= name %>.helloWorld",
19+
() => {
20+
// The code you place here will be executed every time your command is executed
1821

19-
// Display a message box to the user
20-
vscode.window.showInformationMessage('Hello World from <%= displayName %> in a web extension host!');
21-
});
22+
// Display a message box to the user
23+
vscode.window.showInformationMessage(
24+
"Hello World from <%= displayName %> in a web extension host!",
25+
);
26+
},
27+
);
2228

2329
context.subscriptions.push(disposable);
2430
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare module '*.css' {
2-
const classes: { [className: string]: string };
3-
export = classes;
1+
declare module "*.css" {
2+
const classes: { [className: string]: string };
3+
export = classes;
44
}
Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import { render } from './render';
2-
import errorOverlay from 'vscode-notebook-error-overlay';
3-
import type { ActivationFunction } from 'vscode-notebook-renderer';
1+
import errorOverlay from "vscode-notebook-error-overlay";
2+
import type { ActivationFunction } from "vscode-notebook-renderer";
3+
4+
import { render } from "./render";
45

56
// Fix the public path so that any async import()'s work as expected.
67
declare const __webpack_relative_entrypoint_to_root__: string;
78
declare const scriptUrl: string;
89

9-
__webpack_public_path__ = new URL(scriptUrl.replace(/[^/]+$/, '') + __webpack_relative_entrypoint_to_root__).toString();
10+
__webpack_public_path__ = new URL(
11+
scriptUrl.replace(/[^/]+$/, "") + __webpack_relative_entrypoint_to_root__,
12+
).toString();
1013

1114
// ----------------------------------------------------------------------------
1215
// This is the entrypoint to the notebook renderer's webview client-side code.
@@ -15,28 +18,33 @@ __webpack_public_path__ = new URL(scriptUrl.replace(/[^/]+$/, '') + __webpack_re
1518
// rendering logic inside of the `render()` function.
1619
// ----------------------------------------------------------------------------
1720

18-
export const activate: ActivationFunction = context => {
19-
return {
20-
renderOutputItem(outputItem, element) {
21-
let shadow = element.shadowRoot;
22-
if (!shadow) {
23-
shadow = element.attachShadow({ mode: 'open' });
24-
const root = document.createElement('div');
25-
root.id = 'root';
26-
shadow.append(root);
27-
}
28-
const root = shadow.querySelector<HTMLElement>('#root')!;
29-
errorOverlay.wrap(root, () => {
30-
root.innerHTML = '';
31-
const node = document.createElement('div');
32-
root.appendChild(node);
21+
export const activate: ActivationFunction = (context) => {
22+
return {
23+
renderOutputItem(outputItem, element) {
24+
let shadow = element.shadowRoot;
25+
if (!shadow) {
26+
shadow = element.attachShadow({ mode: "open" });
27+
const root = document.createElement("div");
28+
root.id = "root";
29+
shadow.append(root);
30+
}
31+
const root = shadow.querySelector<HTMLElement>("#root")!;
32+
errorOverlay.wrap(root, () => {
33+
root.innerHTML = "";
34+
const node = document.createElement("div");
35+
root.appendChild(node);
3336

34-
render({ container: node, mime: outputItem.mime, value: outputItem.json(), context });
35-
});
36-
},
37-
disposeOutputItem(outputId) {
38-
// Do any teardown here. outputId is the cell output being deleted, or
39-
// undefined if we're clearing all outputs.
40-
}
41-
};
37+
render({
38+
container: node,
39+
mime: outputItem.mime,
40+
value: outputItem.json(),
41+
context,
42+
});
43+
});
44+
},
45+
disposeOutputItem(outputId) {
46+
// Do any teardown here. outputId is the cell output being deleted, or
47+
// undefined if we're clearing all outputs.
48+
},
49+
};
4250
};
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
// We've set up this sample using CSS modules, which lets you import class
22
// names into JavaScript: https://github.com/css-modules/css-modules
33
// You can configure or change this in the webpack.config.js file.
4-
import * as style from './style.css';
5-
import type { RendererContext } from 'vscode-notebook-renderer';
4+
import type { RendererContext } from "vscode-notebook-renderer";
5+
6+
import * as style from "./style.css";
67

78
interface IRenderInfo {
8-
container: HTMLElement;
9-
mime: string;
10-
value: any;
11-
context: RendererContext<unknown>;
9+
container: HTMLElement;
10+
mime: string;
11+
value: any;
12+
context: RendererContext<unknown>;
1213
}
1314

1415
// This function is called to render your contents.
1516
export function render({ container, mime, value }: IRenderInfo) {
16-
// Format the JSON and insert it as <pre><code>{ ... }</code></pre>
17-
// Replace this with your custom code!
18-
const pre = document.createElement('pre');
19-
pre.classList.add(style.json);
20-
const code = document.createElement('code');
21-
code.textContent = `mime type: ${mime}\n\n${JSON.stringify(value, null, 2)}`;
22-
pre.appendChild(code);
23-
container.appendChild(pre);
17+
// Format the JSON and insert it as <pre><code>{ ... }</code></pre>
18+
// Replace this with your custom code!
19+
const pre = document.createElement("pre");
20+
pre.classList.add(style.json);
21+
const code = document.createElement("code");
22+
code.textContent = `mime type: ${mime}\n\n${JSON.stringify(value, null, 2)}`;
23+
pre.appendChild(code);
24+
container.appendChild(pre);
2425
}
2526

2627
if (module.hot) {
27-
module.hot.addDisposeHandler(() => {
28-
// In development, this will be called before the renderer is reloaded. You
29-
// can use this to clean up or stash any state.
30-
});
28+
module.hot.addDisposeHandler(() => {
29+
// In development, this will be called before the renderer is reloaded. You
30+
// can use this to clean up or stash any state.
31+
});
3132
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// The module 'vscode' contains the VS Code extensibility API
22
// Import the module and reference it with the alias vscode in your code below
3-
import * as vscode from 'vscode';
3+
import * as vscode from "vscode";
44

55
// This method is called when your extension is activated
66
// Your extension is activated the very first time the command is executed
77
export function activate(context: vscode.ExtensionContext) {
8-
// Nothing (yet)
8+
// Nothing (yet)
99
}
1010

1111
// This method is called when your extension is deactivated
12-
export function deactivate() { }
12+
export function deactivate() {}

package.json

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"author": {
3-
"email": "Source/[email protected]",
4-
"name": "Source 🖋️ Open 👐🏻",
5-
"url": "HTTPS://Editor.Land"
6-
},
7-
"bugs": {
8-
"url": "HTTPS://GitHub.Com/CodeEditorLand/LandGeneratorCode/issues"
2+
"name": "generator-code",
3+
"description": "Yeoman generator for Visual Studio Code extensions.",
4+
"main": "./generators/app/index.js",
5+
"scripts": {
6+
"prepublishOnly": "Build 'Source/**/*.ts'",
7+
"preversion": "npm test",
8+
"postversion": "git push && git push --tags"
99
},
1010
"dependencies": {
1111
"chalk": "^5.4.1",
@@ -14,34 +14,9 @@
1414
"which": "^5.0.0",
1515
"yosay": "^3.0.0"
1616
},
17-
"description": "Yeoman generator for Visual Studio Code extensions.",
1817
"devDependencies": {
1918
"@playform/build": "0.2.4",
2019
"@types/node": "^22.15.18",
2120
"jsonc-parser": "^3.3.1"
22-
},
23-
"homepage": "HTTPS://GitHub.Com/CodeEditorLand/LandGeneratorCode#readme",
24-
"keywords": [
25-
"codeeditorland",
26-
"land",
27-
"playform"
28-
],
29-
"license": "SEE LICENSE IN LICENSE",
30-
"main": "./generators/app/index.js",
31-
"name": "generator-code",
32-
"private": false,
33-
"publishConfig": {
34-
"access": "public"
35-
},
36-
"repository": {
37-
"type": "git",
38-
"url": "git+HTTPS://github.com/CodeEditorLand/LandGeneratorCode.git"
39-
},
40-
"scripts": {
41-
"postversion": "git push && git push --tags",
42-
"prepublishOnly": "Build 'Source/**/*.ts'",
43-
"preversion": "npm test"
44-
},
45-
"type": "module",
46-
"version": "0.0.1"
21+
}
4722
}

0 commit comments

Comments
 (0)