svg2swiftui 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var C=Object.create;var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var j=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of N(e))!I.call(t,i)&&i!==n&&m(t,i,{get:()=>e[i],enumerable:!(o=y(e,i))||o.enumerable});return t};var a=(t,e,n)=>(n=t!=null?C(x(t)):{},j(e||!t||!t.__esModule?m(n,"default",{value:t,enumerable:!0}):n,t));var v=require("commander");var u={name:"svg2swiftui",version:"0.2.0",description:"CLI for converting SVG files into SwiftUI Shape structs.",main:"dist/cli.js",bin:{svg2swiftui:"./dist/cli.js"},files:["dist","README.md"],license:"MIT",keywords:["svg","swiftui","cli","swift","converter"],author:{name:"Antoni Silvestrovic",email:"antoni.silvestrovic@gmail.com",url:"https://antoni.ai"},repository:{type:"git",url:"git+https://github.com/quassum/svg-to-swiftui-core.git"},bugs:{url:"https://github.com/quassum/svg-to-swiftui-core/issues"},homepage:"https://github.com/quassum/svg-to-swiftui-core#readme",scripts:{build:"tsup",dev:"tsup --watch",clean:"rm -rf .turbo node_modules dist",test:"jest",lint:"biome check .",format:"biome format .",typecheck:"tsc --noEmit"},dependencies:{commander:"^12.1.0","svg-to-swiftui-core":"workspace:*"},devDependencies:{"@svg-to-swiftui/tsconfig":"workspace:*","@swc/core":"^1.15.18","@swc/jest":"^0.2.39","@types/jest":"^30.0.0","@types/node":"^24.3.0",jest:"^30.2.0",tsup:"^8.5.1",typescript:"^5.9.3"}};var r=a(require("fs")),g=a(require("path")),d=require("svg-to-swiftui-core");var c=a(require("path")),p="SVGShape";function f(t){let e=c.default.extname(t),o=c.default.basename(t,e).split(/[^A-Za-z0-9]+/).filter(s=>s.length>0);if(o.length===0)return p;let i=o.map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("");return/^[0-9]/.test(i)?p:i}function l(t){let{input:e,output:n,structName:o,precision:i,indentation:s,usageComment:w}=t;if(!r.default.existsSync(e))throw new Error(`Input file not found: ${e}`);let h=r.default.readFileSync(e,"utf8"),S=o??f(n),b=(0,d.convert)(h,{structName:S,precision:i,indentationSize:s,usageCommentPrefix:w});r.default.mkdirSync(g.default.dirname(n),{recursive:!0}),r.default.writeFileSync(n,b,"utf8")}function F(t){let e=new v.Command;e.name("svg2swiftui").description("Convert an SVG file into a SwiftUI Shape struct.").version(u.version).argument("<input>","Path to input SVG file").argument("<output>","Path to output Swift file").option("--struct-name <name>","SwiftUI struct name (default: derived from output filename)").option("--precision <n>","Decimal precision for path coordinates",Number,10).option("--indentation <n>","Indentation width in spaces",Number,4).option("--usage-comment","Include SwiftUI usage example as a leading comment",!1).action((n,o,i)=>{l({input:n,output:o,structName:i.structName,precision:i.precision,indentation:i.indentation,usageComment:i.usageComment})}),e.parse(t)}try{F(process.argv)}catch(t){let e=t instanceof Error?t.message:String(t);console.error(`Error: ${e}`),process.exit(1)}
2
+ "use strict";var C=Object.create;var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var j=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of N(e))!I.call(t,i)&&i!==n&&m(t,i,{get:()=>e[i],enumerable:!(o=y(e,i))||o.enumerable});return t};var a=(t,e,n)=>(n=t!=null?C(x(t)):{},j(e||!t||!t.__esModule?m(n,"default",{value:t,enumerable:!0}):n,t));var v=require("commander");var u={name:"svg2swiftui",version:"0.2.1",description:"CLI for converting SVG files into SwiftUI Shape structs.",main:"dist/cli.js",bin:{svg2swiftui:"./dist/cli.js"},files:["dist","README.md"],license:"MIT",keywords:["svg","swiftui","cli","swift","converter"],author:{name:"Antoni Silvestrovic",email:"antoni.silvestrovic@gmail.com",url:"https://antoni.ai"},repository:{type:"git",url:"git+https://github.com/quassum/svg-to-swiftui-core.git"},bugs:{url:"https://github.com/quassum/svg-to-swiftui-core/issues"},homepage:"https://github.com/quassum/svg-to-swiftui-core#readme",scripts:{build:"tsup",dev:"tsup --watch",clean:"rm -rf .turbo node_modules dist",test:"jest",lint:"biome check .",format:"biome format .",typecheck:"tsc --noEmit"},dependencies:{commander:"^12.1.0","svg-to-swiftui-core":"workspace:*"},devDependencies:{"@svg-to-swiftui/tsconfig":"workspace:*","@swc/core":"^1.15.18","@swc/jest":"^0.2.39","@types/jest":"^30.0.0","@types/node":"^24.3.0",jest:"^30.2.0",tsup:"^8.5.1",typescript:"^5.9.3"}};var r=a(require("fs")),g=a(require("path")),d=require("svg-to-swiftui-core");var c=a(require("path")),p="SVGShape";function f(t){let e=c.default.extname(t),o=c.default.basename(t,e).split(/[^A-Za-z0-9]+/).filter(s=>s.length>0);if(o.length===0)return p;let i=o.map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("");return/^[0-9]/.test(i)?p:i}function l(t){let{input:e,output:n,structName:o,precision:i,indentation:s,usageComment:w}=t;if(!r.default.existsSync(e))throw new Error(`Input file not found: ${e}`);let h=r.default.readFileSync(e,"utf8"),S=o??f(n),b=(0,d.convert)(h,{structName:S,precision:i,indentationSize:s,usageCommentPrefix:w});r.default.mkdirSync(g.default.dirname(n),{recursive:!0}),r.default.writeFileSync(n,b,"utf8")}function F(t){let e=new v.Command;e.name("svg2swiftui").description("Convert an SVG file into a SwiftUI Shape struct.").version(u.version).argument("<input>","Path to input SVG file").argument("<output>","Path to output Swift file").option("--struct-name <name>","SwiftUI struct name (default: derived from output filename)").option("--precision <n>","Decimal precision for path coordinates",Number,10).option("--indentation <n>","Indentation width in spaces",Number,4).option("--usage-comment","Include SwiftUI usage example as a leading comment",!1).action((n,o,i)=>{l({input:n,output:o,structName:i.structName,precision:i.precision,indentation:i.indentation,usageComment:i.usageComment})}),e.parse(t)}try{F(process.argv)}catch(t){let e=t instanceof Error?t.message:String(t);console.error(`Error: ${e}`),process.exit(1)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svg2swiftui",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI for converting SVG files into SwiftUI Shape structs.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {