Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arcgis/create

Package Overview
Dependencies
Maintainers
0
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcgis/create - npm Package Compare versions

Comparing version 4.31.0-next.80 to 4.31.0-next.81

10

dist/esm/init.js

@@ -1,9 +0,9 @@

import{Command as De}from"@commander-js/extra-typings";var V="4.31.0-next.80";var f=(p=>(p.VANILLA="vanilla JS",p.REACT="react",p.ANGULAR="angular",p.VITE="vite",p.VUE="vue",p.WEBPACK="webpack",p.LIT_COMPONENTS="lit-components",p))(f||{}),h=(o=>(o.CHARTS="charts",o.CODING="coding",o))(h||{});var D="github.com",U={"vanilla JS":"Esri/arcgis-maps-sdk-javascript-samples-beta",vite:"Esri/arcgis-maps-sdk-javascript-samples-beta",react:"Esri/arcgis-maps-sdk-javascript-samples-beta",angular:"Esri/arcgis-maps-sdk-javascript-samples-beta",vue:"Esri/arcgis-maps-sdk-javascript-samples-beta",webpack:"Esri/arcgis-maps-sdk-javascript-samples-beta","lit-components":"WebGIS/arcgis-web-components"},O={"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","lit-components":"packages/starter-packages/lit-components"},H={"vanilla JS":"APP_SAMPLE",vite:"APP_SAMPLE",react:"APP_SAMPLE",angular:"APP_SAMPLE",vue:"APP_SAMPLE",webpack:"APP_SAMPLE","lit-components":"CODE_SAMPLE"};import d from"fs/promises";import w from"path";import F from"process";import ue from"child_process";import{promisify as de}from"util";import ge from"normalize-package-data";async function k(e,t,o){let r=de(ue.exec),a=F.cwd();try{await d.mkdir(e)}catch(n){let s=typeof n=="string"?n:n.message;throw new Error(`could not create new directory in file system, details: ${s}`)}F.chdir(e);try{await r("git init"),await r(`git remote add origin ${t}`),await r("git config core.sparseCheckout true"),await r(`git sparse-checkout set --no-cone ${o}/*`),await r("git pull origin main")}catch(n){throw console.error(n),n}await fe(o,"."),await d.rm(".git",{recursive:!0}),F.chdir(a)}async function fe(e,t){if(!(e==="."||e===""||["./","/"].includes(e.split("/")[0])))try{let o=await d.readdir(e);for await(let a of o){let n=w.join(e,a),s=w.join(t,a);await d.rename(n,s)}let r=e.split("/")[0];await d.rm(r,{recursive:!0})}catch(o){console.error("Error:",o)}}async function E(e){let t=await d.readFile(w.join(e,"package.json"),"utf-8"),o=JSON.parse(t);return ge(o,a=>{console.error(a)}),o}async function A(e,t){await d.writeFile(w.join(e,"package.json"),JSON.stringify(t,null,2))}function W(e){return e.scripts?.start?"start":"dev"}function Y(e,t,o){let r="@arcgis/map-components",a=["react","angular"].some(s=>s===o);a&&(r=`@arcgis/map-components-${o.toLowerCase()}`);let n=e.dependencies[r];e.dependencies={...e.dependencies,...t.reduce((s,p)=>{let g=`@arcgis/${p}-components${a?`-${o.toLowerCase()}`:""}`;return{...s,[g]:n}},{})}}var K=e=>{let t={};return Object.keys(e).forEach(o=>{let r=o;if(e?.[r])switch(r){case"name":t.name=e.name;break;case"template":{let a=e.template?.toUpperCase().replace(/-/gu,"_")??"";if(!Object.keys(f).includes(a))throw new Error(`Invalid template: ${e.template}`);t.template=f[a];break}case"packages":{let a=e.packages?.replace(/\s/gu,"").split(",")??[];t.packages=a?.reduce((n,s)=>{if(!(s.toUpperCase()in h))throw new Error(`Invalid package: ${s}`);return n.push(h[s.toUpperCase()]),n},[]);break}case"host":t.host=e.host;break;default:throw Error(`Invalid option: ${r}`)}}),t};async function J(e){await d.stat(e)&&await d.rm(e,{recursive:!0})}function v(e,t){let o=U[e],r=D;return t.host&&(r=t.host),`https://${r}/${o}`}import{cancel as Le,outro as _e,multiselect as Be,group as $e,confirm as Ge}from"@clack/prompts";var z=(e=0)=>t=>`\x1B[${t+e}m`,X=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,q=(e=0)=>(t,o,r)=>`\x1B[${38+e};2;${t};${o};${r}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]}},et=Object.keys(i.modifier),he=Object.keys(i.color),ye=Object.keys(i.bgColor),tt=[...he,...ye];function Te(){let e=new Map;for(let[t,o]of Object.entries(i)){for(let[r,a]of Object.entries(o))i[r]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},o[r]=i[r],e.set(a[0],a[1]);Object.defineProperty(i,t,{value:o,enumerable:!1})}return Object.defineProperty(i,"codes",{value:e,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi=z(),i.color.ansi256=X(),i.color.ansi16m=q(),i.bgColor.ansi=z(10),i.bgColor.ansi256=X(10),i.bgColor.ansi16m=q(10),Object.defineProperties(i,{rgbToAnsi256:{value(t,o,r){return t===o&&o===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!o)return[0,0,0];let[r]=o;r.length===3&&(r=[...r].map(n=>n+n).join(""));let a=Number.parseInt(r,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:t=>i.rgbToAnsi256(...i.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let o,r,a;if(t>=232)o=((t-232)*10+8)/255,r=o,a=o;else{t-=16;let p=t%36;o=Math.floor(t/36)/5,r=Math.floor(p/6)/5,a=p%6/5}let n=Math.max(o,r,a)*2;if(n===0)return 30;let s=30+(Math.round(a)<<2|Math.round(r)<<1|Math.round(o));return n===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,o,r)=>i.ansi256ToAnsi(i.rgbToAnsi256(t,o,r)),enumerable:!1},hexToAnsi:{value:t=>i.ansi256ToAnsi(i.hexToAnsi256(t)),enumerable:!1}}),i}var be=Te(),u=be;import L from"node:process";import Ce from"node:os";import Q from"node:tty";function m(e,t=globalThis.Deno?globalThis.Deno.args:L.argv){let o=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(o+e),a=t.indexOf("--");return r!==-1&&(a===-1||r<a)}var{env:l}=L,x;m("no-color")||m("no-colors")||m("color=false")||m("color=never")?x=0:(m("color")||m("colors")||m("color=true")||m("color=always"))&&(x=1);function Pe(){if("FORCE_COLOR"in l)return l.FORCE_COLOR==="true"?1:l.FORCE_COLOR==="false"?0:l.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(l.FORCE_COLOR,10),3)}function Oe(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function we(e,{streamIsTTY:t,sniffFlags:o=!0}={}){let r=Pe();r!==void 0&&(x=r);let a=o?x:r;if(a===0)return 0;if(o){if(m("color=16m")||m("color=full")||m("color=truecolor"))return 3;if(m("color=256"))return 2}if("TF_BUILD"in l&&"AGENT_NAME"in l)return 1;if(e&&!t&&a===void 0)return 0;let n=a||0;if(l.TERM==="dumb")return n;if(L.platform==="win32"){let s=Ce.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in l)return"GITHUB_ACTIONS"in l||"GITEA_ACTIONS"in l?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in l)||l.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in l)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l.TEAMCITY_VERSION)?1:0;if(l.COLORTERM==="truecolor"||l.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in l){let s=Number.parseInt((l.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(l.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l.TERM)||"COLORTERM"in l?1:n}function Z(e,t={}){let o=we(e,{streamIsTTY:e&&e.isTTY,...t});return Oe(o)}var ke={stdout:Z({isTTY:Q.isatty(1)}),stderr:Z({isTTY:Q.isatty(2)})},ee=ke;function te(e,t,o){let r=e.indexOf(t);if(r===-1)return e;let a=t.length,n=0,s="";do s+=e.slice(n,r)+t+o,n=r+a,r=e.indexOf(t,n);while(r!==-1);return s+=e.slice(n),s}function oe(e,t,o,r){let a=0,n="";do{let s=e[r-1]==="\r";n+=e.slice(a,s?r-1:r)+t+(s?`\r
import{Command as De}from"@commander-js/extra-typings";var V="4.31.0-next.81";var f=(p=>(p.VANILLA="vanilla JS",p.REACT="react",p.ANGULAR="angular",p.VITE="vite",p.VUE="vue",p.WEBPACK="webpack",p.LIT_COMPONENTS="lit-components",p))(f||{}),h=(o=>(o.CHARTS="charts",o.CODING="coding",o))(h||{});var D="github.com",U={"vanilla JS":"Esri/arcgis-maps-sdk-javascript-samples-beta",vite:"Esri/arcgis-maps-sdk-javascript-samples-beta",react:"Esri/arcgis-maps-sdk-javascript-samples-beta",angular:"Esri/arcgis-maps-sdk-javascript-samples-beta",vue:"Esri/arcgis-maps-sdk-javascript-samples-beta",webpack:"Esri/arcgis-maps-sdk-javascript-samples-beta","lit-components":"WebGIS/arcgis-web-components"},O={"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","lit-components":"packages/starter-packages/lit-components"},H={"vanilla JS":"APP_SAMPLE",vite:"APP_SAMPLE",react:"APP_SAMPLE",angular:"APP_SAMPLE",vue:"APP_SAMPLE",webpack:"APP_SAMPLE","lit-components":"CODE_SAMPLE"};import d from"fs/promises";import w from"path";import F from"process";import ue from"child_process";import{promisify as de}from"util";import ge from"normalize-package-data";async function k(e,t,o){let r=de(ue.exec),n=F.cwd();try{await d.mkdir(e)}catch(a){let s=typeof a=="string"?a:a.message;throw new Error(`could not create new directory in file system, details: ${s}`)}F.chdir(e);try{await r("git init"),await r(`git remote add origin ${t}`),await r("git config core.sparseCheckout true"),await r(`git sparse-checkout set --no-cone ${o}/*`),await r("git pull origin main")}catch(a){throw console.error(a),a}await fe(o,"."),await d.rm(".git",{recursive:!0}),F.chdir(n)}async function fe(e,t){if(!(e==="."||e===""||["./","/"].includes(e.split("/")[0])))try{let o=await d.readdir(e);for await(let n of o){let a=w.join(e,n),s=w.join(t,n);await d.rename(a,s)}let r=e.split("/")[0];await d.rm(r,{recursive:!0})}catch(o){console.error("Error:",o)}}async function E(e){let t=await d.readFile(w.join(e,"package.json"),"utf-8"),o=JSON.parse(t);return ge(o,n=>{console.error(n)}),o}async function A(e,t){await d.writeFile(w.join(e,"package.json"),JSON.stringify(t,null,2))}function W(e){return e.scripts?.start?"start":"dev"}function Y(e,t,o){let r="@arcgis/map-components",n=["react","angular"].some(s=>s===o);n&&(r=`@arcgis/map-components-${o.toLowerCase()}`);let a=e.dependencies[r];e.dependencies={...e.dependencies,...t.reduce((s,p)=>{let g=`@arcgis/${p}-components${n?`-${o.toLowerCase()}`:""}`;return{...s,[g]:a}},{})}}var K=e=>{let t={};return Object.keys(e).forEach(o=>{let r=o;if(e?.[r])switch(r){case"name":t.name=e.name;break;case"template":{let n=e.template?.toUpperCase().replace(/-/gu,"_")??"";if(!Object.keys(f).includes(n))throw new Error(`Invalid template: ${e.template}`);t.template=f[n];break}case"packages":{let n=e.packages?.replace(/\s/gu,"").split(",")??[];t.packages=n?.reduce((a,s)=>{if(!(s.toUpperCase()in h))throw new Error(`Invalid package: ${s}`);return a.push(h[s.toUpperCase()]),a},[]);break}case"host":t.host=e.host;break;default:throw Error(`Invalid option: ${r}`)}}),t};async function J(e){await d.stat(e)&&await d.rm(e,{recursive:!0})}function v(e,t){let o=U[e],r=D;return t.host&&(r=t.host),`https://${r}/${o}`}import{cancel as Le,outro as _e,multiselect as Be,group as $e,confirm as Ge}from"@clack/prompts";var z=(e=0)=>t=>`\x1B[${t+e}m`,X=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,q=(e=0)=>(t,o,r)=>`\x1B[${38+e};2;${t};${o};${r}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]}},et=Object.keys(i.modifier),he=Object.keys(i.color),ye=Object.keys(i.bgColor),tt=[...he,...ye];function Te(){let e=new Map;for(let[t,o]of Object.entries(i)){for(let[r,n]of Object.entries(o))i[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},o[r]=i[r],e.set(n[0],n[1]);Object.defineProperty(i,t,{value:o,enumerable:!1})}return Object.defineProperty(i,"codes",{value:e,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi=z(),i.color.ansi256=X(),i.color.ansi16m=q(),i.bgColor.ansi=z(10),i.bgColor.ansi256=X(10),i.bgColor.ansi16m=q(10),Object.defineProperties(i,{rgbToAnsi256:{value(t,o,r){return t===o&&o===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!o)return[0,0,0];let[r]=o;r.length===3&&(r=[...r].map(a=>a+a).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>i.rgbToAnsi256(...i.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let o,r,n;if(t>=232)o=((t-232)*10+8)/255,r=o,n=o;else{t-=16;let p=t%36;o=Math.floor(t/36)/5,r=Math.floor(p/6)/5,n=p%6/5}let a=Math.max(o,r,n)*2;if(a===0)return 30;let s=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(o));return a===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,o,r)=>i.ansi256ToAnsi(i.rgbToAnsi256(t,o,r)),enumerable:!1},hexToAnsi:{value:t=>i.ansi256ToAnsi(i.hexToAnsi256(t)),enumerable:!1}}),i}var be=Te(),u=be;import L from"node:process";import Ce from"node:os";import Q from"node:tty";function m(e,t=globalThis.Deno?globalThis.Deno.args:L.argv){let o=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(o+e),n=t.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:l}=L,x;m("no-color")||m("no-colors")||m("color=false")||m("color=never")?x=0:(m("color")||m("colors")||m("color=true")||m("color=always"))&&(x=1);function Pe(){if("FORCE_COLOR"in l)return l.FORCE_COLOR==="true"?1:l.FORCE_COLOR==="false"?0:l.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(l.FORCE_COLOR,10),3)}function Oe(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function we(e,{streamIsTTY:t,sniffFlags:o=!0}={}){let r=Pe();r!==void 0&&(x=r);let n=o?x:r;if(n===0)return 0;if(o){if(m("color=16m")||m("color=full")||m("color=truecolor"))return 3;if(m("color=256"))return 2}if("TF_BUILD"in l&&"AGENT_NAME"in l)return 1;if(e&&!t&&n===void 0)return 0;let a=n||0;if(l.TERM==="dumb")return a;if(L.platform==="win32"){let s=Ce.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in l)return"GITHUB_ACTIONS"in l||"GITEA_ACTIONS"in l?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in l)||l.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in l)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l.TEAMCITY_VERSION)?1:0;if(l.COLORTERM==="truecolor"||l.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in l){let s=Number.parseInt((l.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(l.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l.TERM)||"COLORTERM"in l?1:a}function Z(e,t={}){let o=we(e,{streamIsTTY:e&&e.isTTY,...t});return Oe(o)}var ke={stdout:Z({isTTY:Q.isatty(1)}),stderr:Z({isTTY:Q.isatty(2)})},ee=ke;function te(e,t,o){let r=e.indexOf(t);if(r===-1)return e;let n=t.length,a=0,s="";do s+=e.slice(a,r)+t+o,a=r+n,r=e.indexOf(t,a);while(r!==-1);return s+=e.slice(a),s}function oe(e,t,o,r){let n=0,a="";do{let s=e[r-1]==="\r";a+=e.slice(n,s?r-1:r)+t+(s?`\r
`:`
`)+o,a=r+1,r=e.indexOf(`
`,a)}while(r!==-1);return n+=e.slice(a),n}var{stdout:re,stderr:ae}=ee,_=Symbol("GENERATOR"),y=Symbol("STYLER"),b=Symbol("IS_EMPTY"),ne=["ansi","ansi","ansi256","ansi16m"],T=Object.create(null),Ee=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let o=re?re.level:0;e.level=t.level===void 0?o:t.level};var Ae=e=>{let t=(...o)=>o.join(" ");return Ee(t,e),Object.setPrototypeOf(t,C.prototype),t};function C(e){return Ae(e)}Object.setPrototypeOf(C.prototype,Function.prototype);for(let[e,t]of Object.entries(u))T[e]={get(){let o=R(this,$(t.open,t.close,this[y]),this[b]);return Object.defineProperty(this,e,{value:o}),o}};T.visible={get(){let e=R(this,this[y],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var B=(e,t,o,...r)=>e==="rgb"?t==="ansi16m"?u[o].ansi16m(...r):t==="ansi256"?u[o].ansi256(u.rgbToAnsi256(...r)):u[o].ansi(u.rgbToAnsi(...r)):e==="hex"?B("rgb",t,o,...u.hexToRgb(...r)):u[o][e](...r),ve=["rgb","hex","ansi256"];for(let e of ve){T[e]={get(){let{level:o}=this;return function(...r){let a=$(B(e,ne[o],"color",...r),u.color.close,this[y]);return R(this,a,this[b])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);T[t]={get(){let{level:o}=this;return function(...r){let a=$(B(e,ne[o],"bgColor",...r),u.bgColor.close,this[y]);return R(this,a,this[b])}}}}var xe=Object.defineProperties(()=>{},{...T,level:{enumerable:!0,get(){return this[_].level},set(e){this[_].level=e}}}),$=(e,t,o)=>{let r,a;return o===void 0?(r=e,a=t):(r=o.openAll+e,a=t+o.closeAll),{open:e,close:t,openAll:r,closeAll:a,parent:o}},R=(e,t,o)=>{let r=(...a)=>Re(r,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(r,xe),r[_]=e,r[y]=t,r[b]=o,r},Re=(e,t)=>{if(e.level<=0||!t)return e[b]?"":t;let o=e[y];if(o===void 0)return t;let{openAll:r,closeAll:a}=o;if(t.includes("\x1B"))for(;o!==void 0;)t=te(t,o.close,o.open),o=o.parent;let n=t.indexOf(`
`);return n!==-1&&(t=oe(t,a,r,n)),r+t+a};Object.defineProperties(C.prototype,T);var Ne=C(),mt=C({level:ae?ae.level:0});var c=Ne;import Ve from"gradient-string";import{intro as Ie,text as Se,outro as Me,select as je}from"@clack/prompts";var se="my-arcgis-app";function N(){Ie("initialize a new arcgis project")}async function I(){return await Se({message:"What is the name of your project?",initialValue:se,placeholder:se,validate(e){if(e.length===0)return"Value is required!"}})}async function ie(){return await je({message:"Which template would you like to use?",options:Object.entries(f).map(([,e])=>({value:e,label:e}))})}function S(){Me(c.greenBright("Your new project is ready!"))}function M(e){return{name:e.name,shouldCleanup:!1,async doCleanup(o){if(console.error(c.bgRed(o)),this.shouldCleanup&&this.name)try{await J(this.name)}catch(r){console.error(c.bgRed(r))}throw o}}}import{spinner as Fe}from"@clack/prompts";async function j(e,t,o){let{startMsg:r,successMsg:a,failureMsg:n}=e,s=Fe();return s.start(r),await t().then(()=>s.stop(a)).catch(p=>{s.stop(c.bgRed(n),1),o(p,s)})}async function le(e){let t=M(e);try{N();let o=await $e({projectName:e.name?async()=>await Promise.resolve(e.name):I,projectTemplate:e.template?async()=>await Promise.resolve(e.template):ie},{onCancel:()=>{Le("Operation cancelled."),process.exit(0)}});t.name=o.projectName;let r=O[o.projectTemplate],a=v(o.projectTemplate,e);await j({startMsg:"Downloading project template...",successMsg:"Project template downloaded successfully",failureMsg:"Error downloading project template"},async()=>{await k(o.projectName,a,r),t.shouldCleanup=!0},g=>{throw _e(c.bgRed("Please ensure git is installed and try again.")),g});let n=await E(o.projectName);if(await Ge({message:"Would you like to add any additional components?",initialValue:!1})){let g=e.packages?e.packages:await Be({message:"Would you like to add any additional components? (select multiple)",options:Object.entries(h).map(([,P])=>({value:P,label:P}))});Y(n,g,o.projectTemplate),await A(o.projectName,n)}let p=W(n);S(),console.log(c.magenta(`To get started, run the following commands:
`)+o,n=r+1,r=e.indexOf(`
`,n)}while(r!==-1);return a+=e.slice(n),a}var{stdout:re,stderr:ne}=ee,_=Symbol("GENERATOR"),y=Symbol("STYLER"),b=Symbol("IS_EMPTY"),ae=["ansi","ansi","ansi256","ansi16m"],T=Object.create(null),Ee=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let o=re?re.level:0;e.level=t.level===void 0?o:t.level};var Ae=e=>{let t=(...o)=>o.join(" ");return Ee(t,e),Object.setPrototypeOf(t,C.prototype),t};function C(e){return Ae(e)}Object.setPrototypeOf(C.prototype,Function.prototype);for(let[e,t]of Object.entries(u))T[e]={get(){let o=R(this,$(t.open,t.close,this[y]),this[b]);return Object.defineProperty(this,e,{value:o}),o}};T.visible={get(){let e=R(this,this[y],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var B=(e,t,o,...r)=>e==="rgb"?t==="ansi16m"?u[o].ansi16m(...r):t==="ansi256"?u[o].ansi256(u.rgbToAnsi256(...r)):u[o].ansi(u.rgbToAnsi(...r)):e==="hex"?B("rgb",t,o,...u.hexToRgb(...r)):u[o][e](...r),ve=["rgb","hex","ansi256"];for(let e of ve){T[e]={get(){let{level:o}=this;return function(...r){let n=$(B(e,ae[o],"color",...r),u.color.close,this[y]);return R(this,n,this[b])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);T[t]={get(){let{level:o}=this;return function(...r){let n=$(B(e,ae[o],"bgColor",...r),u.bgColor.close,this[y]);return R(this,n,this[b])}}}}var xe=Object.defineProperties(()=>{},{...T,level:{enumerable:!0,get(){return this[_].level},set(e){this[_].level=e}}}),$=(e,t,o)=>{let r,n;return o===void 0?(r=e,n=t):(r=o.openAll+e,n=t+o.closeAll),{open:e,close:t,openAll:r,closeAll:n,parent:o}},R=(e,t,o)=>{let r=(...n)=>Re(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,xe),r[_]=e,r[y]=t,r[b]=o,r},Re=(e,t)=>{if(e.level<=0||!t)return e[b]?"":t;let o=e[y];if(o===void 0)return t;let{openAll:r,closeAll:n}=o;if(t.includes("\x1B"))for(;o!==void 0;)t=te(t,o.close,o.open),o=o.parent;let a=t.indexOf(`
`);return a!==-1&&(t=oe(t,n,r,a)),r+t+n};Object.defineProperties(C.prototype,T);var Ne=C(),mt=C({level:ne?ne.level:0});var c=Ne;import Ve from"gradient-string";import{intro as Ie,text as Se,outro as Me,select as je}from"@clack/prompts";var se="my-arcgis-app";function N(){Ie("initialize a new arcgis project")}async function I(){return await Se({message:"What is the name of your project?",initialValue:se,placeholder:se,validate(e){if(e.length===0)return"Value is required!"}})}async function ie(){return await je({message:"Which template would you like to use?",options:Object.entries(f).map(([,e])=>({value:e,label:e}))})}function S(){Me(c.greenBright("Your new project is ready!"))}function M(e){return{name:e.name,shouldCleanup:!1,async doCleanup(o){if(console.error(c.bgRed(o)),this.shouldCleanup&&this.name)try{await J(this.name)}catch(r){console.error(c.bgRed(r))}throw o}}}import{spinner as Fe}from"@clack/prompts";async function j(e,t,o){let{startMsg:r,successMsg:n,failureMsg:a}=e,s=Fe();return s.start(r),await t().then(()=>s.stop(n)).catch(p=>{s.stop(c.bgRed(a),1),o(p,s)})}async function le(e){let t=M(e);try{N();let o=await $e({projectName:e.name?async()=>await Promise.resolve(e.name):I,projectTemplate:e.template?async()=>await Promise.resolve(e.template):ie},{onCancel:()=>{Le("Operation cancelled."),process.exit(0)}});t.name=o.projectName;let r=O[o.projectTemplate],n=v(o.projectTemplate,e);await j({startMsg:"Downloading project template...",successMsg:"Project template downloaded successfully",failureMsg:"Error downloading project template"},async()=>{await k(o.projectName,n,r),t.shouldCleanup=!0},g=>{throw _e(c.bgRed("Please ensure git is installed and try again.")),g});let a=await E(o.projectName);if(await Ge({message:"Would you like to add any additional components?",initialValue:!1})){let g=e.packages?e.packages:await Be({message:"Would you like to add any additional components? (select multiple)",options:Object.entries(h).map(([,P])=>({value:P,label:P}))});Y(a,g,o.projectTemplate),await A(o.projectName,a)}let p=W(a);S(),console.log(c.magenta(`To get started, run the following commands:
`)),console.log(c.grey(`$ cd ${o.projectName}`)),console.log(c.grey("$ npm install")),console.log(c.grey(`$ npm run ${p}`)),console.log(Ve.vice(`
Happy mapping!`))}catch(o){await t.doCleanup(o)}}import{outro as G}from"@clack/prompts";async function ce(e){let{template:t}=e;t!=="lit-components"&&(G(c.red("Template is not a code sample")),process.exit(1)),e.host||(G(c.red("Host is required for the lit-components template")),process.exit(1));let o=M(e);try{N();let r=e.name??await I();o.name=r;let a=O[t],n=v(t,e);await j({startMsg:"Downloading project template...",successMsg:"Project template downloaded successfully",failureMsg:"Error downloading project template"},async()=>{await k(r,n,a),o.shouldCleanup=!0},P=>{throw G(c.bgRed("Please ensure git is installed and try again.")),P});let s=await E(r),p=s["acme:scripts"];delete s["acme:scripts"];let g={...s,name:r,version:"0.0.1",description:"A new ArcGIS Lit components project",scripts:p??{}};await A(r,g),S(),console.log(c.magenta(`To get started, run the following commands:
Happy mapping!`))}catch(o){await t.doCleanup(o)}}import{outro as G}from"@clack/prompts";async function ce(e){let{template:t}=e;t!=="lit-components"&&(G(c.red("Template is not a code sample")),process.exit(1)),e.host||(G(c.red("Host is required for the lit-components template")),process.exit(1));let o=M(e);try{N();let r=e.name??await I();o.name=r;let n=O[t],a=v(t,e);await j({startMsg:"Downloading project template...",successMsg:"Project template downloaded successfully",failureMsg:"Error downloading project template"},async()=>{await k(r,a,n),o.shouldCleanup=!0},P=>{throw G(c.bgRed("Please ensure git is installed and try again.")),P});let s=await E(r),p=s["acme:scripts"];delete s["acme:scripts"];let g={...s,name:r,version:"0.0.1",description:"A new ArcGIS Lit components project",scripts:p??{}};await A(r,g),S(),console.log(c.magenta(`To get started, run the following commands:
`)),console.log(c.grey(`$ cd ${r}`)),console.log(c.grey("$ yarn set version 4.0.2")),console.log(c.grey("$ yarn install")),console.log(c.grey("$ yarn run start"))}catch(r){await o.doCleanup(r)}}var pe=e=>{let t=new De;return e?.exitOverride&&t.exitOverride(),e?.suppressOutput&&t.configureOutput({writeOut:()=>"",writeErr:()=>""}),t.version(V),t.option("-n, --name <name>","Name of the project").option("-t, --template <template>","Template to use").option("-p, --packages <packages>","Additional packages to add").option("--host <host>","Host to use for the source control repository"),t.command("init").description("Initialize a new ArcGIS project").action(async()=>{let o=K(t.opts());if(o.template&&H[o.template]==="CODE_SAMPLE"){await ce(o);return}await le(o)}),t},Ue={makeProgram:pe};process.env.NODE_ENV!=="test"&&(Ue=void 0,pe().parse());export{Ue as exportsForTests};
{
"name": "@arcgis/create",
"version": "4.31.0-next.80",
"version": "4.31.0-next.81",
"description": "ArcGIS command line tool to create new web GIS projects and applications",

@@ -49,3 +49,3 @@ "keywords": [

"devDependencies": {
"@arcgis/components-build-utils": "4.31.0-next.80",
"@arcgis/components-build-utils": "4.31.0-next.81",
"@swc/core": "^1.7.11",

@@ -66,3 +66,3 @@ "@swc/jest": "^0.2.36",

},
"gitHead": "bd1ad74ca8ce92cca94299846d573e94edb5a115"
"gitHead": "3353133f01a948ea342935d19767af17e84d1861"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc