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 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
@@ -0,0 +1,2 @@
1
+ import type { ExtensionContext } from 'vscode';
2
+ export declare const activate: (context: ExtensionContext) => void;
package/dist/browser.js CHANGED
@@ -1 +1 @@
1
- import{window as t,workspace as e}from"vscode";const 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};
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 o}from"vscode";import{availableWebviews as r}from"./webviews/availableWebviews.js";function t(){r.forEach(a=>{o.registerCommand(a.id,async()=>{await a.run()})})}export{t as activate};
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"}
@@ -0,0 +1 @@
1
+ export declare function resolvePath(...paths: string[]): string;
package/dist/utils.js CHANGED
@@ -1 +1,8 @@
1
- import r from"node:path";import{fileURLToPath as o}from"node:url";const e=o(import.meta.url),i=r.dirname(e);function a(...t){return r.join(i,...t)}export{a as resolvePath};
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"}
@@ -0,0 +1,7 @@
1
+ import type { WebviewControllerOptions } from './types/webview.js';
2
+ export declare function webviewController({ id, displayName, run }: WebviewControllerOptions): {
3
+ id: string;
4
+ displayName: string;
5
+ dispose(): void;
6
+ run(): Promise<void>;
7
+ };
@@ -1 +1,41 @@
1
- import{Uri as l,ViewColumn as r,window as a}from"vscode";import{resolvePath as p}from"./utils.js";function u({id:n,displayName:t,run:s}){let e,i;return{id:n,displayName:t,dispose(){i&&(i.dispose(),i=void 0),e&&(e.dispose(),e=void 0)},async run(){const o=await s();if(e!==void 0)return e.webview.html=o,e.reveal(r.Active);e=a.createWebviewPanel(n,t,r.Active,{enableCommandUris:!0,enableFindWidget:!0,enableScripts:!0,retainContextWhenHidden:!0});const d=p("../assets/icon.png");e.iconPath=l.file(d),e.onDidDispose(()=>{e=void 0,i=void 0}),e.webview.html=o}}}export{u as webviewController};
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,G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WebviewControllerInfo[];
@@ -1 +1,3 @@
1
- import{showChangelog as e}from"./showChangelog.js";const r=[e];export{r as availableWebviews};
1
+ import { showChangelog } from './showChangelog.js';
2
+ export const availableWebviews = [showChangelog];
3
+ //# sourceMappingURL=availableWebviews.js.map
@@ -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"}
@@ -0,0 +1,6 @@
1
+ export declare const showChangelog: {
2
+ id: string;
3
+ displayName: string;
4
+ dispose(): void;
5
+ run(): Promise<void>;
6
+ };
@@ -1 +1,18 @@
1
- import{TextDecoder as a}from"node:util";import{marked as t}from"marked";import{Uri as s,workspace as n}from"vscode";import{resolvePath as i}from"../utils.js";import{webviewController as m}from"../webviewController.js";const f=m({id:"pascal.showChangelog",displayName:"Pascal Changelog",run:async()=>{const o=i("../CHANGELOG.md"),r=await n.fs.readFile(s.file(o)).then(e=>new a().decode(e)).then(e=>t.parse(e));return Promise.resolve(r)}});export{f as showChangelog};
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.1",
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": "pascal-scripts build \"src/**/*.{ts,js}\" --copy-wasm --minify",
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
+ };
@@ -1,4 +1,7 @@
1
1
  {
2
2
  "extends": "../../../configs/tsconfig.build.json",
3
- "include": ["src/**/*.ts"]
3
+ "compilerOptions": {
4
+ "emitDeclarationOnly": false,
5
+ "sourceMap": true
6
+ }
4
7
  }
package/tsconfig.json CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "extends": "../../../configs/tsconfig.base.json",
3
+ "include": ["./scripts/*.mjs"],
3
4
  "references": [{ "path": "./tsconfig.build.json" }]
4
5
  }
File without changes