Skip to content

Commit fe8caba

Browse files
committed
chore up things, simplify build process
1 parent f96835e commit fe8caba

File tree

5 files changed

+35
-60
lines changed

5 files changed

+35
-60
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ typescript/**
33
src/configurationType.ts
44
src/configurationTypeCache.jsonc
55
playground.ts
6+
test.ts

buildTsPlugin.mjs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,4 @@
11
//@ts-check
2-
import { join, resolve } from 'path'
3-
import { ensureDir } from 'fs-extra'
4-
import { build } from 'esbuild'
5-
import { writePackageJsonFile } from 'typed-jsonfile'
2+
import buildTsPlugin from '@zardoy/vscode-utils/build/buildTypescriptPlugin.js'
63

7-
export const buildTsPlugin = async (/** @type {string} */ outDir, /** @type {string} */ name, /** @type {string} */ entrypoint) => {
8-
outDir = resolve(outDir)
9-
entrypoint = resolve(entrypoint)
10-
await ensureDir(outDir)
11-
await writePackageJsonFile(
12-
{ dir: outDir },
13-
{
14-
name,
15-
// TODO
16-
version: '0.0.0',
17-
main: 'index.js',
18-
},
19-
)
20-
await build({
21-
bundle: true,
22-
// TODO change to browser
23-
platform: 'node',
24-
treeShaking: true,
25-
format: 'cjs',
26-
entryPoints: [entrypoint],
27-
outfile: join(outDir, 'index.js'),
28-
mainFields: ['module', 'main'],
29-
})
30-
}
31-
32-
const name = 'typescript-essential-plugins'
33-
await buildTsPlugin(`out/node_modules/${name}`, name, 'typescript/src/index.ts')
4+
await buildTsPlugin('typescript')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@types/lodash": "^4.14.182",
5757
"@vscode/emmet-helper": "^2.8.4",
5858
"@zardoy/utils": "^0.0.6",
59-
"@zardoy/vscode-utils": "^0.0.14",
59+
"@zardoy/vscode-utils": "^0.0.28",
6060
"chokidar": "^3.5.3",
6161
"eslint": "^8.7.0",
6262
"eslint-config-zardoy": "^0.2.8",

pnpm-lock.yaml

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"noEmit": false,
55
"rootDir": "src",
66
"sourceMap": true,
7+
"lib": [
8+
"ESNext"
9+
],
710
"outDir": "build"
811
},
912
"include": [

0 commit comments

Comments
 (0)