create-octane-xplat 0.19.0 → 0.20.0
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/README.md +2 -147
- package/compatibility.json +74 -61
- package/compatibility.ts +134 -79
- package/dist/compatibility.js +45 -13
- package/dist/index.js +127 -64
- package/dist/package-manager.js +62 -0
- package/dist/scaffold.js +362 -57
- package/index.ts +256 -156
- package/library-template/AGENTS.md +1 -1
- package/library-template/README.md +4 -3
- package/library-template/bunfig +4 -0
- package/library-template/package.json +73 -70
- package/library-template/patches/@nativescript-community__octane@0.2.5.patch +161 -24
- package/library-template/patches/@nativescript__core@9.1.3.patch +98 -0
- package/library-template/patches/@nativescript__vite@8.0.20.patch +532 -17
- package/library-template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
- package/library-template/patches/octane@0.16.3.patch +56 -2
- package/library-template/src/Badge.tsx +5 -5
- package/library-template/src/Badge.web.tsx +5 -5
- package/library-template/src/Welcome.stories.tsx +12 -0
- package/library-template/src/normalizeBadgeLabel.ts +1 -1
- package/library-template/src/props.ts +11 -11
- package/library-template/tests/normalizeBadgeLabel.test.ts +1 -1
- package/library-template/tests/packed-consumer.mjs +140 -123
- package/library-template/tsconfig.envs.json +1 -0
- package/library-template/tsconfig.json +1 -0
- package/library-template/tsconfig.types.json +15 -1
- package/library-template/tsrx-typegen.json +1 -1
- package/library-template/workshop.config.ts +3 -0
- package/package-manager.ts +93 -0
- package/package.json +10 -5
- package/scaffold.ts +1061 -449
- package/template/.agents/skills/xplat/SKILL.md +1 -1
- package/template/.agents/skills/xplat/references/styling.md +10 -10
- package/template/AGENTS.md +2 -2
- package/template/bunfig +4 -0
- package/template/nativescript.config.ts +13 -13
- package/template/package.json +69 -64
- package/template/patches/@nativescript-community__octane@0.2.5.patch +161 -24
- package/template/patches/@nativescript__core@9.1.3.patch +98 -0
- package/template/patches/@nativescript__vite@8.0.20.patch +532 -17
- package/template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
- package/template/patches/octane@0.16.3.patch +56 -2
- package/template/src/App.tsrx +66 -64
- package/template/src/Welcome.stories.tsx +22 -0
- package/template/src/app.spec.tsrx +168 -158
- package/template/src/app.web.test.tsx +18 -13
- package/template/src/failure-reporting.spec.ts +3 -3
- package/template/src/main.ts +14 -13
- package/template/src/main.tsrx +2 -0
- package/template/src/native-runtime.spec.ts +13 -11
- package/template/src/test-setup.web.ts +9 -8
- package/template/src/test.ts +6 -6
- package/template/tsconfig.json +17 -1
- package/template/vite.config.native.mts +1 -2
- package/template/vite.config.ts +29 -23
- package/template/vitest.config.mts +17 -17
- package/template/vitest.web.config.mts +7 -7
- package/template/workshop.config.ts +3 -0
- package/library-template/patches/@tsrx__typescript-plugin@0.4.11.patch +0 -11
- package/template/patches/@tsrx__typescript-plugin@0.4.11.patch +0 -11
- /package/library-template/patches/{@octanejs__tiptap@0.0.61.patch → @octanejs__tiptap@0.0.62.patch} +0 -0
- /package/template/patches/{@octanejs__tiptap@0.0.61.patch → @octanejs__tiptap@0.0.62.patch} +0 -0
|
@@ -10,21 +10,21 @@ import { nativeScript } from '@nativescript/unit-test-runner'
|
|
|
10
10
|
// already-booted simulator: `xcrun simctl boot <udid>` first, then pass
|
|
11
11
|
// `--device <udid>` (or NS_DEVICE).
|
|
12
12
|
export default defineConfig({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
plugins: [
|
|
14
|
+
nativeScript({
|
|
15
|
+
platform: process.env.NS_PLATFORM || 'ios', // 'android' | 'ios' | 'visionos'
|
|
16
|
+
device: process.env.NS_DEVICE || undefined,
|
|
17
|
+
// Keep this in sync with the import.meta.glob in src/test.ts —
|
|
18
|
+
// the device can only run files that made it into the bundle.
|
|
19
|
+
include: ['src/**/*.spec.{ts,tsx,tsrx}'],
|
|
20
|
+
// The connect clock starts when the host session opens and covers
|
|
21
|
+
// `ns run`'s native build + install + boot — a cold build easily
|
|
22
|
+
// exceeds the 120s default.
|
|
23
|
+
connectTimeout: 600_000,
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
test: {
|
|
27
|
+
// Device runs include app startup and real layout passes.
|
|
28
|
+
testTimeout: 30_000,
|
|
29
|
+
},
|
|
30
30
|
})
|
|
@@ -3,11 +3,11 @@ import appConfig from './vite.config.ts'
|
|
|
3
3
|
|
|
4
4
|
// Reuse the app's compiler, web platform resolution and aliases.
|
|
5
5
|
export default defineConfig(async (env) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
mergeConfig(await (typeof appConfig === 'function' ? appConfig(env) : appConfig), {
|
|
7
|
+
test: {
|
|
8
|
+
environment: 'jsdom',
|
|
9
|
+
include: ['src/**/*.web.test.{ts,tsx,tsrx}'],
|
|
10
|
+
setupFiles: ['src/test-setup.web.ts'],
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
13
|
)
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
diff --git a/dist/language-CofXAudP.js b/dist/language-CofXAudP.js
|
|
2
|
-
index 0d5504342813cd32b77bc834f9ed01bf6a353e3f..aff65966aba619c96f627474bb8e36c34d44f3e1 100644
|
|
3
|
-
--- a/dist/language-CofXAudP.js
|
|
4
|
-
+++ b/dist/language-CofXAudP.js
|
|
5
|
-
@@ -3,5 +3,5 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
6
|
-
`));return e?null:void 0}let u=D(o.layers,e=>ne(e.config));if(u.state===`invalid`)return j(`Invalid TSRX ${u.target} declaration:`,u.actual_type,u.actual_value,`in ${u.config_path}`),null;let f=o.extends_failures.filter(e=>u.state!==`declared`||!B(o.layers,e,u.config_path));if(f.length>0){for(let e of f){if(e.diagnostics.length===0){j(`Unable to resolve tsconfig extends entry:`,JSON.stringify(e.extends_value),`in ${e.config_path}`);continue}for(let t of e.diagnostics)j(`Unable to resolve tsconfig extends entry:`,JSON.stringify(e.extends_value),`in ${e.config_path}`,n.flattenDiagnosticMessageText(t.messageText,`
|
|
7
|
-
`))}return null}if(u.state===`declared`)return ae(n,r,u.config_path,u.value)}function se(e,t={}){let n=t.ts??l.default,r=t.configHost??n.sys,i=I(r),a=t.configFileName??R(d.default.dirname(e),r,i);if(a===null)return;let o=z(n,r,a,i);for(let e of o.dependencies)t.dependencies?.add(e);let s=o.layers.find(e=>e.raw_source===void 0);if(s){let e=`Unable to read tsconfig layer while resolving TSRX platform: ${s.path}`;throw j(e),Error(e)}let c=o.layers.filter(e=>e.parse_diagnostics.length>0);if(c.length>0){if(!o.layers.some(e=>E(e.config,[`tsrx`]).state===`found`?!0:e.parse_diagnostics.length>0&&e.raw_source!==void 0&&M.test(e.raw_source)))return;let e=c[0],t=n.flattenDiagnosticMessageText(e.parse_diagnostics[0].messageText,`
|
|
8
|
-
`),r=`Unable to parse tsconfig layer while resolving TSRX platform: ${e.path}: ${t}`;throw j(r),Error(r)}let u=D(o.layers,e=>re(e.config));if(u.state===`invalid`){let e=u.target===`platform`?` Expected "web", "ios", or "android".`:``,t=`Invalid TSRX ${u.target} declaration: ${u.actual_type} ${u.actual_value} in ${u.config_path}.${e}`;throw j(t),TypeError(t)}let f=o.extends_failures.filter(e=>u.state!==`declared`||!B(o.layers,e,u.config_path));if(f.length>0){if(!t.requirePlatformResolution)return u.state===`declared`?u.value:void 0;let e=f[0],r=e.diagnostics.length>0?`: ${n.flattenDiagnosticMessageText(e.diagnostics[0].messageText,`
|
|
9
|
-
-`)}`:``,i=`Unable to resolve tsconfig extends entry ${JSON.stringify(e.extends_value)} in ${e.config_path} while resolving TSRX platform${r}`;throw j(i),Error(i)}return u.state===`declared`?u.value:void 0}const ce=(0,f.createRequire)(require(`url`).pathToFileURL(__filename).href),le=d.default.dirname((0,p.fileURLToPath)(require(`url`).pathToFileURL(__filename).href)),{log:V,logWarning:H,logError:U}=k(`[TSRX Language]`),W=new Set,G=[`.tsrx`],K=[[`@tsrx/ripple`,[`node_modules`,`@tsrx`,`ripple`],[`.tsrx`],[`@tsrx/ripple`,`ripple`,`@ripple-ts/vite-plugin`]],[`@tsrx/react`,[`node_modules`,`@tsrx`,`react`],[`.tsrx`],[`@tsrx/react`,`@tsrx/vite-plugin-react`]],[`@tsrx/solid`,[`node_modules`,`@tsrx`,`solid`],[`.tsrx`],[`@tsrx/solid`,`@tsrx/vite-plugin-solid`]],[`@tsrx/preact`,[`node_modules`,`@tsrx`,`preact`],[`.tsrx`],[`@tsrx/preact`,`@tsrx/vite-plugin-preact`]],[`@tsrx/vue`,[`node_modules`,`@tsrx`,`vue`],[`.tsrx`],[`@tsrx/vue`,`@tsrx/vite-plugin-vue`]],[`@tsrx/hono`,[`node_modules`,`@tsrx`,`hono`],[`.tsrx`],[`@tsrx/hono`,`@tsrx/vite-plugin-hono`]],[`octane`,[`node_modules`,`octane`],[`.tsrx`],[`octane`,`@octanejs/vite-plugin`],[[`dist`,`compiler`,`volar.js`],[`src`,`compiler`,`volar.js`]]]],ue=[[`src`,`index.js`]];function de(e){return G.some(t=>e.endsWith(t))}function fe(e,t=l.default){let n=t.createScanner(t.ScriptTarget.Latest,!0,t.LanguageVariant.JSX,e),r=[];for(let e=n.scan();e!==t.SyntaxKind.EndOfFileToken;e=n.scan())r.push({kind:e,text:n.getTokenText()});let i=[`import`,`.`,`meta`,`.`,`env`,`.`,`platform`,`.`];for(let e=0;e+i.length<r.length;e+=1){if(e>0&&(r[e-1].kind===t.SyntaxKind.DotToken||r[e-1].kind===t.SyntaxKind.QuestionDotToken)||!i.every((t,n)=>r[e+n].text===t))continue;let n=r[e+i.length].text;if(n===`web`||n===`ios`||n===`android`)return!0}return!1}function pe(e={}){V(`Creating TSRX language plugin...`);let t=e.ts??l.default,n={...e,ts:t,configHost:e.configHost??t.sys};return{getLanguageId(e){let t=typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`);if(de(t))return V(`Identified TSRX file:`,t),`tsrx`},createVirtualCode(e,t,r){if(t===`tsrx`){let t=ve(e),i=ye(t,n);if(!i){U(`TSRX compiler not found for file: ${t}`);return}V(`Creating virtual code for:`,t);try{return new q(t,r,i,e=>se(t,{...n,requirePlatformResolution:e}))}catch(e){throw U(`Failed to create virtual code for:`,t,`:`,e),e}}},updateVirtualCode(e,t,n){if(t instanceof q)return V(`Updating existing virtual code for:`,t.fileName),t.update(n),t},typescript:{extraFileExtensions:G.map(e=>({extension:e.slice(1),isMixedContent:!1,scriptKind:7})),getServiceScript(e){for(let t of(0,w.forEachEmbeddedCode)(e))if(t.languageId===`tsrx`)return{code:t,extension:`.tsx`,scriptKind:4}},...process.env.TSRX_TSC===`true`?null:{getExtraServiceScripts(e,t){let n=[];for(let r of(0,w.forEachEmbeddedCode)(t))r.languageId===`typescript`&&n.push({fileName:`${e}.${r.id}.ts`,code:r,extension:`.ts`,scriptKind:l.default.ScriptKind.TS});return n}}}}}var q=class{id=`root`;languageId=`tsrx`;codegenStacks=[];tsrx;platformProvider;generatedCode=``;embeddedCodes=[];mappings=[];fatalErrors=[];usageErrors=[];snapshot;sourceSnapshot;originalCode=``;sourceAst=null;isDotCompletionMode=!1;diagnostics=[];#e=null;#t=null;constructor(e,t,n,r){if(V(`Initializing TSRXVirtualCode for:`,e),this.fileName=e,this.tsrx=n,this.platformProvider=r,this.snapshot=t,this.sourceSnapshot=t,this.originalCode=t.getText(0,t.getLength()),!n||typeof n.compile_to_volar_mappings!=`function`)throw U(`Invalid TSRX compiler - missing compile_to_volar_mappings method`),Error(`Invalid TSRX compiler`);this.update(t)}update(e){V(`Updating virtual code for:`,this.fileName);let t=e.getText(0,e.getLength()),n=e.getChangeRange(this.sourceSnapshot);this.sourceSnapshot=e,this.#e=null,this.#t=null,this.fatalErrors=[],this.usageErrors=[],this.sourceAst=null,this.isDotCompletionMode=!1;let r,i=!1,a=-1;if(V(`changeRange:`,JSON.stringify(n)),n){let e=n.span.start,r=e+n.span.length,o=e+n.newLength,s=this.originalCode.substring(e,r),c=t.substring(e,o);if(V(`Change details:`),V(` Position:`,e,`-`,r,`(length:`,n.span.length,`)`),V(` Old text:`,JSON.stringify(s)),V(` New text:`,JSON.stringify(c),`(length:`,n.newLength,`)`),c.endsWith(`.`)){let e=o>1?t[o-2]:``;V(` Char before dot:`,JSON.stringify(e)),/[$#_\u200C\u200D\p{ID_Continue}\)\]\}]/u.test(e)&&(i=!0,a=o-1,V(`ChangeRange detected dot typed at position`,a))}}try{let e=this.platformProvider?.(fe(t));if(i&&a>=0){this.isDotCompletionMode=!0;let n=t.substring(0,a)+t.substring(a+1);if(V(`Compiling without typed dot at position`,a),r=this.tsrx.compile_to_volar_mappings(n,this.fileName,{loose:!0,platform:e}),V(`Compilation without dot successful`),r&&r.code&&r.mappings.length>0){let e=ge(r,a);e===null?H(`Failed to restore typed dot into transpiled output`):V(`Inserted typed dot at generated position`,e)}}else V(`Compiling TSRX code...`),r=this.tsrx.compile_to_volar_mappings(t,this.fileName,{loose:!0,platform:e}),V(`Compilation successful, generated code length:`,r?.code?.length||0)}catch(e){let t=e;U(`TSRX compilation failed for`,this.fileName,`:`,t),process.env.TSRX_TSC===`true`&&Y(this.fileName,[t]),t.type=`fatal`,this.fatalErrors.push(t)}if(r&&r.code){this.originalCode=t,this.generatedCode=r.code,this.mappings=r.mappings??[],this.usageErrors=r.errors,this.sourceAst=r.sourceAst,process.env.TSRX_TSC===`true`&&r.errors.length>0&&Y(this.fileName,r.errors);let e=r.cssMappings,n=r.scriptMappings??[];if(e.length>0||n.length>0){V(`Creating`,e.length,`CSS and`,n.length,`script embedded codes`);let t=[];for(let n of e)t.push(X(n,`css`));for(let e of n)t.push(X(e,`typescript`));this.embeddedCodes=t}else this.embeddedCodes=[];if(O){V(`CSS embedded codes:`,(this.embeddedCodes||[]).length),V(`Using transpiled code, mapping count:`,this.mappings.length),V(`Original code length:`,t.length),V(`Generated code length:`,this.generatedCode.length),V(`Last 100 chars of original:`,JSON.stringify(t.slice(-100))),V(`Last 200 chars of generated:`,JSON.stringify(this.generatedCode.slice(-200))),V(`Last few mappings:`);let e=Math.max(0,this.mappings.length-5);for(let t=e;t<this.mappings.length;t++){let e=this.mappings[t];V(` Mapping ${t}: source[${e.sourceOffsets[0]}:${e.sourceOffsets[0]+e.lengths[0]}] -> gen[${e.generatedOffsets[0]}:${e.generatedOffsets[0]+e.lengths[0]}], len=${e.lengths[0]}, completion=${e.data?.completion}`)}}this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}else V(`Compilation failed, only display where the compilation error occurred.`),this.originalCode=t,this.generatedCode=t,this.mappings=[{sourceOffsets:[0],generatedOffsets:[0],lengths:[t.length],generatedLengths:[t.length],data:{completion:!0,verification:!0,customData:{}}}],this.embeddedCodes=[...me(t),...he(t)],this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}#n(){if(!(this.#e||this.#t)){this.#e=new Map,this.#t=new Map;for(var e,t,n,r,i,a,o,s,c,l=0;l<this.mappings.length;l++)e=this.mappings[l],t=e.generatedOffsets[0],n=e.generatedLengths[0],r=t+n,i=`${t}-${r}`,this.#e.set(i,e),a=e.sourceOffsets[0],o=e.lengths[0],s=a+o,c=`${a}-${s}`,this.#t.set(c,e)}}findMappingByGeneratedRange(e,t){return this.#n(),this.#e.get(`${e}-${t}`)??null}findMappingBySourceRange(e,t){return this.#n(),this.#t.get(`${e}-${t}`)??null}findGeneratedRangeBySourceRange(e,t){let n=null,r=null;for(let i=0;i<this.mappings.length;i++){let a=this.mappings[i],o=a.sourceOffsets[0],s=o+a.lengths[0];s<=e||o>=t||((!n||o<n.sourceOffsets[0])&&(n=a),(!r||s>r.sourceOffsets[0]+r.lengths[0])&&(r=a))}if(!n||!r)return null;let i=n.generatedOffsets[0]+J(e-n.sourceOffsets[0],n.generatedLengths[0]),a=r.generatedOffsets[0]+J(t-r.sourceOffsets[0],r.generatedLengths[0]);return[i,Math.max(a,i+1)]}};function J(e,t){return Math.min(Math.max(e,0),t)}function Y(e,t){for(let n of t){let t=n&&typeof n==`object`&&`message`in n?String(n.message):String(n),r=`${e}\0${t}`;W.has(r)||(W.add(r),console.error(`[tsrx-tsc] ${e}: ${t}`))}}function me(e){let t=[],n=/<style\b((?:[^>"'{}/]|"[^"]*"|'[^']*'|\{(?:[^{}]|\{[^{}]*\})*\}|\/(?!>))*)>([\s\S]*?)<\/style>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(6+e.length+1),o=n.length,s=`style_${i}`;V(`Extracted CSS region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`css`)),i++}return t.length>0&&V(`Extracted ${t.length} CSS embedded codes from style tags`),t}function X(e,t){let n=e.data?.customData?.content??``;return{id:e.data?.customData?.embeddedId,languageId:t,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>e.lengths[0],getChangeRange:()=>void 0},mappings:[e],embeddedCodes:[]}}function he(e){let t=[],n=/<script\b((?:[^>"'/]|"[^"]*"|'[^']*'|\/(?!>))*)>([\s\S]*?)<\/script>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(7+e.length+1),o=n.length,s=`script_${i}`;V(`Extracted script region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`typescript`)),i++}return t.length>0&&V(`Extracted ${t.length} script embedded codes from script tags`),t}function ge(e,t){let n=null;for(let r of e.mappings)if(r.sourceOffsets[0]+r.lengths[0]===t){n=r;break}if(!n)return null;let r=n.generatedLengths[0],i=n.generatedOffsets[0]+r;e.code=e.code.substring(0,i)+`.`+e.code.substring(i);let a={sourceOffsets:[t],generatedOffsets:[i],lengths:[1],generatedLengths:[1],data:{...n.data}},o=e.mappings.indexOf(n);e.mappings.splice(o+1,0,a);for(let r of e.mappings)r!==n&&r!==a&&r.generatedOffsets[0]>=i&&(r.generatedOffsets[0]+=1),r!==n&&r!==a&&r.sourceOffsets[0]>=t&&(r.sourceOffsets[0]+=1);return i}const _e=new Map,Z=new Map;function ve(e){return typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`)}function Q(e,t=u.default.existsSync){let n=e,r=[];for(;n;){if(Z.has(n)){let e=Z.get(n)??null;for(let t of r)Z.set(t,e);return e}r.push(n);let e=d.default.join(n,`package.json`);if(t(e))try{let t=JSON.parse(u.default.readFileSync(e,`utf8`)),n=new Set([...Object.keys(t.dependencies??{}),...Object.keys(t.devDependencies??{}),...Object.keys(t.peerDependencies??{}),...Object.keys(t.optionalDependencies??{})]),i={name:typeof t.name==`string`?t.name:null,dependencies:n};for(let e of r)Z.set(e,i);return i}catch{for(let e of r)Z.set(e,null);return null}let i=d.default.dirname(n);if(i===n)break;n=i}for(let e of r)Z.set(e,null);return null}function $(e,t,n){if(!e)return!1;if(e.name===t||n.includes(e.name??``)||e.dependencies.has(t))return!0;for(let t of n)if(e.dependencies.has(t))return!0;return!1}function ye(e,t){let n=Se(e,t);if(n)return be(ce(n))}function be(e){return typeof e?.compile_to_volar_mappings!=`function`&&typeof e?.compileToVolarMappings==`function`?{...e,compile_to_volar_mappings:e.compileToVolarMappings}:e}function xe(e,t=u.default.existsSync,n=_e){let r=e.split(`/`),i=d.default.extname(e);for(let e=r.length-2;e>=0;e--){let a=r.slice(0,e+1).join(`/`),o=a+`\0`+i;if(!n.has(o)){let e=[];for(let[n,r,o,s,c=ue]of K)if(o.includes(i))for(let i of c){let o=[a,...r,...i].join(`/`);if(t(o)){e.push([n,o,s]);break}}let r=null;if(e.length>0){let n=Q(a,t);r=e.find(([e,,t])=>$(n,e,t))?.[1]??e[0][1],V(`Found tsrx compiler at:`,r,`for extension:`,i)}n.set(o,r)}let s=n.get(o);if(s)return s}}function Se(e,t){let n=d.default.extname(e),r=oe(e,t);if(r!==void 0)return r??void 0;let i=Q(d.default.dirname(e)),a=xe(e);if(a)return a;let o=`No supported tsrx compiler found in workspace for ${e}.`,s=le;for(;s;){let e=[];for(let[t,r,i,a,o=ue]of K){if(!i.includes(n))continue;let c=d.default.join(s,...r);for(let n of o){let r=d.default.join(c,...n);if(u.default.existsSync(r)){e.push([t,r,a]);break}}}if(e.length>0){let t=e.find(([e,,t])=>$(i,e,t))?.[1]??e[0][1];return H(`${o} Using packaged version at ${t}`),t}let t=d.default.dirname(s);if(t===s)break;s=t}}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return pe}});
|
|
10
|
-
+`)}`:``,i=`Unable to resolve tsconfig extends entry ${JSON.stringify(e.extends_value)} in ${e.config_path} while resolving TSRX platform${r}`;throw j(i),Error(i)}return u.state===`declared`?u.value:void 0}const ce=(0,f.createRequire)(require(`url`).pathToFileURL(__filename).href),le=d.default.dirname((0,p.fileURLToPath)(require(`url`).pathToFileURL(__filename).href)),{log:V,logWarning:H,logError:U}=k(`[TSRX Language]`),W=new Set,G=[`.tsrx`],K=[[`@tsrx/ripple`,[`node_modules`,`@tsrx`,`ripple`],[`.tsrx`],[`@tsrx/ripple`,`ripple`,`@ripple-ts/vite-plugin`]],[`@tsrx/react`,[`node_modules`,`@tsrx`,`react`],[`.tsrx`],[`@tsrx/react`,`@tsrx/vite-plugin-react`]],[`@tsrx/solid`,[`node_modules`,`@tsrx`,`solid`],[`.tsrx`],[`@tsrx/solid`,`@tsrx/vite-plugin-solid`]],[`@tsrx/preact`,[`node_modules`,`@tsrx`,`preact`],[`.tsrx`],[`@tsrx/preact`,`@tsrx/vite-plugin-preact`]],[`@tsrx/vue`,[`node_modules`,`@tsrx`,`vue`],[`.tsrx`],[`@tsrx/vue`,`@tsrx/vite-plugin-vue`]],[`@tsrx/hono`,[`node_modules`,`@tsrx`,`hono`],[`.tsrx`],[`@tsrx/hono`,`@tsrx/vite-plugin-hono`]],[`octane`,[`node_modules`,`octane`],[`.tsrx`],[`octane`,`@octanejs/vite-plugin`],[[`dist`,`compiler`,`volar.js`],[`src`,`compiler`,`volar.js`]]]],ue=[[`src`,`index.js`]];function de(e){return G.some(t=>e.endsWith(t))}function fe(e,t=l.default){let n=t.createScanner(t.ScriptTarget.Latest,!0,t.LanguageVariant.JSX,e),r=[];for(let e=n.scan();e!==t.SyntaxKind.EndOfFileToken;e=n.scan())r.push({kind:e,text:n.getTokenText()});let i=[`import`,`.`,`meta`,`.`,`env`,`.`,`platform`,`.`];for(let e=0;e+i.length<r.length;e+=1){if(e>0&&(r[e-1].kind===t.SyntaxKind.DotToken||r[e-1].kind===t.SyntaxKind.QuestionDotToken)||!i.every((t,n)=>r[e+n].text===t))continue;let n=r[e+i.length].text;if(n===`web`||n===`ios`||n===`android`)return!0}return!1}function pe(e={}){V(`Creating TSRX language plugin...`);let t=e.ts??l.default,n={...e,ts:t,configHost:e.configHost??t.sys};return{getLanguageId(e){let t=typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`);if(de(t))return V(`Identified TSRX file:`,t),`tsrx`},createVirtualCode(e,t,r){if(t===`tsrx`){let t=ve(e),i=ye(t,n);if(!i){U(`TSRX compiler not found for file: ${t}`);return}V(`Creating virtual code for:`,t);try{return new q(t,r,i,e=>se(t,{...n,requirePlatformResolution:e}))}catch(e){throw U(`Failed to create virtual code for:`,t,`:`,e),e}}},updateVirtualCode(e,t,n){if(t instanceof q)return V(`Updating existing virtual code for:`,t.fileName),t.update(n),t},typescript:{resolveHiddenExtensions:!0,extraFileExtensions:G.map(e=>({extension:e.slice(1),isMixedContent:!1,scriptKind:7})),getServiceScript(e){for(let t of(0,w.forEachEmbeddedCode)(e))if(t.languageId===`tsrx`)return{code:t,extension:`.tsx`,scriptKind:4}},...process.env.TSRX_TSC===`true`?null:{getExtraServiceScripts(e,t){let n=[];for(let r of(0,w.forEachEmbeddedCode)(t))r.languageId===`typescript`&&n.push({fileName:`${e}.${r.id}.ts`,code:r,extension:`.ts`,scriptKind:l.default.ScriptKind.TS});return n}}}}}var q=class{id=`root`;languageId=`tsrx`;codegenStacks=[];tsrx;platformProvider;generatedCode=``;embeddedCodes=[];mappings=[];fatalErrors=[];usageErrors=[];snapshot;sourceSnapshot;originalCode=``;sourceAst=null;isDotCompletionMode=!1;diagnostics=[];#e=null;#t=null;constructor(e,t,n,r){if(V(`Initializing TSRXVirtualCode for:`,e),this.fileName=e,this.tsrx=n,this.platformProvider=r,this.snapshot=t,this.sourceSnapshot=t,this.originalCode=t.getText(0,t.getLength()),!n||typeof n.compile_to_volar_mappings!=`function`)throw U(`Invalid TSRX compiler - missing compile_to_volar_mappings method`),Error(`Invalid TSRX compiler`);this.update(t)}update(e){V(`Updating virtual code for:`,this.fileName);let t=e.getText(0,e.getLength()),n=e.getChangeRange(this.sourceSnapshot);this.sourceSnapshot=e,this.#e=null,this.#t=null,this.fatalErrors=[],this.usageErrors=[],this.sourceAst=null,this.isDotCompletionMode=!1;let r,i=!1,a=-1;if(V(`changeRange:`,JSON.stringify(n)),n){let e=n.span.start,r=e+n.span.length,o=e+n.newLength,s=this.originalCode.substring(e,r),c=t.substring(e,o);if(V(`Change details:`),V(` Position:`,e,`-`,r,`(length:`,n.span.length,`)`),V(` Old text:`,JSON.stringify(s)),V(` New text:`,JSON.stringify(c),`(length:`,n.newLength,`)`),c.endsWith(`.`)){let e=o>1?t[o-2]:``;V(` Char before dot:`,JSON.stringify(e)),/[$#_\u200C\u200D\p{ID_Continue}\)\]\}]/u.test(e)&&(i=!0,a=o-1,V(`ChangeRange detected dot typed at position`,a))}}try{let e=this.platformProvider?.(fe(t));if(i&&a>=0){this.isDotCompletionMode=!0;let n=t.substring(0,a)+t.substring(a+1);if(V(`Compiling without typed dot at position`,a),r=this.tsrx.compile_to_volar_mappings(n,this.fileName,{loose:!0,platform:e}),V(`Compilation without dot successful`),r&&r.code&&r.mappings.length>0){let e=ge(r,a);e===null?H(`Failed to restore typed dot into transpiled output`):V(`Inserted typed dot at generated position`,e)}}else V(`Compiling TSRX code...`),r=this.tsrx.compile_to_volar_mappings(t,this.fileName,{loose:!0,platform:e}),V(`Compilation successful, generated code length:`,r?.code?.length||0)}catch(e){let t=e;U(`TSRX compilation failed for`,this.fileName,`:`,t),process.env.TSRX_TSC===`true`&&Y(this.fileName,[t]),t.type=`fatal`,this.fatalErrors.push(t)}if(r&&r.code){this.originalCode=t,this.generatedCode=r.code,this.mappings=r.mappings??[],this.usageErrors=r.errors,this.sourceAst=r.sourceAst,process.env.TSRX_TSC===`true`&&r.errors.length>0&&Y(this.fileName,r.errors);let e=r.cssMappings,n=r.scriptMappings??[];if(e.length>0||n.length>0){V(`Creating`,e.length,`CSS and`,n.length,`script embedded codes`);let t=[];for(let n of e)t.push(X(n,`css`));for(let e of n)t.push(X(e,`typescript`));this.embeddedCodes=t}else this.embeddedCodes=[];if(O){V(`CSS embedded codes:`,(this.embeddedCodes||[]).length),V(`Using transpiled code, mapping count:`,this.mappings.length),V(`Original code length:`,t.length),V(`Generated code length:`,this.generatedCode.length),V(`Last 100 chars of original:`,JSON.stringify(t.slice(-100))),V(`Last 200 chars of generated:`,JSON.stringify(this.generatedCode.slice(-200))),V(`Last few mappings:`);let e=Math.max(0,this.mappings.length-5);for(let t=e;t<this.mappings.length;t++){let e=this.mappings[t];V(` Mapping ${t}: source[${e.sourceOffsets[0]}:${e.sourceOffsets[0]+e.lengths[0]}] -> gen[${e.generatedOffsets[0]}:${e.generatedOffsets[0]+e.lengths[0]}], len=${e.lengths[0]}, completion=${e.data?.completion}`)}}this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}else V(`Compilation failed, only display where the compilation error occurred.`),this.originalCode=t,this.generatedCode=t,this.mappings=[{sourceOffsets:[0],generatedOffsets:[0],lengths:[t.length],generatedLengths:[t.length],data:{completion:!0,verification:!0,customData:{}}}],this.embeddedCodes=[...me(t),...he(t)],this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}#n(){if(!(this.#e||this.#t)){this.#e=new Map,this.#t=new Map;for(var e,t,n,r,i,a,o,s,c,l=0;l<this.mappings.length;l++)e=this.mappings[l],t=e.generatedOffsets[0],n=e.generatedLengths[0],r=t+n,i=`${t}-${r}`,this.#e.set(i,e),a=e.sourceOffsets[0],o=e.lengths[0],s=a+o,c=`${a}-${s}`,this.#t.set(c,e)}}findMappingByGeneratedRange(e,t){return this.#n(),this.#e.get(`${e}-${t}`)??null}findMappingBySourceRange(e,t){return this.#n(),this.#t.get(`${e}-${t}`)??null}findGeneratedRangeBySourceRange(e,t){let n=null,r=null;for(let i=0;i<this.mappings.length;i++){let a=this.mappings[i],o=a.sourceOffsets[0],s=o+a.lengths[0];s<=e||o>=t||((!n||o<n.sourceOffsets[0])&&(n=a),(!r||s>r.sourceOffsets[0]+r.lengths[0])&&(r=a))}if(!n||!r)return null;let i=n.generatedOffsets[0]+J(e-n.sourceOffsets[0],n.generatedLengths[0]),a=r.generatedOffsets[0]+J(t-r.sourceOffsets[0],r.generatedLengths[0]);return[i,Math.max(a,i+1)]}};function J(e,t){return Math.min(Math.max(e,0),t)}function Y(e,t){for(let n of t){let t=n&&typeof n==`object`&&`message`in n?String(n.message):String(n),r=`${e}\0${t}`;W.has(r)||(W.add(r),console.error(`[tsrx-tsc] ${e}: ${t}`))}}function me(e){let t=[],n=/<style\b((?:[^>"'{}/]|"[^"]*"|'[^']*'|\{(?:[^{}]|\{[^{}]*\})*\}|\/(?!>))*)>([\s\S]*?)<\/style>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(6+e.length+1),o=n.length,s=`style_${i}`;V(`Extracted CSS region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`css`)),i++}return t.length>0&&V(`Extracted ${t.length} CSS embedded codes from style tags`),t}function X(e,t){let n=e.data?.customData?.content??``;return{id:e.data?.customData?.embeddedId,languageId:t,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>e.lengths[0],getChangeRange:()=>void 0},mappings:[e],embeddedCodes:[]}}function he(e){let t=[],n=/<script\b((?:[^>"'/]|"[^"]*"|'[^']*'|\/(?!>))*)>([\s\S]*?)<\/script>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(7+e.length+1),o=n.length,s=`script_${i}`;V(`Extracted script region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`typescript`)),i++}return t.length>0&&V(`Extracted ${t.length} script embedded codes from script tags`),t}function ge(e,t){let n=null;for(let r of e.mappings)if(r.sourceOffsets[0]+r.lengths[0]===t){n=r;break}if(!n)return null;let r=n.generatedLengths[0],i=n.generatedOffsets[0]+r;e.code=e.code.substring(0,i)+`.`+e.code.substring(i);let a={sourceOffsets:[t],generatedOffsets:[i],lengths:[1],generatedLengths:[1],data:{...n.data}},o=e.mappings.indexOf(n);e.mappings.splice(o+1,0,a);for(let r of e.mappings)r!==n&&r!==a&&r.generatedOffsets[0]>=i&&(r.generatedOffsets[0]+=1),r!==n&&r!==a&&r.sourceOffsets[0]>=t&&(r.sourceOffsets[0]+=1);return i}const _e=new Map,Z=new Map;function ve(e){return typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`)}function Q(e,t=u.default.existsSync){let n=e,r=[];for(;n;){if(Z.has(n)){let e=Z.get(n)??null;for(let t of r)Z.set(t,e);return e}r.push(n);let e=d.default.join(n,`package.json`);if(t(e))try{let t=JSON.parse(u.default.readFileSync(e,`utf8`)),n=new Set([...Object.keys(t.dependencies??{}),...Object.keys(t.devDependencies??{}),...Object.keys(t.peerDependencies??{}),...Object.keys(t.optionalDependencies??{})]),i={name:typeof t.name==`string`?t.name:null,dependencies:n};for(let e of r)Z.set(e,i);return i}catch{for(let e of r)Z.set(e,null);return null}let i=d.default.dirname(n);if(i===n)break;n=i}for(let e of r)Z.set(e,null);return null}function $(e,t,n){if(!e)return!1;if(e.name===t||n.includes(e.name??``)||e.dependencies.has(t))return!0;for(let t of n)if(e.dependencies.has(t))return!0;return!1}function ye(e,t){let n=Se(e,t);if(n)return be(ce(n))}function be(e){return typeof e?.compile_to_volar_mappings!=`function`&&typeof e?.compileToVolarMappings==`function`?{...e,compile_to_volar_mappings:e.compileToVolarMappings}:e}function xe(e,t=u.default.existsSync,n=_e){let r=e.split(`/`),i=d.default.extname(e);for(let e=r.length-2;e>=0;e--){let a=r.slice(0,e+1).join(`/`),o=a+`\0`+i;if(!n.has(o)){let e=[];for(let[n,r,o,s,c=ue]of K)if(o.includes(i))for(let i of c){let o=[a,...r,...i].join(`/`);if(t(o)){e.push([n,o,s]);break}}let r=null;if(e.length>0){let n=Q(a,t);r=e.find(([e,,t])=>$(n,e,t))?.[1]??e[0][1],V(`Found tsrx compiler at:`,r,`for extension:`,i)}n.set(o,r)}let s=n.get(o);if(s)return s}}function Se(e,t){let n=d.default.extname(e),r=oe(e,t);if(r!==void 0)return r??void 0;let i=Q(d.default.dirname(e)),a=xe(e);if(a)return a;let o=`No supported tsrx compiler found in workspace for ${e}.`,s=le;for(;s;){let e=[];for(let[t,r,i,a,o=ue]of K){if(!i.includes(n))continue;let c=d.default.join(s,...r);for(let n of o){let r=d.default.join(c,...n);if(u.default.existsSync(r)){e.push([t,r,a]);break}}}if(e.length>0){let t=e.find(([e,,t])=>$(i,e,t))?.[1]??e[0][1];return H(`${o} Using packaged version at ${t}`),t}let t=d.default.dirname(s);if(t===s)break;s=t}}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return pe}});
|
|
11
|
-
//# sourceMappingURL=language-CofXAudP.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
diff --git a/dist/language-CofXAudP.js b/dist/language-CofXAudP.js
|
|
2
|
-
index 0d5504342813cd32b77bc834f9ed01bf6a353e3f..aff65966aba619c96f627474bb8e36c34d44f3e1 100644
|
|
3
|
-
--- a/dist/language-CofXAudP.js
|
|
4
|
-
+++ b/dist/language-CofXAudP.js
|
|
5
|
-
@@ -3,5 +3,5 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
6
|
-
`));return e?null:void 0}let u=D(o.layers,e=>ne(e.config));if(u.state===`invalid`)return j(`Invalid TSRX ${u.target} declaration:`,u.actual_type,u.actual_value,`in ${u.config_path}`),null;let f=o.extends_failures.filter(e=>u.state!==`declared`||!B(o.layers,e,u.config_path));if(f.length>0){for(let e of f){if(e.diagnostics.length===0){j(`Unable to resolve tsconfig extends entry:`,JSON.stringify(e.extends_value),`in ${e.config_path}`);continue}for(let t of e.diagnostics)j(`Unable to resolve tsconfig extends entry:`,JSON.stringify(e.extends_value),`in ${e.config_path}`,n.flattenDiagnosticMessageText(t.messageText,`
|
|
7
|
-
`))}return null}if(u.state===`declared`)return ae(n,r,u.config_path,u.value)}function se(e,t={}){let n=t.ts??l.default,r=t.configHost??n.sys,i=I(r),a=t.configFileName??R(d.default.dirname(e),r,i);if(a===null)return;let o=z(n,r,a,i);for(let e of o.dependencies)t.dependencies?.add(e);let s=o.layers.find(e=>e.raw_source===void 0);if(s){let e=`Unable to read tsconfig layer while resolving TSRX platform: ${s.path}`;throw j(e),Error(e)}let c=o.layers.filter(e=>e.parse_diagnostics.length>0);if(c.length>0){if(!o.layers.some(e=>E(e.config,[`tsrx`]).state===`found`?!0:e.parse_diagnostics.length>0&&e.raw_source!==void 0&&M.test(e.raw_source)))return;let e=c[0],t=n.flattenDiagnosticMessageText(e.parse_diagnostics[0].messageText,`
|
|
8
|
-
`),r=`Unable to parse tsconfig layer while resolving TSRX platform: ${e.path}: ${t}`;throw j(r),Error(r)}let u=D(o.layers,e=>re(e.config));if(u.state===`invalid`){let e=u.target===`platform`?` Expected "web", "ios", or "android".`:``,t=`Invalid TSRX ${u.target} declaration: ${u.actual_type} ${u.actual_value} in ${u.config_path}.${e}`;throw j(t),TypeError(t)}let f=o.extends_failures.filter(e=>u.state!==`declared`||!B(o.layers,e,u.config_path));if(f.length>0){if(!t.requirePlatformResolution)return u.state===`declared`?u.value:void 0;let e=f[0],r=e.diagnostics.length>0?`: ${n.flattenDiagnosticMessageText(e.diagnostics[0].messageText,`
|
|
9
|
-
-`)}`:``,i=`Unable to resolve tsconfig extends entry ${JSON.stringify(e.extends_value)} in ${e.config_path} while resolving TSRX platform${r}`;throw j(i),Error(i)}return u.state===`declared`?u.value:void 0}const ce=(0,f.createRequire)(require(`url`).pathToFileURL(__filename).href),le=d.default.dirname((0,p.fileURLToPath)(require(`url`).pathToFileURL(__filename).href)),{log:V,logWarning:H,logError:U}=k(`[TSRX Language]`),W=new Set,G=[`.tsrx`],K=[[`@tsrx/ripple`,[`node_modules`,`@tsrx`,`ripple`],[`.tsrx`],[`@tsrx/ripple`,`ripple`,`@ripple-ts/vite-plugin`]],[`@tsrx/react`,[`node_modules`,`@tsrx`,`react`],[`.tsrx`],[`@tsrx/react`,`@tsrx/vite-plugin-react`]],[`@tsrx/solid`,[`node_modules`,`@tsrx`,`solid`],[`.tsrx`],[`@tsrx/solid`,`@tsrx/vite-plugin-solid`]],[`@tsrx/preact`,[`node_modules`,`@tsrx`,`preact`],[`.tsrx`],[`@tsrx/preact`,`@tsrx/vite-plugin-preact`]],[`@tsrx/vue`,[`node_modules`,`@tsrx`,`vue`],[`.tsrx`],[`@tsrx/vue`,`@tsrx/vite-plugin-vue`]],[`@tsrx/hono`,[`node_modules`,`@tsrx`,`hono`],[`.tsrx`],[`@tsrx/hono`,`@tsrx/vite-plugin-hono`]],[`octane`,[`node_modules`,`octane`],[`.tsrx`],[`octane`,`@octanejs/vite-plugin`],[[`dist`,`compiler`,`volar.js`],[`src`,`compiler`,`volar.js`]]]],ue=[[`src`,`index.js`]];function de(e){return G.some(t=>e.endsWith(t))}function fe(e,t=l.default){let n=t.createScanner(t.ScriptTarget.Latest,!0,t.LanguageVariant.JSX,e),r=[];for(let e=n.scan();e!==t.SyntaxKind.EndOfFileToken;e=n.scan())r.push({kind:e,text:n.getTokenText()});let i=[`import`,`.`,`meta`,`.`,`env`,`.`,`platform`,`.`];for(let e=0;e+i.length<r.length;e+=1){if(e>0&&(r[e-1].kind===t.SyntaxKind.DotToken||r[e-1].kind===t.SyntaxKind.QuestionDotToken)||!i.every((t,n)=>r[e+n].text===t))continue;let n=r[e+i.length].text;if(n===`web`||n===`ios`||n===`android`)return!0}return!1}function pe(e={}){V(`Creating TSRX language plugin...`);let t=e.ts??l.default,n={...e,ts:t,configHost:e.configHost??t.sys};return{getLanguageId(e){let t=typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`);if(de(t))return V(`Identified TSRX file:`,t),`tsrx`},createVirtualCode(e,t,r){if(t===`tsrx`){let t=ve(e),i=ye(t,n);if(!i){U(`TSRX compiler not found for file: ${t}`);return}V(`Creating virtual code for:`,t);try{return new q(t,r,i,e=>se(t,{...n,requirePlatformResolution:e}))}catch(e){throw U(`Failed to create virtual code for:`,t,`:`,e),e}}},updateVirtualCode(e,t,n){if(t instanceof q)return V(`Updating existing virtual code for:`,t.fileName),t.update(n),t},typescript:{extraFileExtensions:G.map(e=>({extension:e.slice(1),isMixedContent:!1,scriptKind:7})),getServiceScript(e){for(let t of(0,w.forEachEmbeddedCode)(e))if(t.languageId===`tsrx`)return{code:t,extension:`.tsx`,scriptKind:4}},...process.env.TSRX_TSC===`true`?null:{getExtraServiceScripts(e,t){let n=[];for(let r of(0,w.forEachEmbeddedCode)(t))r.languageId===`typescript`&&n.push({fileName:`${e}.${r.id}.ts`,code:r,extension:`.ts`,scriptKind:l.default.ScriptKind.TS});return n}}}}}var q=class{id=`root`;languageId=`tsrx`;codegenStacks=[];tsrx;platformProvider;generatedCode=``;embeddedCodes=[];mappings=[];fatalErrors=[];usageErrors=[];snapshot;sourceSnapshot;originalCode=``;sourceAst=null;isDotCompletionMode=!1;diagnostics=[];#e=null;#t=null;constructor(e,t,n,r){if(V(`Initializing TSRXVirtualCode for:`,e),this.fileName=e,this.tsrx=n,this.platformProvider=r,this.snapshot=t,this.sourceSnapshot=t,this.originalCode=t.getText(0,t.getLength()),!n||typeof n.compile_to_volar_mappings!=`function`)throw U(`Invalid TSRX compiler - missing compile_to_volar_mappings method`),Error(`Invalid TSRX compiler`);this.update(t)}update(e){V(`Updating virtual code for:`,this.fileName);let t=e.getText(0,e.getLength()),n=e.getChangeRange(this.sourceSnapshot);this.sourceSnapshot=e,this.#e=null,this.#t=null,this.fatalErrors=[],this.usageErrors=[],this.sourceAst=null,this.isDotCompletionMode=!1;let r,i=!1,a=-1;if(V(`changeRange:`,JSON.stringify(n)),n){let e=n.span.start,r=e+n.span.length,o=e+n.newLength,s=this.originalCode.substring(e,r),c=t.substring(e,o);if(V(`Change details:`),V(` Position:`,e,`-`,r,`(length:`,n.span.length,`)`),V(` Old text:`,JSON.stringify(s)),V(` New text:`,JSON.stringify(c),`(length:`,n.newLength,`)`),c.endsWith(`.`)){let e=o>1?t[o-2]:``;V(` Char before dot:`,JSON.stringify(e)),/[$#_\u200C\u200D\p{ID_Continue}\)\]\}]/u.test(e)&&(i=!0,a=o-1,V(`ChangeRange detected dot typed at position`,a))}}try{let e=this.platformProvider?.(fe(t));if(i&&a>=0){this.isDotCompletionMode=!0;let n=t.substring(0,a)+t.substring(a+1);if(V(`Compiling without typed dot at position`,a),r=this.tsrx.compile_to_volar_mappings(n,this.fileName,{loose:!0,platform:e}),V(`Compilation without dot successful`),r&&r.code&&r.mappings.length>0){let e=ge(r,a);e===null?H(`Failed to restore typed dot into transpiled output`):V(`Inserted typed dot at generated position`,e)}}else V(`Compiling TSRX code...`),r=this.tsrx.compile_to_volar_mappings(t,this.fileName,{loose:!0,platform:e}),V(`Compilation successful, generated code length:`,r?.code?.length||0)}catch(e){let t=e;U(`TSRX compilation failed for`,this.fileName,`:`,t),process.env.TSRX_TSC===`true`&&Y(this.fileName,[t]),t.type=`fatal`,this.fatalErrors.push(t)}if(r&&r.code){this.originalCode=t,this.generatedCode=r.code,this.mappings=r.mappings??[],this.usageErrors=r.errors,this.sourceAst=r.sourceAst,process.env.TSRX_TSC===`true`&&r.errors.length>0&&Y(this.fileName,r.errors);let e=r.cssMappings,n=r.scriptMappings??[];if(e.length>0||n.length>0){V(`Creating`,e.length,`CSS and`,n.length,`script embedded codes`);let t=[];for(let n of e)t.push(X(n,`css`));for(let e of n)t.push(X(e,`typescript`));this.embeddedCodes=t}else this.embeddedCodes=[];if(O){V(`CSS embedded codes:`,(this.embeddedCodes||[]).length),V(`Using transpiled code, mapping count:`,this.mappings.length),V(`Original code length:`,t.length),V(`Generated code length:`,this.generatedCode.length),V(`Last 100 chars of original:`,JSON.stringify(t.slice(-100))),V(`Last 200 chars of generated:`,JSON.stringify(this.generatedCode.slice(-200))),V(`Last few mappings:`);let e=Math.max(0,this.mappings.length-5);for(let t=e;t<this.mappings.length;t++){let e=this.mappings[t];V(` Mapping ${t}: source[${e.sourceOffsets[0]}:${e.sourceOffsets[0]+e.lengths[0]}] -> gen[${e.generatedOffsets[0]}:${e.generatedOffsets[0]+e.lengths[0]}], len=${e.lengths[0]}, completion=${e.data?.completion}`)}}this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}else V(`Compilation failed, only display where the compilation error occurred.`),this.originalCode=t,this.generatedCode=t,this.mappings=[{sourceOffsets:[0],generatedOffsets:[0],lengths:[t.length],generatedLengths:[t.length],data:{completion:!0,verification:!0,customData:{}}}],this.embeddedCodes=[...me(t),...he(t)],this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}#n(){if(!(this.#e||this.#t)){this.#e=new Map,this.#t=new Map;for(var e,t,n,r,i,a,o,s,c,l=0;l<this.mappings.length;l++)e=this.mappings[l],t=e.generatedOffsets[0],n=e.generatedLengths[0],r=t+n,i=`${t}-${r}`,this.#e.set(i,e),a=e.sourceOffsets[0],o=e.lengths[0],s=a+o,c=`${a}-${s}`,this.#t.set(c,e)}}findMappingByGeneratedRange(e,t){return this.#n(),this.#e.get(`${e}-${t}`)??null}findMappingBySourceRange(e,t){return this.#n(),this.#t.get(`${e}-${t}`)??null}findGeneratedRangeBySourceRange(e,t){let n=null,r=null;for(let i=0;i<this.mappings.length;i++){let a=this.mappings[i],o=a.sourceOffsets[0],s=o+a.lengths[0];s<=e||o>=t||((!n||o<n.sourceOffsets[0])&&(n=a),(!r||s>r.sourceOffsets[0]+r.lengths[0])&&(r=a))}if(!n||!r)return null;let i=n.generatedOffsets[0]+J(e-n.sourceOffsets[0],n.generatedLengths[0]),a=r.generatedOffsets[0]+J(t-r.sourceOffsets[0],r.generatedLengths[0]);return[i,Math.max(a,i+1)]}};function J(e,t){return Math.min(Math.max(e,0),t)}function Y(e,t){for(let n of t){let t=n&&typeof n==`object`&&`message`in n?String(n.message):String(n),r=`${e}\0${t}`;W.has(r)||(W.add(r),console.error(`[tsrx-tsc] ${e}: ${t}`))}}function me(e){let t=[],n=/<style\b((?:[^>"'{}/]|"[^"]*"|'[^']*'|\{(?:[^{}]|\{[^{}]*\})*\}|\/(?!>))*)>([\s\S]*?)<\/style>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(6+e.length+1),o=n.length,s=`style_${i}`;V(`Extracted CSS region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`css`)),i++}return t.length>0&&V(`Extracted ${t.length} CSS embedded codes from style tags`),t}function X(e,t){let n=e.data?.customData?.content??``;return{id:e.data?.customData?.embeddedId,languageId:t,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>e.lengths[0],getChangeRange:()=>void 0},mappings:[e],embeddedCodes:[]}}function he(e){let t=[],n=/<script\b((?:[^>"'/]|"[^"]*"|'[^']*'|\/(?!>))*)>([\s\S]*?)<\/script>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(7+e.length+1),o=n.length,s=`script_${i}`;V(`Extracted script region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`typescript`)),i++}return t.length>0&&V(`Extracted ${t.length} script embedded codes from script tags`),t}function ge(e,t){let n=null;for(let r of e.mappings)if(r.sourceOffsets[0]+r.lengths[0]===t){n=r;break}if(!n)return null;let r=n.generatedLengths[0],i=n.generatedOffsets[0]+r;e.code=e.code.substring(0,i)+`.`+e.code.substring(i);let a={sourceOffsets:[t],generatedOffsets:[i],lengths:[1],generatedLengths:[1],data:{...n.data}},o=e.mappings.indexOf(n);e.mappings.splice(o+1,0,a);for(let r of e.mappings)r!==n&&r!==a&&r.generatedOffsets[0]>=i&&(r.generatedOffsets[0]+=1),r!==n&&r!==a&&r.sourceOffsets[0]>=t&&(r.sourceOffsets[0]+=1);return i}const _e=new Map,Z=new Map;function ve(e){return typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`)}function Q(e,t=u.default.existsSync){let n=e,r=[];for(;n;){if(Z.has(n)){let e=Z.get(n)??null;for(let t of r)Z.set(t,e);return e}r.push(n);let e=d.default.join(n,`package.json`);if(t(e))try{let t=JSON.parse(u.default.readFileSync(e,`utf8`)),n=new Set([...Object.keys(t.dependencies??{}),...Object.keys(t.devDependencies??{}),...Object.keys(t.peerDependencies??{}),...Object.keys(t.optionalDependencies??{})]),i={name:typeof t.name==`string`?t.name:null,dependencies:n};for(let e of r)Z.set(e,i);return i}catch{for(let e of r)Z.set(e,null);return null}let i=d.default.dirname(n);if(i===n)break;n=i}for(let e of r)Z.set(e,null);return null}function $(e,t,n){if(!e)return!1;if(e.name===t||n.includes(e.name??``)||e.dependencies.has(t))return!0;for(let t of n)if(e.dependencies.has(t))return!0;return!1}function ye(e,t){let n=Se(e,t);if(n)return be(ce(n))}function be(e){return typeof e?.compile_to_volar_mappings!=`function`&&typeof e?.compileToVolarMappings==`function`?{...e,compile_to_volar_mappings:e.compileToVolarMappings}:e}function xe(e,t=u.default.existsSync,n=_e){let r=e.split(`/`),i=d.default.extname(e);for(let e=r.length-2;e>=0;e--){let a=r.slice(0,e+1).join(`/`),o=a+`\0`+i;if(!n.has(o)){let e=[];for(let[n,r,o,s,c=ue]of K)if(o.includes(i))for(let i of c){let o=[a,...r,...i].join(`/`);if(t(o)){e.push([n,o,s]);break}}let r=null;if(e.length>0){let n=Q(a,t);r=e.find(([e,,t])=>$(n,e,t))?.[1]??e[0][1],V(`Found tsrx compiler at:`,r,`for extension:`,i)}n.set(o,r)}let s=n.get(o);if(s)return s}}function Se(e,t){let n=d.default.extname(e),r=oe(e,t);if(r!==void 0)return r??void 0;let i=Q(d.default.dirname(e)),a=xe(e);if(a)return a;let o=`No supported tsrx compiler found in workspace for ${e}.`,s=le;for(;s;){let e=[];for(let[t,r,i,a,o=ue]of K){if(!i.includes(n))continue;let c=d.default.join(s,...r);for(let n of o){let r=d.default.join(c,...n);if(u.default.existsSync(r)){e.push([t,r,a]);break}}}if(e.length>0){let t=e.find(([e,,t])=>$(i,e,t))?.[1]??e[0][1];return H(`${o} Using packaged version at ${t}`),t}let t=d.default.dirname(s);if(t===s)break;s=t}}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return pe}});
|
|
10
|
-
+`)}`:``,i=`Unable to resolve tsconfig extends entry ${JSON.stringify(e.extends_value)} in ${e.config_path} while resolving TSRX platform${r}`;throw j(i),Error(i)}return u.state===`declared`?u.value:void 0}const ce=(0,f.createRequire)(require(`url`).pathToFileURL(__filename).href),le=d.default.dirname((0,p.fileURLToPath)(require(`url`).pathToFileURL(__filename).href)),{log:V,logWarning:H,logError:U}=k(`[TSRX Language]`),W=new Set,G=[`.tsrx`],K=[[`@tsrx/ripple`,[`node_modules`,`@tsrx`,`ripple`],[`.tsrx`],[`@tsrx/ripple`,`ripple`,`@ripple-ts/vite-plugin`]],[`@tsrx/react`,[`node_modules`,`@tsrx`,`react`],[`.tsrx`],[`@tsrx/react`,`@tsrx/vite-plugin-react`]],[`@tsrx/solid`,[`node_modules`,`@tsrx`,`solid`],[`.tsrx`],[`@tsrx/solid`,`@tsrx/vite-plugin-solid`]],[`@tsrx/preact`,[`node_modules`,`@tsrx`,`preact`],[`.tsrx`],[`@tsrx/preact`,`@tsrx/vite-plugin-preact`]],[`@tsrx/vue`,[`node_modules`,`@tsrx`,`vue`],[`.tsrx`],[`@tsrx/vue`,`@tsrx/vite-plugin-vue`]],[`@tsrx/hono`,[`node_modules`,`@tsrx`,`hono`],[`.tsrx`],[`@tsrx/hono`,`@tsrx/vite-plugin-hono`]],[`octane`,[`node_modules`,`octane`],[`.tsrx`],[`octane`,`@octanejs/vite-plugin`],[[`dist`,`compiler`,`volar.js`],[`src`,`compiler`,`volar.js`]]]],ue=[[`src`,`index.js`]];function de(e){return G.some(t=>e.endsWith(t))}function fe(e,t=l.default){let n=t.createScanner(t.ScriptTarget.Latest,!0,t.LanguageVariant.JSX,e),r=[];for(let e=n.scan();e!==t.SyntaxKind.EndOfFileToken;e=n.scan())r.push({kind:e,text:n.getTokenText()});let i=[`import`,`.`,`meta`,`.`,`env`,`.`,`platform`,`.`];for(let e=0;e+i.length<r.length;e+=1){if(e>0&&(r[e-1].kind===t.SyntaxKind.DotToken||r[e-1].kind===t.SyntaxKind.QuestionDotToken)||!i.every((t,n)=>r[e+n].text===t))continue;let n=r[e+i.length].text;if(n===`web`||n===`ios`||n===`android`)return!0}return!1}function pe(e={}){V(`Creating TSRX language plugin...`);let t=e.ts??l.default,n={...e,ts:t,configHost:e.configHost??t.sys};return{getLanguageId(e){let t=typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`);if(de(t))return V(`Identified TSRX file:`,t),`tsrx`},createVirtualCode(e,t,r){if(t===`tsrx`){let t=ve(e),i=ye(t,n);if(!i){U(`TSRX compiler not found for file: ${t}`);return}V(`Creating virtual code for:`,t);try{return new q(t,r,i,e=>se(t,{...n,requirePlatformResolution:e}))}catch(e){throw U(`Failed to create virtual code for:`,t,`:`,e),e}}},updateVirtualCode(e,t,n){if(t instanceof q)return V(`Updating existing virtual code for:`,t.fileName),t.update(n),t},typescript:{resolveHiddenExtensions:!0,extraFileExtensions:G.map(e=>({extension:e.slice(1),isMixedContent:!1,scriptKind:7})),getServiceScript(e){for(let t of(0,w.forEachEmbeddedCode)(e))if(t.languageId===`tsrx`)return{code:t,extension:`.tsx`,scriptKind:4}},...process.env.TSRX_TSC===`true`?null:{getExtraServiceScripts(e,t){let n=[];for(let r of(0,w.forEachEmbeddedCode)(t))r.languageId===`typescript`&&n.push({fileName:`${e}.${r.id}.ts`,code:r,extension:`.ts`,scriptKind:l.default.ScriptKind.TS});return n}}}}}var q=class{id=`root`;languageId=`tsrx`;codegenStacks=[];tsrx;platformProvider;generatedCode=``;embeddedCodes=[];mappings=[];fatalErrors=[];usageErrors=[];snapshot;sourceSnapshot;originalCode=``;sourceAst=null;isDotCompletionMode=!1;diagnostics=[];#e=null;#t=null;constructor(e,t,n,r){if(V(`Initializing TSRXVirtualCode for:`,e),this.fileName=e,this.tsrx=n,this.platformProvider=r,this.snapshot=t,this.sourceSnapshot=t,this.originalCode=t.getText(0,t.getLength()),!n||typeof n.compile_to_volar_mappings!=`function`)throw U(`Invalid TSRX compiler - missing compile_to_volar_mappings method`),Error(`Invalid TSRX compiler`);this.update(t)}update(e){V(`Updating virtual code for:`,this.fileName);let t=e.getText(0,e.getLength()),n=e.getChangeRange(this.sourceSnapshot);this.sourceSnapshot=e,this.#e=null,this.#t=null,this.fatalErrors=[],this.usageErrors=[],this.sourceAst=null,this.isDotCompletionMode=!1;let r,i=!1,a=-1;if(V(`changeRange:`,JSON.stringify(n)),n){let e=n.span.start,r=e+n.span.length,o=e+n.newLength,s=this.originalCode.substring(e,r),c=t.substring(e,o);if(V(`Change details:`),V(` Position:`,e,`-`,r,`(length:`,n.span.length,`)`),V(` Old text:`,JSON.stringify(s)),V(` New text:`,JSON.stringify(c),`(length:`,n.newLength,`)`),c.endsWith(`.`)){let e=o>1?t[o-2]:``;V(` Char before dot:`,JSON.stringify(e)),/[$#_\u200C\u200D\p{ID_Continue}\)\]\}]/u.test(e)&&(i=!0,a=o-1,V(`ChangeRange detected dot typed at position`,a))}}try{let e=this.platformProvider?.(fe(t));if(i&&a>=0){this.isDotCompletionMode=!0;let n=t.substring(0,a)+t.substring(a+1);if(V(`Compiling without typed dot at position`,a),r=this.tsrx.compile_to_volar_mappings(n,this.fileName,{loose:!0,platform:e}),V(`Compilation without dot successful`),r&&r.code&&r.mappings.length>0){let e=ge(r,a);e===null?H(`Failed to restore typed dot into transpiled output`):V(`Inserted typed dot at generated position`,e)}}else V(`Compiling TSRX code...`),r=this.tsrx.compile_to_volar_mappings(t,this.fileName,{loose:!0,platform:e}),V(`Compilation successful, generated code length:`,r?.code?.length||0)}catch(e){let t=e;U(`TSRX compilation failed for`,this.fileName,`:`,t),process.env.TSRX_TSC===`true`&&Y(this.fileName,[t]),t.type=`fatal`,this.fatalErrors.push(t)}if(r&&r.code){this.originalCode=t,this.generatedCode=r.code,this.mappings=r.mappings??[],this.usageErrors=r.errors,this.sourceAst=r.sourceAst,process.env.TSRX_TSC===`true`&&r.errors.length>0&&Y(this.fileName,r.errors);let e=r.cssMappings,n=r.scriptMappings??[];if(e.length>0||n.length>0){V(`Creating`,e.length,`CSS and`,n.length,`script embedded codes`);let t=[];for(let n of e)t.push(X(n,`css`));for(let e of n)t.push(X(e,`typescript`));this.embeddedCodes=t}else this.embeddedCodes=[];if(O){V(`CSS embedded codes:`,(this.embeddedCodes||[]).length),V(`Using transpiled code, mapping count:`,this.mappings.length),V(`Original code length:`,t.length),V(`Generated code length:`,this.generatedCode.length),V(`Last 100 chars of original:`,JSON.stringify(t.slice(-100))),V(`Last 200 chars of generated:`,JSON.stringify(this.generatedCode.slice(-200))),V(`Last few mappings:`);let e=Math.max(0,this.mappings.length-5);for(let t=e;t<this.mappings.length;t++){let e=this.mappings[t];V(` Mapping ${t}: source[${e.sourceOffsets[0]}:${e.sourceOffsets[0]+e.lengths[0]}] -> gen[${e.generatedOffsets[0]}:${e.generatedOffsets[0]+e.lengths[0]}], len=${e.lengths[0]}, completion=${e.data?.completion}`)}}this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}else V(`Compilation failed, only display where the compilation error occurred.`),this.originalCode=t,this.generatedCode=t,this.mappings=[{sourceOffsets:[0],generatedOffsets:[0],lengths:[t.length],generatedLengths:[t.length],data:{completion:!0,verification:!0,customData:{}}}],this.embeddedCodes=[...me(t),...he(t)],this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}#n(){if(!(this.#e||this.#t)){this.#e=new Map,this.#t=new Map;for(var e,t,n,r,i,a,o,s,c,l=0;l<this.mappings.length;l++)e=this.mappings[l],t=e.generatedOffsets[0],n=e.generatedLengths[0],r=t+n,i=`${t}-${r}`,this.#e.set(i,e),a=e.sourceOffsets[0],o=e.lengths[0],s=a+o,c=`${a}-${s}`,this.#t.set(c,e)}}findMappingByGeneratedRange(e,t){return this.#n(),this.#e.get(`${e}-${t}`)??null}findMappingBySourceRange(e,t){return this.#n(),this.#t.get(`${e}-${t}`)??null}findGeneratedRangeBySourceRange(e,t){let n=null,r=null;for(let i=0;i<this.mappings.length;i++){let a=this.mappings[i],o=a.sourceOffsets[0],s=o+a.lengths[0];s<=e||o>=t||((!n||o<n.sourceOffsets[0])&&(n=a),(!r||s>r.sourceOffsets[0]+r.lengths[0])&&(r=a))}if(!n||!r)return null;let i=n.generatedOffsets[0]+J(e-n.sourceOffsets[0],n.generatedLengths[0]),a=r.generatedOffsets[0]+J(t-r.sourceOffsets[0],r.generatedLengths[0]);return[i,Math.max(a,i+1)]}};function J(e,t){return Math.min(Math.max(e,0),t)}function Y(e,t){for(let n of t){let t=n&&typeof n==`object`&&`message`in n?String(n.message):String(n),r=`${e}\0${t}`;W.has(r)||(W.add(r),console.error(`[tsrx-tsc] ${e}: ${t}`))}}function me(e){let t=[],n=/<style\b((?:[^>"'{}/]|"[^"]*"|'[^']*'|\{(?:[^{}]|\{[^{}]*\})*\}|\/(?!>))*)>([\s\S]*?)<\/style>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(6+e.length+1),o=n.length,s=`style_${i}`;V(`Extracted CSS region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`css`)),i++}return t.length>0&&V(`Extracted ${t.length} CSS embedded codes from style tags`),t}function X(e,t){let n=e.data?.customData?.content??``;return{id:e.data?.customData?.embeddedId,languageId:t,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>e.lengths[0],getChangeRange:()=>void 0},mappings:[e],embeddedCodes:[]}}function he(e){let t=[],n=/<script\b((?:[^>"'/]|"[^"]*"|'[^']*'|\/(?!>))*)>([\s\S]*?)<\/script>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[1],n=r[2],a=r.index+(7+e.length+1),o=n.length,s=`script_${i}`;V(`Extracted script region ${i}: offset ${a}, length ${o}`);let c={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:s}}};t.push(X(c,`typescript`)),i++}return t.length>0&&V(`Extracted ${t.length} script embedded codes from script tags`),t}function ge(e,t){let n=null;for(let r of e.mappings)if(r.sourceOffsets[0]+r.lengths[0]===t){n=r;break}if(!n)return null;let r=n.generatedLengths[0],i=n.generatedOffsets[0]+r;e.code=e.code.substring(0,i)+`.`+e.code.substring(i);let a={sourceOffsets:[t],generatedOffsets:[i],lengths:[1],generatedLengths:[1],data:{...n.data}},o=e.mappings.indexOf(n);e.mappings.splice(o+1,0,a);for(let r of e.mappings)r!==n&&r!==a&&r.generatedOffsets[0]>=i&&(r.generatedOffsets[0]+=1),r!==n&&r!==a&&r.sourceOffsets[0]>=t&&(r.sourceOffsets[0]+=1);return i}const _e=new Map,Z=new Map;function ve(e){return typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`)}function Q(e,t=u.default.existsSync){let n=e,r=[];for(;n;){if(Z.has(n)){let e=Z.get(n)??null;for(let t of r)Z.set(t,e);return e}r.push(n);let e=d.default.join(n,`package.json`);if(t(e))try{let t=JSON.parse(u.default.readFileSync(e,`utf8`)),n=new Set([...Object.keys(t.dependencies??{}),...Object.keys(t.devDependencies??{}),...Object.keys(t.peerDependencies??{}),...Object.keys(t.optionalDependencies??{})]),i={name:typeof t.name==`string`?t.name:null,dependencies:n};for(let e of r)Z.set(e,i);return i}catch{for(let e of r)Z.set(e,null);return null}let i=d.default.dirname(n);if(i===n)break;n=i}for(let e of r)Z.set(e,null);return null}function $(e,t,n){if(!e)return!1;if(e.name===t||n.includes(e.name??``)||e.dependencies.has(t))return!0;for(let t of n)if(e.dependencies.has(t))return!0;return!1}function ye(e,t){let n=Se(e,t);if(n)return be(ce(n))}function be(e){return typeof e?.compile_to_volar_mappings!=`function`&&typeof e?.compileToVolarMappings==`function`?{...e,compile_to_volar_mappings:e.compileToVolarMappings}:e}function xe(e,t=u.default.existsSync,n=_e){let r=e.split(`/`),i=d.default.extname(e);for(let e=r.length-2;e>=0;e--){let a=r.slice(0,e+1).join(`/`),o=a+`\0`+i;if(!n.has(o)){let e=[];for(let[n,r,o,s,c=ue]of K)if(o.includes(i))for(let i of c){let o=[a,...r,...i].join(`/`);if(t(o)){e.push([n,o,s]);break}}let r=null;if(e.length>0){let n=Q(a,t);r=e.find(([e,,t])=>$(n,e,t))?.[1]??e[0][1],V(`Found tsrx compiler at:`,r,`for extension:`,i)}n.set(o,r)}let s=n.get(o);if(s)return s}}function Se(e,t){let n=d.default.extname(e),r=oe(e,t);if(r!==void 0)return r??void 0;let i=Q(d.default.dirname(e)),a=xe(e);if(a)return a;let o=`No supported tsrx compiler found in workspace for ${e}.`,s=le;for(;s;){let e=[];for(let[t,r,i,a,o=ue]of K){if(!i.includes(n))continue;let c=d.default.join(s,...r);for(let n of o){let r=d.default.join(c,...n);if(u.default.existsSync(r)){e.push([t,r,a]);break}}}if(e.length>0){let t=e.find(([e,,t])=>$(i,e,t))?.[1]??e[0][1];return H(`${o} Using packaged version at ${t}`),t}let t=d.default.dirname(s);if(t===s)break;s=t}}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return pe}});
|
|
11
|
-
//# sourceMappingURL=language-CofXAudP.js.map
|
/package/library-template/patches/{@octanejs__tiptap@0.0.61.patch → @octanejs__tiptap@0.0.62.patch}
RENAMED
|
File without changes
|
|
File without changes
|