@dooboostore/simple-web-component 1.0.55 → 1.0.57

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.
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "simple-web-component-lsp",
3
+ "displayName": "Simple Web Component",
4
+ "version": "0.1.0",
5
+ "description": "SWC language server (shipped inside @dooboostore/simple-web-component as `swc-lsp`) + VS Code client",
6
+ "private": true,
7
+ "license": "MIT",
8
+ "publisher": "dooboostore",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/dooboostore-develop/packages.git",
12
+ "directory": "@dooboostore/simple-web-component/lsp"
13
+ },
14
+ "homepage": "https://dooboostore-develop.github.io/start",
15
+ "categories": [
16
+ "Programming Languages"
17
+ ],
18
+ "keywords": [
19
+ "simple-web-component",
20
+ "swc",
21
+ "web components",
22
+ "lsp"
23
+ ],
24
+ "main": "./out/client/extension.js",
25
+ "engines": {
26
+ "node": ">=18",
27
+ "vscode": "^1.85.0"
28
+ },
29
+ "activationEvents": [
30
+ "onLanguage:typescript",
31
+ "onLanguage:typescriptreact",
32
+ "onLanguage:javascript",
33
+ "onLanguage:html"
34
+ ],
35
+ "contributes": {
36
+ "grammars": [
37
+ {
38
+ "scopeName": "swc.injection",
39
+ "path": "./syntaxes/swc.injection.json",
40
+ "injectTo": [
41
+ "source.ts",
42
+ "source.tsx",
43
+ "source.js",
44
+ "source.js.jsx",
45
+ "text.html.basic",
46
+ "text.html.derivative"
47
+ ],
48
+ "embeddedLanguages": {
49
+ "meta.embedded.swc": "javascript"
50
+ }
51
+ }
52
+ ],
53
+ "configuration": {
54
+ "title": "Simple Web Component",
55
+ "properties": {
56
+ "swc.serverPath": {
57
+ "type": "string",
58
+ "default": "",
59
+ "description": "Path to the SWC language server (server.js). Empty: the one inside node_modules/@dooboostore/simple-web-component/lsp."
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "scripts": {
65
+ "build": "node build.mjs",
66
+ "watch": "node build.mjs --watch",
67
+ "typecheck": "tsc --noEmit -p .",
68
+ "test": "node build.mjs && node --test test/*.test.mjs",
69
+ "package:vsix": "node build.mjs && npx --yes @vscode/vsce@3 package --no-dependencies"
70
+ },
71
+ "dependencies": {
72
+ "typescript": "^5.9.2"
73
+ },
74
+ "devDependencies": {
75
+ "@types/node": "^20",
76
+ "@types/vscode": "^1.85.0",
77
+ "esbuild": "^0.23.0",
78
+ "vscode-languageclient": "^9.0.1",
79
+ "vscode-languageserver": "^9.0.1",
80
+ "vscode-languageserver-textdocument": "^1.0.11"
81
+ }
82
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@dooboostore/simple-web-component",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
7
+ "bin": {
8
+ "swc-lsp": "lsp/bin/swc-lsp.js"
9
+ },
7
10
  "module": "./dist/esm/index.js",
8
11
  "types": "./dist/types/index.d.ts",
9
12
  "typesVersions": {
@@ -29,7 +32,7 @@
29
32
  "bugs": {
30
33
  "url": "https://github.com/dooboostore-develop/packages/issues"
31
34
  },
32
- "homepage": "https://github.com/dooboostore-develop/packages/tree/main/%40dooboostore/simple-web-component",
35
+ "homepage": "https://dooboostore-develop.github.io/package/simple-web-component",
33
36
  "keywords": [
34
37
  "front",
35
38
  "web-components",
@@ -43,7 +46,10 @@
43
46
  "src",
44
47
  "types.d.ts",
45
48
  "LICENSE.md",
46
- "tsconfig.json"
49
+ "/tsconfig.json",
50
+ "lsp/package.json",
51
+ "lsp/bin",
52
+ "lsp/out/server/server.js"
47
53
  ],
48
54
  "publishConfig": {
49
55
  "access": "public"
@@ -67,7 +73,8 @@
67
73
  },
68
74
  "author": "dooboostore <dooboostore@gmail.com> (https://github.com/dooboostore)",
69
75
  "peerDependencies": {
70
- "reflect-metadata": "^0.2.2"
76
+ "reflect-metadata": "^0.2.2",
77
+ "typescript": ">=5"
71
78
  },
72
79
  "devDependencies": {
73
80
  "@babel/core": "^7.24.0",
@@ -96,8 +103,16 @@
96
103
  },
97
104
  "dependencies": {
98
105
  "@dooboostore/core": "1.0.33",
99
- "@dooboostore/core-web": "1.0.14",
100
- "@dooboostore/simple-boot": "1.0.59"
106
+ "@dooboostore/core-web": "1.0.15",
107
+ "@dooboostore/simple-boot": "1.0.60"
108
+ },
109
+ "contributors": [
110
+ "visualkhh <visualkhh@gmail.com> (https://github.com/visualkhh)"
111
+ ],
112
+ "peerDependenciesMeta": {
113
+ "typescript": {
114
+ "optional": true
115
+ }
101
116
  },
102
117
  "scripts": {
103
118
  "clean": "rm -rf dist",
@@ -105,7 +120,7 @@
105
120
  "watch:esm": "pnpm run build:esm && node build.mjs esm --watch",
106
121
  "build:cjs": "node build.mjs cjs",
107
122
  "watch:cjs": "pnpm run build:cjs && node build.mjs cjs --watch",
108
- "build": "pnpm run clean && node build.mjs all",
123
+ "build": "pnpm run clean && node build.mjs all && pnpm --dir lsp run build",
109
124
  "build:umd-bundle": "node build.mjs umd-bundle",
110
125
  "watch:umd-bundle": "pnpm run build:umd-bundle && node build.mjs umd-bundle --watch",
111
126
  "build:esm-bundle": "node build.mjs esm-bundle",
@@ -114,7 +129,7 @@
114
129
  "publish:npm": "pnpm run build && cp package.json package.json.back && pnpm pack && TARBALL_NAME=$(ls dooboostore-simple-web-component-*.tgz | head -n 1) && tar -xzf \"$TARBALL_NAME\" -C . --strip-components=1 package/package.json && rm \"$TARBALL_NAME\" && (pnpm publish --no-git-checks || true) && cp package.json.back package.json && rm -rf package.json.back ",
115
130
  "ts:clean": "find . -name '*.js' -o -name '*.map' -o -name '*.d.ts' | xargs rm -f",
116
131
  "typecheck": "pnpm exec tsc --noEmit",
117
- "test": "pnpm run test:types && node test/unit/run.mjs",
132
+ "test": "pnpm run test:types && node test/unit/run.mjs && pnpm --dir lsp test",
118
133
  "test:bundle": "pnpm --filter @dooboostore/simple-web-component-bundle-test dev",
119
134
  "test:types": "tsc --noEmit -p test/unit | (! grep '^test/')"
120
135
  }
@@ -86,10 +86,10 @@ export const receiveMessage = subscribeSwcAppMessage;
86
86
  // ── subject 를 이름에 박은 별칭: @subscribeSwcAppMessageBehavior('auth') = @subscribeSwcAppMessage('auth', { subject: 'behavior' }) ──
87
87
  type SubjectlessOptions<Data, BeforeReturn, Result> = Omit<SwcAppMessageOptions<Data, BeforeReturn, Result>, 'subject'>;
88
88
 
89
- const withSubject = (subject: SwcAppMessageSubject, a?: any, b?: any, descriptor?: PropertyDescriptor): any => {
90
- if (descriptor) return createSubscribeSwcAppMessage({ subject })(a, b, descriptor); // 괄호 없이
91
- if (typeof a === 'string') return createSubscribeSwcAppMessage({ ...(b ?? {}), subject }, a);
92
- return createSubscribeSwcAppMessage({ ...(a ?? {}), subject });
89
+ const withSubject = (subject: SwcAppMessageSubject, a?: any, b?: any, descriptor?: PropertyDescriptor, fixed: Partial<SwcAppMessageOptions> = {}): any => {
90
+ if (descriptor) return createSubscribeSwcAppMessage({ subject, ...fixed })(a, b, descriptor); // 괄호 없이
91
+ if (typeof a === 'string') return createSubscribeSwcAppMessage({ ...(b ?? {}), subject, ...fixed }, a);
92
+ return createSubscribeSwcAppMessage({ ...(a ?? {}), subject, ...fixed });
93
93
  };
94
94
 
95
95
  /** 늦게 붙어도 마지막 메시지 1개를 받는다 (subject: 'behavior') */
@@ -101,6 +101,19 @@ export function subscribeSwcAppMessageBehavior(a?: any, b?: any, descriptor?: Pr
101
101
  return withSubject('behavior', a, b, descriptor);
102
102
  }
103
103
 
104
+ /**
105
+ * subscribeSwcAppMessageBehavior + trigger 'connectedDone' — 마지막 메시지를 **자기 렌더가 끝난 뒤** 받는다.
106
+ * 핸들러가 자기 DOM 에 쓰는 경우(@innerHtml('.x'), @updateClass 등)에 쓴다: 기본 trigger('connected')는
107
+ * 렌더 전에 재생해서 대상이 아직 없어 조용히 버려진다. (@subscribeSwcAppRouteChangeConnectedDone 과 같은 규칙)
108
+ */
109
+ export function subscribeSwcAppMessageBehaviorConnectedDone(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
110
+ export function subscribeSwcAppMessageBehaviorConnectedDone(messageType: string): MethodDecorator;
111
+ export function subscribeSwcAppMessageBehaviorConnectedDone<Data = any, BeforeReturn = any, Result = any>(options: Omit<SubjectlessOptions<NoInfer<Data>, NoInfer<BeforeReturn>, NoInfer<Result>>, 'trigger'>): MethodDecorator;
112
+ export function subscribeSwcAppMessageBehaviorConnectedDone<Data = any, BeforeReturn = any, Result = any>(messageType: string, options: Omit<SubjectlessOptions<NoInfer<Data>, NoInfer<BeforeReturn>, NoInfer<Result>>, 'trigger'>): MethodDecorator;
113
+ export function subscribeSwcAppMessageBehaviorConnectedDone(a?: any, b?: any, descriptor?: PropertyDescriptor): any {
114
+ return withSubject('behavior', a, b, descriptor, { trigger: 'connectedDone' });
115
+ }
116
+
104
117
  /** 늦게 붙어도 지나간 메시지를 전부 시간순으로 받는다 (subject: 'replay') */
105
118
  export function subscribeSwcAppMessageReplay(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
106
119
  export function subscribeSwcAppMessageReplay(messageType: string): MethodDecorator;