tscircuit 0.0.1077 → 0.0.1078-libonly
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/browser.min.js +2 -2
- package/dist/webworker.min.js +1 -1
- package/package.json +4 -10
- package/cli.mjs +0 -14
package/dist/webworker.min.js
CHANGED
|
@@ -606,7 +606,7 @@ ${spiceString}`)}catch(error){debug10(`Failed to convert circuit JSON to SPICE:
|
|
|
606
606
|
${Object.keys(fsMapOrAllFilePaths).join(", ")}`);return resolvedFilePath};var stripComments=code=>{let out="",i3=0,inSingle=!1,inDouble=!1,inTemplate=!1;for(;i3<code.length;){let ch2=code[i3],next2=code[i3+1];if(!inDouble&&!inTemplate&&ch2==="'"&&code[i3-1]!=="\\"){inSingle=!inSingle,out+=ch2,i3++;continue}if(!inSingle&&!inTemplate&&ch2==='"'&&code[i3-1]!=="\\"){inDouble=!inDouble,out+=ch2,i3++;continue}if(!inSingle&&!inDouble&&ch2==="`"&&code[i3-1]!=="\\"){inTemplate=!inTemplate,out+=ch2,i3++;continue}if(!inSingle&&!inDouble&&!inTemplate){if(ch2==="/"&&next2==="/"){for(out+=" ",i3+=2;i3<code.length&&code[i3]!==`
|
|
607
607
|
`;)out+=" ",i3++;continue}if(ch2==="/"&&next2==="*"){for(out+=" ",i3+=2;i3<code.length;){if(code[i3]===`
|
|
608
608
|
`?out+=`
|
|
609
|
-
`:out+=" ",code[i3]==="*"&&code[i3+1]==="/"){out+=" ",i3+=2;break}i3++}continue}}out+=ch2,i3++}return out};var getImportsFromCode=code=>{let strippedCode=stripComments(code),importRegex
|
|
609
|
+
`:out+=" ",code[i3]==="*"&&code[i3+1]==="/"){out+=" ",i3+=2;break}i3++}continue}}out+=ch2,i3++}return out};var getImportsFromCode=code=>{let strippedCode=stripComments(code),importRegex=/(?:^|;)\s*import\s*(?:(?:[\w]+\s*,\s*)?(?:\*\s+as\s+[\w]+|\{[^}]+\}|[\w]+)\s*from\s*)?['"]([^'"]+)['"]/gm,imports=[],match2;for(;(match2=importRegex.exec(strippedCode))!==null;){let fullMatch=match2[0];/\bimport\s+type\b/.test(fullMatch)||imports.push(match2[1])}let reExportRegex=/^\s*export\s+(?:type\s+)?(?:\*\s+as\s+[\w$]+|\*|\{[^}]+\})\s+from\s*['"](.+?)['"]/gm,reExportMatch;for(;(reExportMatch=reExportRegex.exec(strippedCode))!==null;){let fullMatch=reExportMatch[0];/^\s*export\s+type\b/.test(fullMatch)||imports.push(reExportMatch[1])}return imports};function createContext(modulePath,fsMap,basePath){return{fsMap,extensions:[".js",".jsx",".ts",".tsx",".json"],basePath,modulePath}}function findPackageJson(nodeModulesPath,ctx){let packageJsonPath=`${nodeModulesPath}/package.json`;if(!ctx.fsMap[packageJsonPath])return null;try{return JSON.parse(ctx.fsMap[packageJsonPath])}catch{return null}}function tryResolveWithExtensions(path,ctx){if(ctx.fsMap[path])return path;for(let ext of ctx.extensions){let pathWithExt=path.replace(/\.js$|\.jsx$/,"")+ext;if(ctx.fsMap[pathWithExt])return pathWithExt}return null}function resolveExportPath(nodeModulesPath,exportPath,ctx){let fullExportPath=`${nodeModulesPath}/${exportPath.replace(/^\.\//,"")}`;return tryResolveWithExtensions(fullExportPath,ctx)}function resolveConditionalExport(exportValue){if(typeof exportValue=="string")return exportValue;let conditions=["import","default","require","node","browser"];for(let condition of conditions)if(exportValue[condition]){let conditionValue=exportValue[condition];if(typeof conditionValue=="string")return conditionValue;let resolved=resolveConditionalExport(conditionValue);if(resolved)return resolved}return null}function resolvePackageExports(nodeModulesPath,packageJson,remainingPath,ctx){if(!packageJson.exports)return null;let defaultExport=packageJson.exports["."];if(remainingPath===""&&defaultExport){let exportPath=resolveConditionalExport(defaultExport);if(exportPath){let resolved=resolveExportPath(nodeModulesPath,exportPath,ctx);if(resolved)return resolved}}let subpathExport=remainingPath?packageJson.exports[`./${remainingPath}`]:null;if(subpathExport){let exportPath=resolveConditionalExport(subpathExport);if(exportPath){let resolved=resolveExportPath(nodeModulesPath,exportPath,ctx);if(resolved)return resolved}}let importExport=packageJson.exports.import;if(remainingPath===""&&importExport!==void 0){let exportPath=resolveConditionalExport(importExport);if(exportPath){let resolved=resolveExportPath(nodeModulesPath,exportPath,ctx);if(resolved)return resolved}}return null}function resolvePackageEntryPoint(nodeModulesPath,packageJson,ctx){let entryPoint=packageJson.module||packageJson.main||"index.js",fullPath=`${nodeModulesPath}/${entryPoint}`;return tryResolveWithExtensions(fullPath,ctx)}function resolveRemainingPath(nodeModulesPath,remainingPath,ctx){if(!remainingPath){for(let ext of ctx.extensions){let indexPath=`${nodeModulesPath}/index${ext}`;if(ctx.fsMap[indexPath])return indexPath}return null}let fullPath=`${nodeModulesPath}/${remainingPath}`,directMatch=tryResolveWithExtensions(fullPath,ctx);if(directMatch)return directMatch;for(let ext of ctx.extensions){let indexPath=`${fullPath}/index${ext}`;if(ctx.fsMap[indexPath])return indexPath}return null}function resolveNodeModuleInPath(searchPath,ctx){let moduleParts=ctx.modulePath.split("/"),scope=moduleParts[0].startsWith("@")?moduleParts.slice(0,2).join("/"):moduleParts[0],remainingPath=moduleParts.slice(scope.includes("/")?2:1).join("/"),nodeModulesPath=`${searchPath==="."?"":`${searchPath}/`}node_modules/${scope}`,packageJson=findPackageJson(nodeModulesPath,ctx);if(packageJson){let exportsResolution=resolvePackageExports(nodeModulesPath,packageJson,remainingPath,ctx);if(exportsResolution)return exportsResolution;let entryPointResolution=resolvePackageEntryPoint(nodeModulesPath,packageJson,ctx);if(entryPointResolution)return entryPointResolution}let remainingPathResolution=resolveRemainingPath(nodeModulesPath,remainingPath,ctx);if(remainingPathResolution)return remainingPathResolution;let parentPath=dirname(searchPath);return parentPath&&parentPath!==searchPath?resolveNodeModuleInPath(parentPath,ctx):null}function resolveNodeModule(modulePath,fsMap,basePath){let ctx=createContext(modulePath,fsMap,basePath);return resolveNodeModuleInPath(ctx.basePath,ctx)}function evalCompiledJs(compiledCode,preSuppliedImports,cwd){globalThis.__tscircuit_require=name=>{let resolvedFilePath=resolveFilePath(name,preSuppliedImports,cwd);!resolvedFilePath&&!name.startsWith(".")&&!name.startsWith("/")&&(resolvedFilePath=resolveNodeModule(name,preSuppliedImports,cwd||""));let hasResolvedFilePath=resolvedFilePath&&preSuppliedImports[resolvedFilePath];if(!preSuppliedImports[name]&&!hasResolvedFilePath)throw new Error(`Import "${name}" not found ${cwd?`in "${cwd}"`:""}`);let mod=preSuppliedImports[name]||preSuppliedImports[resolvedFilePath];return new Proxy(mod,{get(target,prop){if(!(prop in target)){if(prop==="default")return target.default!==void 0?target.default:target.__esModule?void 0:typeof target=="function"||typeof target=="object"?target:void 0;if(prop==="__esModule")return!0;throw new Error(`Component "${String(prop)}" is not exported by "${name}"`)}return target[prop]}})};let functionBody=`
|
|
610
610
|
var exports = {};
|
|
611
611
|
var require = globalThis.__tscircuit_require;
|
|
612
612
|
var module = { exports };
|
package/package.json
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
"main": "dist/index.js",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.1078-libonly",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/tscircuit/tscircuit"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
-
"cli.mjs",
|
|
14
13
|
"globals.d.ts"
|
|
15
14
|
],
|
|
16
15
|
"scripts": {
|
|
@@ -29,10 +28,6 @@
|
|
|
29
28
|
},
|
|
30
29
|
"./browser": "./dist/browser.min.js"
|
|
31
30
|
},
|
|
32
|
-
"bin": {
|
|
33
|
-
"tsci": "cli.mjs",
|
|
34
|
-
"tscircuit": "cli.mjs"
|
|
35
|
-
},
|
|
36
31
|
"devDependencies": {
|
|
37
32
|
"@types/bun": "^1.2.16",
|
|
38
33
|
"esbuild": "^0.20.2",
|
|
@@ -54,10 +49,9 @@
|
|
|
54
49
|
"@tscircuit/checks": "^0.0.87",
|
|
55
50
|
"@tscircuit/circuit-json-flex": "^0.0.3",
|
|
56
51
|
"@tscircuit/circuit-json-util": "^0.0.73",
|
|
57
|
-
"@tscircuit/cli": "^0.1.670",
|
|
58
52
|
"@tscircuit/copper-pour-solver": "^0.0.14",
|
|
59
53
|
"@tscircuit/core": "^0.0.937",
|
|
60
|
-
"@tscircuit/eval": "^0.0.
|
|
54
|
+
"@tscircuit/eval": "^0.0.550",
|
|
61
55
|
"@tscircuit/footprinter": "^0.0.236",
|
|
62
56
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
63
57
|
"@tscircuit/matchpack": "^0.0.16",
|
|
@@ -65,7 +59,7 @@
|
|
|
65
59
|
"@tscircuit/miniflex": "^0.0.4",
|
|
66
60
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
67
61
|
"@tscircuit/props": "^0.0.432",
|
|
68
|
-
"@tscircuit/runframe": "^0.0.
|
|
62
|
+
"@tscircuit/runframe": "^0.0.1426",
|
|
69
63
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
70
64
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
71
65
|
"@tscircuit/simple-3d-svg": "^0.0.41",
|
|
@@ -106,4 +100,4 @@
|
|
|
106
100
|
"tslib": "^2.8.1",
|
|
107
101
|
"zod": "^3.25.67"
|
|
108
102
|
}
|
|
109
|
-
}
|
|
103
|
+
}
|
package/cli.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
const require = createRequire(import.meta.url);
|
|
5
|
-
|
|
6
|
-
// Use require to import package.json
|
|
7
|
-
const packageJson = require("./package.json");
|
|
8
|
-
global.TSCIRCUIT_VERSION = packageJson.version;
|
|
9
|
-
|
|
10
|
-
async function main() {
|
|
11
|
-
await import("@tscircuit/cli");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
main();
|