@xaendar/language-core 0.9.26 → 0.9.28
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/dist/language-core.js +2 -2
- package/package.json +2 -2
package/dist/language-core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{statSync as
|
|
2
|
-
`),bodyLineOffset:n,path:
|
|
1
|
+
import{statSync as S}from"fs";import{createDocumentRegistry as v,createLanguageService as F,getDefaultLibFilePath as C,ScriptSnapshot as h,sys as s}from"typescript";var i=new Map,u=new Map,l=new Set,a,c;function A(t){let e=c&&JSON.stringify(c)!==JSON.stringify(t);return a&&e&&O(),c=t,a??=F(L(()=>[...l]),v()),a}function L(t){return{getScriptFileNames:()=>[...t(),...i.keys()],getScriptVersion(e){let r=i.get(e);return r?String(r.version):b(e)},getScriptSnapshot(e){let r=i.get(e);if(r)return h.fromString(r.content);if(!s.fileExists(e))return;let n=s.readFile(e);if(n!==void 0)return h.fromString(n)},getCurrentDirectory:()=>process.cwd(),getCompilationSettings:()=>c??{},getDefaultLibFileName:e=>C(e),fileExists(e){return i.has(e)||s.fileExists(e)},readFile(e){let r=i.get(e);return r?r.content:s.readFile(e)},readDirectory:s.readDirectory,directoryExists:s.directoryExists,getDirectories:s.getDirectories,realpath:s.realpath}}function O(){a.dispose(),a=void 0,c=void 0,i.clear(),u.clear(),l.clear()}function H(t){l.add(t)}function J(t){l.delete(t)}function b(t){try{let e=S(t),r=String(e.mtimeMs);return u.set(t,r),r}catch{return u.get(t)??"0"}}function y(t,e){let r=i.get(t);r?.content!==e&&i.set(t,{content:e,version:(r?.version??0)+1})}function T(t){i.delete(t)}function N(t){return t.match(/class\s+(\w+)\s+extends/)?.[1]??"__Component"}import{dirname as E}from"path";import{findConfigFile as V,sys as f,readConfigFile as w,parseJsonConfigFileContent as P}from"typescript";function I(t){let e=V(t,f.fileExists,"tsconfig.json");if(!e)return{};let r=w(e,f.readFile);return P(r.config,f,E(e)).options}import{basename as D,extname as R,resolve as x}from"path";function X(t,e){let r=Array.from(t.entries()),n=`${r[0][0]}.__typecheck__.ts`,o=_(r,n,e.text);return y(n,o.code),o}function _(t,e,r){let n=t.length+4,o=new Array(n).fill(""),p=new Array;for(let g=0;g<t.length;g++){let[d,m]=t[g];p.push(...m),o[g]=`import { ${m.join(", ")} } from './${D(d,R(d))}';`}return o[n-4]="import { Signal } from '@xaendar/core/signals'",o[n-2]=`declare const root: ${p.join(" & ")};`,{code:[...o,r].join(`
|
|
2
|
+
`),bodyLineOffset:n,path:e,classNames:p}}function Y(t,e){let r=t.match(/templateUrl\s*:\s*["'](.+?)["']/)?.[1],n=t.match(/styleUrl\s*:\s*["'](.+?)["']/)?.[1];return{templatePath:r?x(e,r):void 0,stylePath:n?x(e,n):void 0}}export{X as createShim,O as disposeLanguageService,N as extractClassName,Y as extractDecoratorPaths,A as getLanguageService,I as loadCompilerOptions,H as registerRealFile,J as removeRealFile,T as removeVirtualFile,y as upsertVirtualFile};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaendar/language-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.28",
|
|
4
4
|
"description": "A library containing common functionalities for build tools and language service",
|
|
5
5
|
"author": "Kaitenjo",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"main": "./dist/language-core.js",
|
|
16
16
|
"types": "./dist/language-core.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@xaendar/compiler": "0.9.
|
|
18
|
+
"@xaendar/compiler": "0.9.28",
|
|
19
19
|
"typescript": "^6.0.3"
|
|
20
20
|
}
|
|
21
21
|
}
|