@arcgis/create
Advanced tools
Comparing version 4.30.0-next.67 to 4.30.0-next.68
@@ -5,5 +5,5 @@ import{Command as Ce}from"@commander-js/extra-typings";import{intro as ke,text as we,outro as q,group as ve,cancel as Te,select as Ee,spinner as xe,multiselect as Ae,confirm as Re}from"@clack/prompts";import Pe from"gradient-string";var I=(t=0)=>e=>`\x1B[${e+t}m`,j=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,S=(t=0)=>(e,r,o)=>`\x1B[${38+t};2;${e};${r};${o}m`,i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Fe=Object.keys(i.modifier),ee=Object.keys(i.color),te=Object.keys(i.bgColor),Be=[...ee,...te];function re(){let t=new Map;for(let[e,r]of Object.entries(i)){for(let[o,n]of Object.entries(r))i[o]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[o]=i[o],t.set(n[0],n[1]);Object.defineProperty(i,e,{value:r,enumerable:!1})}return Object.defineProperty(i,"codes",{value:t,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi=I(),i.color.ansi256=j(),i.color.ansi16m=S(),i.bgColor.ansi=I(10),i.bgColor.ansi256=j(10),i.bgColor.ansi16m=S(10),Object.defineProperties(i,{rgbToAnsi256:{value(e,r,o){return e===r&&r===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[o]=r;o.length===3&&(o=[...o].map(a=>a+a).join(""));let n=Number.parseInt(o,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>i.rgbToAnsi256(...i.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,o,n;if(e>=232)r=((e-232)*10+8)/255,o=r,n=r;else{e-=16;let g=e%36;r=Math.floor(e/36)/5,o=Math.floor(g/6)/5,n=g%6/5}let a=Math.max(r,o,n)*2;if(a===0)return 30;let s=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(r));return a===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,o)=>i.ansi256ToAnsi(i.rgbToAnsi256(e,r,o)),enumerable:!1},hexToAnsi:{value:e=>i.ansi256ToAnsi(i.hexToAnsi256(e)),enumerable:!1}}),i}var oe=re(),p=oe;import E from"node:process";import ne from"node:os";import F from"node:tty";function l(t,e=globalThis.Deno?globalThis.Deno.args:E.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",o=e.indexOf(r+t),n=e.indexOf("--");return o!==-1&&(n===-1||o<n)}var{env:c}=E,w;l("no-color")||l("no-colors")||l("color=false")||l("color=never")?w=0:(l("color")||l("colors")||l("color=true")||l("color=always"))&&(w=1);function ae(){if("FORCE_COLOR"in c)return c.FORCE_COLOR==="true"?1:c.FORCE_COLOR==="false"?0:c.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(c.FORCE_COLOR,10),3)}function se(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function ie(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let o=ae();o!==void 0&&(w=o);let n=r?w:o;if(n===0)return 0;if(r){if(l("color=16m")||l("color=full")||l("color=truecolor"))return 3;if(l("color=256"))return 2}if("TF_BUILD"in c&&"AGENT_NAME"in c)return 1;if(t&&!e&&n===void 0)return 0;let a=n||0;if(c.TERM==="dumb")return a;if(E.platform==="win32"){let s=ne.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in c)return"GITHUB_ACTIONS"in c||"GITEA_ACTIONS"in c?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in c)||c.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in c)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0;if(c.COLORTERM==="truecolor"||c.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in c){let s=Number.parseInt((c.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(c.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)||"COLORTERM"in c?1:a}function B(t,e={}){let r=ie(t,{streamIsTTY:t&&t.isTTY,...e});return se(r)}var ce={stdout:B({isTTY:F.isatty(1)}),stderr:B({isTTY:F.isatty(2)})},M=ce;function L(t,e,r){let o=t.indexOf(e);if(o===-1)return t;let n=e.length,a=0,s="";do s+=t.slice(a,o)+e+r,a=o+n,o=t.indexOf(e,a);while(o!==-1);return s+=t.slice(a),s}function _(t,e,r,o){let n=0,a="";do{let s=t[o-1]==="\r";a+=t.slice(n,s?o-1:o)+e+(s?`\r | ||
`,n)}while(o!==-1);return a+=t.slice(n),a}var{stdout:G,stderr:$}=M,x=Symbol("GENERATOR"),f=Symbol("STYLER"),C=Symbol("IS_EMPTY"),D=["ansi","ansi","ansi256","ansi16m"],h=Object.create(null),le=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=G?G.level:0;t.level=e.level===void 0?r:e.level};var pe=t=>{let e=(...r)=>r.join(" ");return le(e,t),Object.setPrototypeOf(e,k.prototype),e};function k(t){return pe(t)}Object.setPrototypeOf(k.prototype,Function.prototype);for(let[t,e]of Object.entries(p))h[t]={get(){let r=v(this,R(e.open,e.close,this[f]),this[C]);return Object.defineProperty(this,t,{value:r}),r}};h.visible={get(){let t=v(this,this[f],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var A=(t,e,r,...o)=>t==="rgb"?e==="ansi16m"?p[r].ansi16m(...o):e==="ansi256"?p[r].ansi256(p.rgbToAnsi256(...o)):p[r].ansi(p.rgbToAnsi(...o)):t==="hex"?A("rgb",e,r,...p.hexToRgb(...o)):p[r][t](...o),me=["rgb","hex","ansi256"];for(let t of me){h[t]={get(){let{level:r}=this;return function(...o){let n=R(A(t,D[r],"color",...o),p.color.close,this[f]);return v(this,n,this[C])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);h[e]={get(){let{level:r}=this;return function(...o){let n=R(A(t,D[r],"bgColor",...o),p.bgColor.close,this[f]);return v(this,n,this[C])}}}}var ue=Object.defineProperties(()=>{},{...h,level:{enumerable:!0,get(){return this[x].level},set(t){this[x].level=t}}}),R=(t,e,r)=>{let o,n;return r===void 0?(o=t,n=e):(o=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:n,parent:r}},v=(t,e,r)=>{let o=(...n)=>de(o,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(o,ue),o[x]=t,o[f]=e,o[C]=r,o},de=(t,e)=>{if(t.level<=0||!e)return t[C]?"":e;let r=t[f];if(r===void 0)return e;let{openAll:o,closeAll:n}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=L(e,r.close,r.open),r=r.parent;let a=e.indexOf(` | ||
`);return a!==-1&&(e=_(e,n,o,a)),o+e+n};Object.defineProperties(k.prototype,h);var ge=k(),We=k({level:$?$.level:0});var m=ge;var V="4.30.0-next.67";var b=(s=>(s.VANILLA="vanilla JS",s.REACT="react",s.ANGULAR="angular",s.VITE="vite",s.VUE="vue",s.WEBPACK="webpack",s))(b||{}),y=(r=>(r.CHARTS="charts",r.CODING="coding",r))(y||{});import u from"fs/promises";import T from"path";import P from"process";import he from"child_process";import{promisify as be}from"util";import ye from"normalize-package-data";async function U(t,e,r){let o=be(he.exec),n=P.cwd();try{await u.mkdir(t)}catch(a){let s=typeof a=="string"?a:a.message;throw new Error(`could not create new directory in file system, details: ${s}`)}P.chdir(t);try{await o("git init"),await o(`git remote add origin ${e}`),await o("git config core.sparseCheckout true"),await o(`git sparse-checkout set --no-cone ${r}/*`),await o("git pull origin main")}catch(a){throw console.error(a),a}await Oe(r,"."),await u.rm(".git",{recursive:!0}),P.chdir(n)}async function Oe(t,e){if(!(t==="."||t===""||["./","/"].includes(t.split("/")[0])))try{let r=await u.readdir(t);for await(let n of r){let a=T.join(t,n),s=T.join(e,n);await u.rename(a,s)}let o=t.split("/")[0];await u.rm(o,{recursive:!0})}catch(r){console.error("Error:",r)}}async function Y(t){let e=await u.readFile(T.join(t,"package.json"),"utf-8"),r=JSON.parse(e);return ye(r,n=>{console.error(n)}),r}async function W(t,e){await u.writeFile(T.join(t,"package.json"),JSON.stringify(e,null,2))}function K(t){return t.scripts?.start?"start":"dev"}function z(t,e,r){let o="@arcgis/map-components",n=["react","angular"].some(s=>s===r);n&&(o=`@arcgis/map-components-${r.toLowerCase()}`);let a=t.dependencies[o];t.dependencies={...t.dependencies,...e.reduce((s,g)=>{let O=`@arcgis/${g}-components${n?`-${r.toLowerCase()}`:""}`;return{...s,[O]:a}},{})}}var J=t=>{let e={};return Object.keys(t).forEach(r=>{let o=r;if(t?.[o])switch(o){case"name":e.name=t.name;break;case"template":{if(!Object.keys(b).includes(t.template?.toUpperCase()??""))throw new Error(`Invalid template: ${t.template}`);e.template=b[t.template?.toUpperCase()];break}case"packages":{let n=t.packages?.replace(/\s/gu,"").split(",")??[];e.packages=n?.reduce((a,s)=>{if(!(s.toUpperCase()in y))throw new Error(`Invalid package: ${s}`);return a.push(y[s.toUpperCase()]),a},[]);break}default:throw Error(`Invalid option: ${o}`)}}),e};async function H(t){await u.stat(t)&&await u.rm(t,{recursive:!0})}var Ne="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta",Ie={"vanilla JS":"packages/map-components/templates/vite",vite:"packages/map-components/templates/vite",react:"packages/map-components/templates/react",angular:"packages/map-components/templates/angular",vue:"packages/map-components/templates/vue",webpack:"packages/map-components/templates/webpack"},Q="my-arcgis-app",X=t=>{let e=new Ce;return t?.exitOverride&&e.exitOverride(),t?.suppressOutput&&e.configureOutput({writeOut:()=>"",writeErr:()=>""}),e.version(V),e.option("-n, --name <name>","Name of the project").option("-t, --template <template>","Template to use").option("-p, --packages <packages>","Additional packages to add"),e.command("init").description("Initialize a new ArcGIS project").action(async()=>{let r=J(e.opts()),o=r.name,n=!1;try{ke("initialize a new arcgis project");let a=await ve({projectName:r.name?async()=>await Promise.resolve(r.name):async()=>await we({message:"What is the name of your project?",initialValue:Q,placeholder:Q,validate(d){if(d.length===0)return"Value is required!"}}),projectTemplate:r.template?async()=>await Promise.resolve(r.template):async()=>await Ee({message:"Which template would you like to use?",options:Object.entries(b).map(([,d])=>({value:d,label:d}))})},{onCancel:()=>{Te("Operation cancelled."),process.exit(0)}});o=a.projectName;let s=xe();s.start("Downloading project template...");let g=Ie[a.projectTemplate];await U(a.projectName,Ne,g).catch(d=>{throw s.stop(m.bgRed("Error downloading project template"),1),q(m.bgRed("Please ensure git is installed and try again.")),d}),n=!0,s.stop("Success! Project template downloaded");let O=await Y(a.projectName);if(await Re({message:"Would you like to add any additional components?",initialValue:!1})){let d=r.packages?r.packages:await Ae({message:"Would you like to add any additional components? (select multiple)",options:Object.entries(y).map(([,N])=>({value:N,label:N}))});z(O,d,a.projectTemplate),await W(a.projectName,O)}let Z=K(O);q(m.greenBright("Your new project is ready!")),console.log(m.magenta(`To get started, run the following commands: | ||
`);return a!==-1&&(e=_(e,n,o,a)),o+e+n};Object.defineProperties(k.prototype,h);var ge=k(),We=k({level:$?$.level:0});var m=ge;var V="4.30.0-next.68";var b=(s=>(s.VANILLA="vanilla JS",s.REACT="react",s.ANGULAR="angular",s.VITE="vite",s.VUE="vue",s.WEBPACK="webpack",s))(b||{}),y=(r=>(r.CHARTS="charts",r.CODING="coding",r))(y||{});import u from"fs/promises";import T from"path";import P from"process";import he from"child_process";import{promisify as be}from"util";import ye from"normalize-package-data";async function U(t,e,r){let o=be(he.exec),n=P.cwd();try{await u.mkdir(t)}catch(a){let s=typeof a=="string"?a:a.message;throw new Error(`could not create new directory in file system, details: ${s}`)}P.chdir(t);try{await o("git init"),await o(`git remote add origin ${e}`),await o("git config core.sparseCheckout true"),await o(`git sparse-checkout set --no-cone ${r}/*`),await o("git pull origin main")}catch(a){throw console.error(a),a}await Oe(r,"."),await u.rm(".git",{recursive:!0}),P.chdir(n)}async function Oe(t,e){if(!(t==="."||t===""||["./","/"].includes(t.split("/")[0])))try{let r=await u.readdir(t);for await(let n of r){let a=T.join(t,n),s=T.join(e,n);await u.rename(a,s)}let o=t.split("/")[0];await u.rm(o,{recursive:!0})}catch(r){console.error("Error:",r)}}async function Y(t){let e=await u.readFile(T.join(t,"package.json"),"utf-8"),r=JSON.parse(e);return ye(r,n=>{console.error(n)}),r}async function W(t,e){await u.writeFile(T.join(t,"package.json"),JSON.stringify(e,null,2))}function K(t){return t.scripts?.start?"start":"dev"}function z(t,e,r){let o="@arcgis/map-components",n=["react","angular"].some(s=>s===r);n&&(o=`@arcgis/map-components-${r.toLowerCase()}`);let a=t.dependencies[o];t.dependencies={...t.dependencies,...e.reduce((s,g)=>{let O=`@arcgis/${g}-components${n?`-${r.toLowerCase()}`:""}`;return{...s,[O]:a}},{})}}var J=t=>{let e={};return Object.keys(t).forEach(r=>{let o=r;if(t?.[o])switch(o){case"name":e.name=t.name;break;case"template":{if(!Object.keys(b).includes(t.template?.toUpperCase()??""))throw new Error(`Invalid template: ${t.template}`);e.template=b[t.template?.toUpperCase()];break}case"packages":{let n=t.packages?.replace(/\s/gu,"").split(",")??[];e.packages=n?.reduce((a,s)=>{if(!(s.toUpperCase()in y))throw new Error(`Invalid package: ${s}`);return a.push(y[s.toUpperCase()]),a},[]);break}default:throw Error(`Invalid option: ${o}`)}}),e};async function H(t){await u.stat(t)&&await u.rm(t,{recursive:!0})}var Ne="https://github.com/Esri/arcgis-maps-sdk-javascript-samples-beta",Ie={"vanilla JS":"packages/map-components/templates/vite",vite:"packages/map-components/templates/vite",react:"packages/map-components/templates/react",angular:"packages/map-components/templates/angular",vue:"packages/map-components/templates/vue",webpack:"packages/map-components/templates/webpack"},Q="my-arcgis-app",X=t=>{let e=new Ce;return t?.exitOverride&&e.exitOverride(),t?.suppressOutput&&e.configureOutput({writeOut:()=>"",writeErr:()=>""}),e.version(V),e.option("-n, --name <name>","Name of the project").option("-t, --template <template>","Template to use").option("-p, --packages <packages>","Additional packages to add"),e.command("init").description("Initialize a new ArcGIS project").action(async()=>{let r=J(e.opts()),o=r.name,n=!1;try{ke("initialize a new arcgis project");let a=await ve({projectName:r.name?async()=>await Promise.resolve(r.name):async()=>await we({message:"What is the name of your project?",initialValue:Q,placeholder:Q,validate(d){if(d.length===0)return"Value is required!"}}),projectTemplate:r.template?async()=>await Promise.resolve(r.template):async()=>await Ee({message:"Which template would you like to use?",options:Object.entries(b).map(([,d])=>({value:d,label:d}))})},{onCancel:()=>{Te("Operation cancelled."),process.exit(0)}});o=a.projectName;let s=xe();s.start("Downloading project template...");let g=Ie[a.projectTemplate];await U(a.projectName,Ne,g).catch(d=>{throw s.stop(m.bgRed("Error downloading project template"),1),q(m.bgRed("Please ensure git is installed and try again.")),d}),n=!0,s.stop("Success! Project template downloaded");let O=await Y(a.projectName);if(await Re({message:"Would you like to add any additional components?",initialValue:!1})){let d=r.packages?r.packages:await Ae({message:"Would you like to add any additional components? (select multiple)",options:Object.entries(y).map(([,N])=>({value:N,label:N}))});z(O,d,a.projectTemplate),await W(a.projectName,O)}let Z=K(O);q(m.greenBright("Your new project is ready!")),console.log(m.magenta(`To get started, run the following commands: | ||
`)),console.log(m.grey(`$ cd ${a.projectName}`)),console.log(m.grey("$ npm install")),console.log(m.grey(`$ npm run ${Z}`)),console.log(Pe.vice(` | ||
Happy mapping!`))}catch(a){if(console.error(m.bgRed(a)),o&&n)H(o).then(()=>{throw a}).catch(()=>{throw a});else throw a}}),e},je={makeProgram:X};process.env.NODE_ENV!=="test"&&(je=void 0,X().parse());export{je as exportsForTests}; |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://developers.arcgis.com/javascript/latest/", | ||
"version": "4.30.0-next.67", | ||
"version": "4.30.0-next.68", | ||
"engines": { | ||
@@ -65,3 +65,3 @@ "node": ">=18.0.0" | ||
}, | ||
"gitHead": "3433ff9cb04e6fef7748128baf229ef625b39e2f" | ||
"gitHead": "22abae5b6a4e02e22b6be3f20704eb1c781f4188" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package