pascal-vscode 0.1.0-beta.1 → 0.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -0
- package/dist/extension.d.ts +1 -0
- package/dist/extension.js +1 -1
- package/dist/extension.js.map +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +8 -1
- package/dist/utils.js.map +1 -0
- package/dist/webviewController.d.ts +7 -0
- package/dist/webviewController.js +41 -1
- package/dist/webviewController.js.map +1 -0
- package/dist/webviews/availableWebviews.d.ts +2 -0
- package/dist/webviews/availableWebviews.js +3 -1
- package/dist/webviews/availableWebviews.js.map +1 -0
- package/dist/webviews/showChangelog.d.ts +6 -0
- package/dist/webviews/showChangelog.js +18 -1
- package/dist/webviews/showChangelog.js.map +1 -0
- package/package.json +4 -3
- package/scripts/build.mjs +45 -0
- package/scripts/shared.mjs +29 -0
- package/tsconfig.build.json +4 -1
- package/tsconfig.json +1 -0
- package/dist/types/webview.d.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# pascal-vscode
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`eed4c8e`](https://github.com/hadez8877/pascal/commit/eed4c8e50ed4504ab5f4744be7d0ae23ff2907e8) Thanks [@hadez8877](https://github.com/hadez8877)! - Refactors the build pipeline to use `tsc` and a local `build.mjs` script instead of `pascal-scripts build`
|
|
8
|
+
|
|
3
9
|
## 0.1.0-beta.1
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{window as t,workspace as e}from"vscode";
|
|
1
|
+
import{window as t,workspace as e}from"vscode";var i=o=>{o.subscriptions.push(e.onDidChangeConfiguration(n=>{n.affectsConfiguration("pascal")&&t.showErrorMessage("VSCode Web doesn't support advanced Pascal options at the moment.")}))};export{i as activate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAyB,EAAE,EAAE;IACrD,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,SAAS,CAAC,wBAAwB,CAAC,CAAC,KAA+B,EAAE,EAAE;QACtE,IAAI,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1C,MAAM,CAAC,gBAAgB,CACtB,mEAAmE,CACnE,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CACF,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function activate(): void;
|
package/dist/extension.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{commands as
|
|
1
|
+
import{commands as W}from"vscode";import{TextDecoder as h}from"node:util";import{marked as C}from"marked";import{Uri as P,workspace as g}from"vscode";import s from"node:path";import{fileURLToPath as c}from"node:url";var w=c(import.meta.url),v=s.dirname(w);function n(...o){return s.join(v,...o)}import{Uri as u,ViewColumn as l,window as b}from"vscode";function m({id:o,displayName:r,run:i}){let e,t;return{id:o,displayName:r,dispose(){t&&(t.dispose(),t=void 0),e&&(e.dispose(),e=void 0)},async run(){let a=await i();if(e!==void 0)return e.webview.html=a,e.reveal(l.Active);e=b.createWebviewPanel(o,r,l.Active,{enableCommandUris:!0,enableFindWidget:!0,enableScripts:!0,retainContextWhenHidden:!0});let f=n("../assets/icon.png");e.iconPath=u.file(f),e.onDidDispose(()=>{e=void 0,t=void 0}),e.webview.html=a}}}var p=m({id:"pascal.showChangelog",displayName:"Pascal Changelog",run:async()=>{let o=n("../CHANGELOG.md"),r=await g.fs.readFile(P.file(o)).then(i=>new h().decode(i)).then(i=>C.parse(i));return Promise.resolve(r)}});var d=[p];function F(){d.forEach(o=>{W.registerCommand(o.id,async()=>{await o.run()})})}export{F as activate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,UAAU,QAAQ;IACvB,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACrC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;YAC/C,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolvePath(...paths: string[]): string;
|
package/dist/utils.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
4
|
+
const __dirname = path.dirname(__filename);
|
|
5
|
+
export function resolvePath(...paths) {
|
|
6
|
+
return path.join(__dirname, ...paths);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,MAAM,UAAU,WAAW,CAAC,GAAG,KAAe;IAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
import{Uri
|
|
1
|
+
import { Uri, ViewColumn, window } from 'vscode';
|
|
2
|
+
import { resolvePath } from './utils.js';
|
|
3
|
+
export function webviewController({ id, displayName, run }) {
|
|
4
|
+
let panel;
|
|
5
|
+
let disposablePanel;
|
|
6
|
+
return {
|
|
7
|
+
id,
|
|
8
|
+
displayName,
|
|
9
|
+
dispose() {
|
|
10
|
+
if (disposablePanel) {
|
|
11
|
+
disposablePanel.dispose();
|
|
12
|
+
disposablePanel = undefined;
|
|
13
|
+
}
|
|
14
|
+
if (panel) {
|
|
15
|
+
panel.dispose();
|
|
16
|
+
panel = undefined;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
async run() {
|
|
20
|
+
const content = await run();
|
|
21
|
+
if (panel !== undefined) {
|
|
22
|
+
panel.webview.html = content;
|
|
23
|
+
return panel.reveal(ViewColumn.Active);
|
|
24
|
+
}
|
|
25
|
+
panel = window.createWebviewPanel(id, displayName, ViewColumn.Active, {
|
|
26
|
+
enableCommandUris: true,
|
|
27
|
+
enableFindWidget: true,
|
|
28
|
+
enableScripts: true,
|
|
29
|
+
retainContextWhenHidden: true
|
|
30
|
+
});
|
|
31
|
+
const ICON_PATH = resolvePath('../assets/icon.png');
|
|
32
|
+
panel.iconPath = Uri.file(ICON_PATH);
|
|
33
|
+
panel.onDidDispose(() => {
|
|
34
|
+
panel = undefined;
|
|
35
|
+
disposablePanel = undefined;
|
|
36
|
+
});
|
|
37
|
+
panel.webview.html = content;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=webviewController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webviewController.js","sourceRoot":"","sources":["../src/webviewController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,UAAU,iBAAiB,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAA4B;IACnF,IAAI,KAA+B,CAAC;IACpC,IAAI,eAAuC,CAAC;IAE5C,OAAO;QACN,EAAE;QACF,WAAW;QAEX,OAAO;YACN,IAAI,eAAe,EAAE,CAAC;gBACrB,eAAe,CAAC,OAAO,EAAE,CAAC;gBAC1B,eAAe,GAAG,SAAS,CAAC;YAC7B,CAAC;YAED,IAAI,KAAK,EAAE,CAAC;gBACX,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChB,KAAK,GAAG,SAAS,CAAC;YACnB,CAAC;QACF,CAAC;QAED,KAAK,CAAC,GAAG;YACR,MAAM,OAAO,GAAG,MAAM,GAAG,EAAE,CAAC;YAE5B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACzB,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC;gBAC7B,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACxC,CAAC;YAED,KAAK,GAAG,MAAM,CAAC,kBAAkB,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,EAAE;gBACrE,iBAAiB,EAAE,IAAI;gBACvB,gBAAgB,EAAE,IAAI;gBACtB,aAAa,EAAE,IAAI;gBACnB,uBAAuB,EAAE,IAAI;aAC7B,CAAC,CAAC;YAEH,MAAM,SAAS,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;YACpD,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAErC,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE;gBACvB,KAAK,GAAG,SAAS,CAAC;gBAClB,eAAe,GAAG,SAAS,CAAC;YAC7B,CAAC,CAAC,CAAC;YAEH,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC;QAC9B,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availableWebviews.js","sourceRoot":"","sources":["../../src/webviews/availableWebviews.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAA4B,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TextDecoder } from 'node:util';
|
|
2
|
+
import { marked } from 'marked';
|
|
3
|
+
import { Uri, workspace } from 'vscode';
|
|
4
|
+
import { resolvePath } from '../utils.js';
|
|
5
|
+
import { webviewController } from '../webviewController.js';
|
|
6
|
+
export const showChangelog = webviewController({
|
|
7
|
+
id: 'pascal.showChangelog',
|
|
8
|
+
displayName: 'Pascal Changelog',
|
|
9
|
+
run: async () => {
|
|
10
|
+
const CHANGELOG_PATH = resolvePath('../CHANGELOG.md');
|
|
11
|
+
const displayContent = await workspace.fs
|
|
12
|
+
.readFile(Uri.file(CHANGELOG_PATH))
|
|
13
|
+
.then((data) => new TextDecoder().decode(data))
|
|
14
|
+
.then((content) => marked.parse(content));
|
|
15
|
+
return Promise.resolve(displayContent);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=showChangelog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showChangelog.js","sourceRoot":"","sources":["../../src/webviews/showChangelog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;IAC9C,EAAE,EAAE,sBAAsB;IAC1B,WAAW,EAAE,kBAAkB;IAE/B,GAAG,EAAE,KAAK,IAAI,EAAE;QACf,MAAM,cAAc,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;QACtD,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,EAAE;aACvC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aAClC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC9C,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAE3C,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACxC,CAAC;CACD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"displayName": "Pascal",
|
|
4
4
|
"publisher": "hadez8877",
|
|
5
5
|
"description": "A modern dark theme for many editors, shells, and more!",
|
|
6
|
-
"version": "0.1.0-beta.
|
|
6
|
+
"version": "0.1.0-beta.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/extension.js",
|
|
9
9
|
"browser": "dist/browser.js",
|
|
@@ -54,9 +54,10 @@
|
|
|
54
54
|
"esbuild": "0.27.3",
|
|
55
55
|
"eslint": "^10.7.0",
|
|
56
56
|
"eslint-plugin-regexp": "^3.1.1",
|
|
57
|
+
"kleur": "^4.1.5",
|
|
57
58
|
"ovsx": "^0.10.12",
|
|
58
|
-
"pascal-scripts": "1.0.0-beta.0",
|
|
59
59
|
"prettier": "^3.9.5",
|
|
60
|
+
"tinyglobby": "^0.2.16",
|
|
60
61
|
"turbo": "2.10.4",
|
|
61
62
|
"typescript": "^6.0.3"
|
|
62
63
|
},
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
"vscode": "^1.88.0"
|
|
69
70
|
},
|
|
70
71
|
"scripts": {
|
|
71
|
-
"build": "
|
|
72
|
+
"build": "tsc -b && node scripts/build.mjs -- --minify",
|
|
72
73
|
"lint": "biome lint . && eslint --cache --concurrency=auto ."
|
|
73
74
|
}
|
|
74
75
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import esbuild from 'esbuild';
|
|
4
|
+
import { rebuildPlugin } from './shared.mjs';
|
|
5
|
+
|
|
6
|
+
export default async function build() {
|
|
7
|
+
const isDev = process.argv.includes('--watch');
|
|
8
|
+
const metaFile = process.argv.includes('--metafile');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @satisfies {import('esbuild').BuildOptions}
|
|
12
|
+
*/
|
|
13
|
+
const config = {
|
|
14
|
+
entryPoints: ['src/extension.ts', 'src/browser.ts'],
|
|
15
|
+
bundle: true,
|
|
16
|
+
metafile: metaFile,
|
|
17
|
+
sourcemap: isDev,
|
|
18
|
+
outdir: 'dist',
|
|
19
|
+
external: ['vscode', 'marked'],
|
|
20
|
+
format: 'esm',
|
|
21
|
+
platform: 'node',
|
|
22
|
+
tsconfig: './tsconfig.json',
|
|
23
|
+
define: { 'process.env.NODE_ENV': '"production"' },
|
|
24
|
+
minify: process.argv.includes('--minify')
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
if (!isDev) {
|
|
28
|
+
const result = await esbuild.build(config);
|
|
29
|
+
if (metaFile) await fs.writeFile('meta.json', JSON.stringify(result.metafile));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const builder = await esbuild.context({
|
|
34
|
+
...config,
|
|
35
|
+
plugins: [rebuildPlugin]
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
await builder.watch();
|
|
39
|
+
|
|
40
|
+
process.on('beforeExit', () => {
|
|
41
|
+
void builder.dispose?.();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
void build();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { dim, green, red, yellow } from 'kleur/colors';
|
|
3
|
+
|
|
4
|
+
const dt = new Intl.DateTimeFormat('en-us', {
|
|
5
|
+
hour: '2-digit',
|
|
6
|
+
minute: '2-digit'
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {import('esbuild').Plugin}
|
|
11
|
+
*/
|
|
12
|
+
export const rebuildPlugin = {
|
|
13
|
+
name: 'pascal:rebuild',
|
|
14
|
+
setup(build) {
|
|
15
|
+
build.onEnd(async (result) => {
|
|
16
|
+
const date = dt.format(new Date());
|
|
17
|
+
if (result && result.errors.length) {
|
|
18
|
+
console.error(dim(`[${date}] `) + red(result.errors.map((error) => error.text).join('\n')));
|
|
19
|
+
} else {
|
|
20
|
+
if (result.warnings.length) {
|
|
21
|
+
console.info(
|
|
22
|
+
dim(`[${date}] `) + yellow('⚠ updated with warnings:\n' + result.warnings.join('\n'))
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
console.info(dim(`[${date}] `) + green('✔ updated'));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
package/tsconfig.build.json
CHANGED
package/tsconfig.json
CHANGED
package/dist/types/webview.d.js
DELETED
|
File without changes
|