create-next-app 13.4.11 → 13.4.12-canary.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/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -322,4 +322,4 @@ function pascalcase(e){if(typeof e!=="string"){throw new TypeError("expected a s
|
|
|
322
322
|
*
|
|
323
323
|
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
324
324
|
* Released under the MIT License.
|
|
325
|
-
*/e.exports=function base(e,t){if(!isObject(e)&&typeof e!=="function"){throw new TypeError("expected an object or function")}var r=isObject(t)?t:{};var n=typeof r.prop==="string"?r.prop:"fns";if(!Array.isArray(e[n])){define(e,n,[])}define(e,"use",use);define(e,"run",(function(t){if(!isObject(t))return;if(!t.use||!t.run){define(t,n,t[n]||[]);define(t,"use",use)}if(!t[n]||t[n].indexOf(base)===-1){t.use(base)}var r=this||e;var s=r[n];var i=s.length;var o=-1;while(++o<i){t.use(s[o])}return t}));function use(t,s,i){var o=1;if(typeof t==="string"||Array.isArray(t)){s=wrap(t,s);o++}else{i=s;s=t}if(typeof s!=="function"){throw new TypeError("expected a function")}var a=this||e;var c=a[n];var u=[].slice.call(arguments,o);u.unshift(a);if(typeof r.hook==="function"){r.hook.apply(a,u)}var l=s.apply(a,u);if(typeof l==="function"&&c.indexOf(l)===-1){c.push(l)}return a}function wrap(e,t){return function plugin(){return this.type===e?t.apply(this,arguments):plugin}}return e};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}function define(e,t,r){Object.defineProperty(e,t,{configurable:true,writable:true,value:r})}},42338:(e,t,r)=>{"use strict";var n=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var s=r(33113);var i=["node_modules","favicon.ico"];var o=e.exports=function(e){var t=[];var r=[];if(e===null){r.push("name cannot be null");return done(t,r)}if(e===undefined){r.push("name cannot be undefined");return done(t,r)}if(typeof e!=="string"){r.push("name must be a string");return done(t,r)}if(!e.length){r.push("name length must be greater than zero")}if(e.match(/^\./)){r.push("name cannot start with a period")}if(e.match(/^_/)){r.push("name cannot start with an underscore")}if(e.trim()!==e){r.push("name cannot contain leading or trailing spaces")}i.forEach((function(t){if(e.toLowerCase()===t){r.push(t+" is a blacklisted name")}}));s.forEach((function(r){if(e.toLowerCase()===r){t.push(r+" is a core module name")}}));if(e.length>214){t.push("name can no longer contain more than 214 characters")}if(e.toLowerCase()!==e){t.push("name can no longer contain capital letters")}if(/[~'!()*]/.test(e.split("/").slice(-1)[0])){t.push('name can no longer contain special characters ("~\'!()*")')}if(encodeURIComponent(e)!==e){var o=e.match(n);if(o){var a=o[1];var c=o[2];if(encodeURIComponent(a)===a&&encodeURIComponent(c)===c){return done(t,r)}}r.push("name can only contain URL-friendly characters")}return done(t,r)};o.scopedPackagePattern=n;var done=function(e,t){var r={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};if(!r.warnings.length)delete r.warnings;if(!r.errors.length)delete r.errors;return r}},69423:(e,t,r)=>{e.exports=which;which.sync=whichSync;var n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";var s=r(71017);var i=n?";":":";var o=r(17745);function getNotFoundError(e){var t=new Error("not found: "+e);t.code="ENOENT";return t}function getPathInfo(e,t){var r=t.colon||i;var s=t.path||process.env.PATH||"";var o=[""];s=s.split(r);var a="";if(n){s.unshift(process.cwd());a=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM";o=a.split(r);if(e.indexOf(".")!==-1&&o[0]!=="")o.unshift("")}if(e.match(/\//)||n&&e.match(/\\/))s=[""];return{env:s,ext:o,extExe:a}}function which(e,t,r){if(typeof t==="function"){r=t;t={}}var n=getPathInfo(e,t);var i=n.env;var a=n.ext;var c=n.extExe;var u=[];(function F(n,l){if(n===l){if(t.all&&u.length)return r(null,u);else return r(getNotFoundError(e))}var h=i[n];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=s.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}(function E(e,s){if(e===s)return F(n+1,l);var i=a[e];o(p+i,{pathExt:c},(function(n,o){if(!n&&o){if(t.all)u.push(p+i);else return r(null,p+i)}return E(e+1,s)}))})(0,a.length)})(0,i.length)}function whichSync(e,t){t=t||{};var r=getPathInfo(e,t);var n=r.env;var i=r.ext;var a=r.extExe;var c=[];for(var u=0,l=n.length;u<l;u++){var h=n[u];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=s.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}for(var d=0,y=i.length;d<y;d++){var g=p+i[d];var v;try{v=o.sync(g,{pathExt:a});if(v){if(t.all)c.push(g);else return g}}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw getNotFoundError(e)}},83270:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var n=e.apply(this,t);var s=t[t.length-1];if(typeof n==="function"&&n!==s){Object.keys(s).forEach((function(e){n[e]=s[e]}))}return n}}},49414:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next){yield e.value}}}},13401:(e,t,r)=>{"use strict";e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,n=arguments.length;r<n;r++){t.push(arguments[r])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var r=e.prev;if(t){t.prev=r}if(r){r.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=r}e.list.length--;e.next=null;e.prev=null;e.list=null;return t};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++){e.call(t,r.value,n,this);r=r.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--){e.call(t,r.value,n,this);r=r.prev}};Yallist.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++){r=r.next}if(t===e&&r!==null){return r.value}};Yallist.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++){r=r.prev}if(t===e&&r!==null){return r.value}};Yallist.prototype.map=function(e,t){t=t||this;var r=new Yallist;for(var n=this.head;n!==null;){r.push(e.call(t,n.value,this));n=n.next}return r};Yallist.prototype.mapReverse=function(e,t){t=t||this;var r=new Yallist;for(var n=this.tail;n!==null;){r.push(e.call(t,n.value,this));n=n.prev}return r};Yallist.prototype.reduce=function(e,t){var r;var n=this.head;if(arguments.length>1){r=t}else if(this.head){n=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var s=0;n!==null;s++){r=e(r,n.value,s);n=n.next}return r};Yallist.prototype.reduceReverse=function(e,t){var r;var n=this.tail;if(arguments.length>1){r=t}else if(this.tail){n=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var s=this.length-1;n!==null;s--){r=e(r,n.value,s);n=n.prev}return r};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=0,s=this.head;s!==null&&n<e;n++){s=s.next}for(;s!==null&&n<t;n++,s=s.next){r.push(s.value)}return r};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=this.length,s=this.tail;s!==null&&n>t;n--){s=s.prev}for(;s!==null&&n>e;n--,s=s.prev){r.push(s.value)}return r};Yallist.prototype.splice=function(e,t,...r){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var n=0,s=this.head;s!==null&&n<e;n++){s=s.next}var i=[];for(var n=0;s&&n<t;n++){i.push(s.value);s=this.removeNode(s)}if(s===null){s=this.tail}if(s!==this.head&&s!==this.tail){s=s.prev}for(var n=0;n<r.length;n++){s=insert(this,s,r[n])}return i};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next;r.next=n}this.head=t;this.tail=e;return this};function insert(e,t,r){var n=t===e.head?new Node(r,null,t,e):new Node(r,t,t.next,e);if(n.next===null){e.tail=n}if(n.prev===null){e.head=n}e.length++;return n}function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,r,n){if(!(this instanceof Node)){return new Node(e,t,r,n)}this.list=n;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(r){r.prev=this;this.next=r}else{this.next=null}}try{r(49414)(Yallist)}catch(e){}},68994:(e,t,r)=>{"use strict";r.r(t);var n=r(96148);var s=r.n(n);var i=r(44101);var o=r.n(i);var a=r(87136);var c=r.n(a);var u=r(71017);var l=r.n(u);var h=r(89966);var p=r.n(h);var d=r(65656);var y=r.n(d);var g=r(89239);var v=r.n(g);var b=r(57147);var w=r.n(b);var S=r(99312);var x=r.n(S);var O=r(55255);var R=r(12781);var k=r(73837);var A=r.n(k);var P=r(22037);var C=r.n(P);const $=(0,k.promisify)(R.Stream.pipeline);async function isUrlOk(e){const t=await x().head(e).catch((e=>e));return t.statusCode===200}async function getRepoInfo(e,t){const[,r,n,s,i,...o]=e.pathname.split("/");const a=t?t.replace(/^\//,""):o.join("/");if(s===undefined||s===""&&i===undefined){const e=await x()(`https://api.github.com/repos/${r}/${n}`).catch((e=>e));if(e.statusCode!==200){return}const t=JSON.parse(e.body);return{username:r,name:n,branch:t["default_branch"],filePath:a}}const c=t?`${i}/${o.join("/")}`.replace(new RegExp(`/${a}|/$`),""):i;if(r&&n&&c&&s==="tree"){return{username:r,name:n,branch:c,filePath:a}}}function hasRepo({username:e,name:t,branch:r,filePath:n}){const s=`https://api.github.com/repos/${e}/${t}/contents`;const i=`${n?`/${n}`:""}/package.json`;return isUrlOk(s+i+`?ref=${r}`)}function existsInRepo(e){try{const t=new URL(e);return isUrlOk(t.href)}catch{return isUrlOk(`https://api.github.com/repos/vercel/next.js/contents/examples/${encodeURIComponent(e)}`)}}async function downloadTar(e){const t=(0,u.join)((0,P.tmpdir)(),`next.js-cna-example.temp-${Date.now()}`);await $(x().stream(e),(0,b.createWriteStream)(t));return t}async function downloadAndExtractRepo(e,{username:t,name:r,branch:n,filePath:s}){const i=await downloadTar(`https://codeload.github.com/${t}/${r}/tar.gz/${n}`);await O.x({file:i,cwd:e,strip:s?s.split("/").length+1:1,filter:e=>e.startsWith(`${r}-${n.replace(/\//g,"-")}${s?`/${s}/`:"/"}`)});await b.promises.unlink(i)}async function downloadAndExtractExample(e,t){if(t==="__internal-testing-retry"){throw new Error("This is an internal example for testing the CLI.")}const r=await downloadTar("https://codeload.github.com/vercel/next.js/tar.gz/canary");await O.x({file:r,cwd:e,strip:2+t.split("/").length,filter:e=>e.includes(`next.js-canary/examples/${t}/`)});await b.promises.unlink(r)}function makeDir(e,t={recursive:true}){return w().promises.mkdir(e,t)}var T=r(32081);function isInGitRepository(){try{(0,T.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(e){}return false}function isInMercurialRepository(){try{(0,T.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(e){}return false}function isDefaultBranchSet(){try{(0,T.execSync)("git config init.defaultBranch",{stdio:"ignore"});return true}catch(e){}return false}function tryGitInit(e){let t=false;try{(0,T.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,T.execSync)("git init",{stdio:"ignore"});t=true;if(!isDefaultBranchSet()){(0,T.execSync)("git checkout -b main",{stdio:"ignore"})}(0,T.execSync)("git add -A",{stdio:"ignore"});(0,T.execSync)('git commit -m "Initial commit from Create Next App"',{stdio:"ignore"});return true}catch(r){if(t){try{w().rmSync(l().join(e,".git"),{recursive:true,force:true})}catch(e){}}return false}}var j=r(9321);var I=r.n(j);function install(e,t,{packageManager:r,isOnline:n,devDependencies:i}){const o=[];const a=[];return new Promise(((c,u)=>{let l;let h=r;const p=r==="yarn";if(t&&t.length){if(p){l=["add","--exact"];if(!n)l.push("--offline");l.push("--cwd",e);if(i)l.push("--dev");l.push(...t)}else{l=["install","--save-exact"];l.push(i?"--save-dev":"--save");l.push(...t)}}else{l=["install"];if(!n){console.log(s().yellow("You appear to be offline."));if(p){console.log(s().yellow("Falling back to the local Yarn cache."));console.log();l.push("--offline")}else{console.log()}}}if(p){l.push(...a)}else{l.push(...o)}const d=I()(h,l,{stdio:"inherit",env:{...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"}});d.on("close",(e=>{if(e!==0){u({command:`${h} ${l.join(" ")}`});return}c()}))}))}function isFolderEmpty(e,t){const r=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];const n=w().readdirSync(e).filter((e=>!r.includes(e))).filter((e=>!/\.iml$/.test(e)));if(n.length>0){console.log(`The directory ${s().green(t)} contains files that could conflict:`);console.log();for(const t of n){try{const r=w().lstatSync(l().join(e,t));if(r.isDirectory()){console.log(` ${s().blue(t)}/`)}else{console.log(` ${t}`)}}catch{console.log(` ${t}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}var N=r(9523);var M=r.n(N);var D=r(57310);var L=r.n(D);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const e=(0,T.execSync)("npm config get https-proxy").toString().trim();return e!=="null"?e:undefined}catch(e){return}}function getOnline(){return new Promise((e=>{M().lookup("registry.yarnpkg.com",(t=>{if(!t){return e(true)}const r=getProxy();if(!r){return e(false)}const{hostname:n}=L().parse(r);if(!n){return e(false)}M().lookup(n,(t=>{e(t==null)}))}))}))}async function isWriteable(e){try{await w().promises.access(e,(w().constants||w()).W_OK);return true}catch(e){return false}}var B=r(55165);var U=r.n(B);var G=r(84529);var z=r.n(G);var V=r(58383);const q=A().promisify(z());const getTemplateFile=({template:e,mode:t,file:n})=>r.ab+"templates/"+e+"/"+t+"/"+n;const H=["app","pages","styles"];const installTemplate=async({appName:e,root:t,packageManager:n,isOnline:i,template:o,mode:a,tailwind:c,eslint:u,srcDir:h,importAlias:p})=>{console.log(s().bold(`Using ${n}.`));console.log("\nInitializing project with template:",o,"\n");const d=r.ab+"templates/"+o+"/"+a;const y=["**"];if(!u)y.push("!eslintrc.json");if(!c)y.push("!tailwind.config.js","!postcss.config.js");await U()(y,t,{parents:true,cwd:d,rename:e=>{switch(e){case"gitignore":case"eslintrc.json":{return".".concat(e)}case"README-template.md":{return"README.md"}default:{return e}}}});const g=l().join(t,a==="js"?"jsconfig.json":"tsconfig.json");await w().promises.writeFile(g,(await w().promises.readFile(g,"utf8")).replace(`"@/*": ["./*"]`,h?`"@/*": ["./src/*"]`:`"@/*": ["./*"]`).replace(`"@/*":`,`"${p}":`));if(p!=="@/*"){const e=await q("**/*",{cwd:t,dot:true});const r=new V.Sema(8,{capacity:e.length});await Promise.all(e.map((async e=>{if(e==="tsconfig.json"||e==="jsconfig.json")return;await r.acquire();const n=l().join(t,e);if((await w().promises.stat(n)).isFile()){await w().promises.writeFile(n,(await w().promises.readFile(n,"utf8")).replace(`@/`,`${p.replace(/\*/g,"")}`))}await r.release()})))}if(h){await makeDir(l().join(t,"src"));await Promise.all(H.map((async e=>{await w().promises.rename(l().join(t,e),l().join(t,"src",e)).catch((e=>{if(e.code!=="ENOENT"){throw e}}))})));const e=o.startsWith("app");const r=l().join("src",e?"app":"pages",`${e?"page":"index"}.${a==="ts"?"tsx":"js"}`);await w().promises.writeFile(r,(await w().promises.readFile(r,"utf8")).replace(e?"app/page":"pages/index",e?"src/app/page":"src/pages/index"));if(c){const e=l().join(t,"tailwind.config.js");await w().promises.writeFile(e,(await w().promises.readFile(e,"utf8")).replace(/\.\/(\w+)\/\*\*\/\*\.\{js,ts,jsx,tsx,mdx\}/g,"./src/$1/**/*.{js,ts,jsx,tsx,mdx}"))}}const v={name:e,version:"0.1.0",private:true,scripts:{dev:"next dev",build:"next build",start:"next start",lint:"next lint"}};w().writeFileSync(l().join(t,"package.json"),JSON.stringify(v,null,2)+C().EOL);const b={packageManager:n,isOnline:i};const S=["react","react-dom",`next${process.env.NEXT_PRIVATE_TEST_VERSION?`@${process.env.NEXT_PRIVATE_TEST_VERSION}`:""}`];if(a==="ts"){S.push("typescript","@types/react","@types/node","@types/react-dom")}if(c){S.push("tailwindcss","postcss","autoprefixer")}if(u){S.push("eslint","eslint-config-next")}if(S.length){console.log();console.log("Installing dependencies:");for(const e of S){console.log(`- ${s().cyan(e)}`)}console.log();await install(t,S,b)}};class DownloadError extends Error{}async function createApp({appPath:e,packageManager:t,example:r,examplePath:n,typescript:i,tailwind:o,eslint:a,appRouter:c,srcDir:u,importAlias:h}){let p;const d=i?"ts":"js";const y=c?o?"app-tw":"app":o?"default-tw":"default";if(r){let e;try{e=new URL(r)}catch(e){if(e.code!=="ERR_INVALID_URL"){console.error(e);process.exit(1)}}if(e){if(e.origin!=="https://github.com"){console.error(`Invalid URL: ${s().red(`"${r}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}p=await getRepoInfo(e,n);if(!p){console.error(`Found invalid GitHub URL: ${s().red(`"${r}"`)}. Please fix the URL and try again.`);process.exit(1)}const t=await hasRepo(p);if(!t){console.error(`Could not locate the repository for ${s().red(`"${r}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(r!=="__internal-testing-retry"){const e=await existsInRepo(r);if(!e){console.error(`Could not locate an example named ${s().red(`"${r}"`)}. It could be due to the following:\n`,`1. Your spelling of example ${s().red(`"${r}"`)} might be incorrect.\n`,`2. You might not be connected to the internet or you are behind a proxy.`);process.exit(1)}}}const g=l().resolve(e);if(!await isWriteable(l().dirname(g))){console.error("The application path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const b=l().basename(g);await makeDir(g);if(!isFolderEmpty(g,b)){process.exit(1)}const S=t==="yarn";const x=!S||await getOnline();const O=process.cwd();console.log(`Creating a new Next.js app in ${s().green(g)}.`);console.log();process.chdir(g);const R=l().join(g,"package.json");let k=false;if(r){try{if(p){const e=p;console.log(`Downloading files from repo ${s().cyan(r)}. This might take a moment.`);console.log();await v()((()=>downloadAndExtractRepo(g,e)),{retries:3})}else{console.log(`Downloading files for example ${s().cyan(r)}. This might take a moment.`);console.log();await v()((()=>downloadAndExtractExample(g,r)),{retries:3})}}catch(e){function isErrorLike(e){return typeof e==="object"&&e!==null&&typeof e.message==="string"}throw new DownloadError(isErrorLike(e)?e.message:e+"")}const e=l().join(g,".gitignore");if(!w().existsSync(e)){w().copyFileSync(getTemplateFile({template:y,mode:d,file:"gitignore"}),e)}const n=l().join(g,"tsconfig.json");if(w().existsSync(n)){w().copyFileSync(getTemplateFile({template:y,mode:"ts",file:"next-env.d.ts"}),l().join(g,"next-env.d.ts"))}k=w().existsSync(R);if(k){console.log("Installing packages. This might take a couple of minutes.");console.log();await install(g,null,{packageManager:t,isOnline:x});console.log()}}else{await installTemplate({appName:b,root:g,template:y,mode:d,packageManager:t,isOnline:x,tailwind:o,eslint:a,srcDir:u,importAlias:h})}if(tryGitInit(g)){console.log("Initialized a git repository.");console.log()}let A;if(l().join(O,b)===e){A=b}else{A=e}console.log(`${s().green("Success!")} Created ${b} at ${e}`);if(k){console.log("Inside that directory, you can run several commands:");console.log();console.log(s().cyan(` ${t} ${S?"":"run "}dev`));console.log(" Starts the development server.");console.log();console.log(s().cyan(` ${t} ${S?"":"run "}build`));console.log(" Builds the app for production.");console.log();console.log(s().cyan(` ${t} start`));console.log(" Runs the built app in production mode.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(s().cyan(" cd"),A);console.log(` ${s().cyan(`${t} ${S?"":"run "}dev`)}`)}console.log()}function getPkgManager(){const e=process.env.npm_config_user_agent||"";if(e.startsWith("yarn")){return"yarn"}if(e.startsWith("pnpm")){return"pnpm"}return"npm"}var W=r(42338);var K=r.n(W);function validateNpmName(e){const t=K()(e);if(t.validForNewPackages){return{valid:true}}return{valid:false,problems:[...t.errors||[],...t.warnings||[]]}}const Y=JSON.parse('{"name":"create-next-app","version":"13.4.11","keywords":["react","next","next.js"],"description":"Create Next.js-powered React apps with one command","repository":{"type":"git","url":"https://github.com/vercel/next.js","directory":"packages/create-next-app"},"author":"Next.js Team <support@vercel.com>","license":"MIT","bin":{"create-next-app":"./dist/index.js"},"files":["dist"],"scripts":{"dev":"ncc build ./index.ts -w -o dist/","prerelease":"node ../../scripts/rm.mjs dist","release":"ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register","prepublishOnly":"cd ../../ && turbo run build","build":"pnpm release","lint-fix":"pnpm prettier -w --plugin prettier-plugin-tailwindcss \'templates/*-tw/{ts,js}/{app,pages}/**/*.{js,ts,tsx}\'"},"devDependencies":{"@types/async-retry":"1.4.2","@types/ci-info":"2.0.0","@types/cross-spawn":"6.0.0","@types/glob":"7.1.1","@types/node":"^20.2.5","@types/prompts":"2.0.1","@types/tar":"6.1.5","@types/validate-npm-package-name":"3.0.0","@vercel/ncc":"0.34.0","async-retry":"1.3.1","chalk":"2.4.2","ci-info":"watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540","commander":"2.20.0","conf":"10.2.0","cpy":"7.3.0","cross-spawn":"6.0.5","glob":"8.0.3","got":"10.7.0","prettier-plugin-tailwindcss":"0.3.0","prompts":"2.1.0","tar":"6.1.15","update-check":"1.5.4","validate-npm-package-name":"3.0.0"},"engines":{"node":">=16.8.0"}}');var J=r(27741);var Z=r.n(J);let X="";const handleSigTerm=()=>process.exit(0);process.on("SIGINT",handleSigTerm);process.on("SIGTERM",handleSigTerm);const onPromptState=e=>{if(e.aborted){process.stdout.write("[?25h");process.stdout.write("\n");process.exit(1)}};const Q=new(o().Command)(Y.name).version(Y.version).arguments("<project-directory>").usage(`${s().green("<project-directory>")} [options]`).action((e=>{X=e})).option("--ts, --typescript",`\n\n Initialize as a TypeScript project. (default)\n`).option("--js, --javascript",`\n\n Initialize as a JavaScript project.\n`).option("--tailwind",`\n\n Initialize with Tailwind CSS config. (default)\n`).option("--eslint",`\n\n Initialize with eslint config.\n`).option("--app",`\n\n Initialize as an App Router project.\n`).option("--src-dir",`\n\n Initialize inside a \`src/\` directory.\n`).option("--import-alias <alias-to-configure>",`\n\n Specify import alias to use (default "@/*").\n`).option("--use-npm",`\n\n Explicitly tell the CLI to bootstrap the application using npm\n`).option("--use-pnpm",`\n\n Explicitly tell the CLI to bootstrap the application using pnpm\n`).option("--use-yarn",`\n\n Explicitly tell the CLI to bootstrap the application using Yarn\n`).option("-e, --example [name]|[github-url]",`\n\n An example to bootstrap the app with. You can use an example name\n from the official Next.js repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).option("--example-path <path-to-example>",`\n\n In a rare case, your GitHub URL might contain a branch name with\n a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).\n In this case, you must specify the path to the example separately:\n --example-path foo/bar\n`).option("--reset-preferences",`\n\n Explicitly tell the CLI to reset any stored preferences\n`).allowUnknownOption().parse(process.argv);const ee=!!Q.useNpm?"npm":!!Q.usePnpm?"pnpm":!!Q.useYarn?"yarn":getPkgManager();async function run(){const e=new(c())({projectName:"create-next-app"});if(Q.resetPreferences){e.clear();console.log(`Preferences reset successfully`);return}if(typeof X==="string"){X=X.trim()}if(!X){const e=await p()({onState:onPromptState,type:"text",name:"path",message:"What is your project named?",initial:"my-app",validate:e=>{const t=validateNpmName(l().basename(l().resolve(e)));if(t.valid){return true}return"Invalid project name: "+t.problems[0]}});if(typeof e.path==="string"){X=e.path.trim()}}if(!X){console.log("\nPlease specify the project directory:\n"+` ${s().cyan(Q.name())} ${s().green("<project-directory>")}\n`+"For example:\n"+` ${s().cyan(Q.name())} ${s().green("my-next-app")}\n\n`+`Run ${s().cyan(`${Q.name()} --help`)} to see all options.`);process.exit(1)}const t=l().resolve(X);const r=l().basename(t);const{valid:n,problems:i}=validateNpmName(r);if(!n){console.error(`Could not create a project called ${s().red(`"${r}"`)} because of npm naming restrictions:`);i.forEach((e=>console.error(` ${s().red.bold("*")} ${e}`)));process.exit(1)}if(Q.example===true){console.error("Please provide an example name or url, otherwise remove the example option.");process.exit(1)}const o=l().resolve(t);const a=l().basename(o);const u=w().existsSync(o);if(u&&!isFolderEmpty(o,a)){process.exit(1)}const h=typeof Q.example==="string"&&Q.example.trim();const d=e.get("preferences")||{};if(!h){const e={typescript:true,eslint:true,tailwind:true,srcDir:false,importAlias:"@/*",customizeImportAlias:false};const getPrefOrDefault=t=>{var r;return(r=d[t])!==null&&r!==void 0?r:e[t]};if(!Q.typescript&&!Q.javascript){if(Z().isCI){Q.typescript=false;Q.javascript=true}else{const e=s().hex("#007acc")("TypeScript");const{typescript:t}=await p()({type:"toggle",name:"typescript",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("typescript"),active:"Yes",inactive:"No"},{onCancel:()=>{console.error("Exiting.");process.exit(1)}});Q.typescript=Boolean(t);Q.javascript=!Boolean(t);d.typescript=Boolean(t)}}if(!process.argv.includes("--eslint")&&!process.argv.includes("--no-eslint")){if(Z().isCI){Q.eslint=true}else{const e=s().hex("#007acc")("ESLint");const{eslint:t}=await p()({onState:onPromptState,type:"toggle",name:"eslint",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("eslint"),active:"Yes",inactive:"No"});Q.eslint=Boolean(t);d.eslint=Boolean(t)}}if(!process.argv.includes("--tailwind")&&!process.argv.includes("--no-tailwind")){if(Z().isCI){Q.tailwind=false}else{const e=s().hex("#007acc")("Tailwind CSS");const{tailwind:t}=await p()({onState:onPromptState,type:"toggle",name:"tailwind",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("tailwind"),active:"Yes",inactive:"No"});Q.tailwind=Boolean(t);d.tailwind=Boolean(t)}}if(!process.argv.includes("--src-dir")&&!process.argv.includes("--no-src-dir")){if(Z().isCI){Q.srcDir=false}else{const e=s().hex("#007acc")("`src/` directory");const{srcDir:t}=await p()({onState:onPromptState,type:"toggle",name:"srcDir",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("srcDir"),active:"Yes",inactive:"No"});Q.srcDir=Boolean(t);d.srcDir=Boolean(t)}}if(!process.argv.includes("--app")&&!process.argv.includes("--no-app")){if(Z().isCI){Q.app=true}else{const e=s().hex("#007acc")("App Router");const{appRouter:t}=await p()({onState:onPromptState,type:"toggle",name:"appRouter",message:`Would you like to use ${e}? (recommended)`,initial:true,active:"Yes",inactive:"No"});Q.app=Boolean(t)}}if(typeof Q.importAlias!=="string"||!Q.importAlias.length){if(Z().isCI){Q.importAlias="@/*"}else{const e=s().hex("#007acc")("import alias");const{customizeImportAlias:t}=await p()({onState:onPromptState,type:"toggle",name:"customizeImportAlias",message:`Would you like to customize the default ${e}?`,initial:getPrefOrDefault("customizeImportAlias"),active:"Yes",inactive:"No"});if(!t){Q.importAlias="@/*"}else{const{importAlias:t}=await p()({onState:onPromptState,type:"text",name:"importAlias",message:`What ${e} would you like configured?`,initial:getPrefOrDefault("importAlias"),validate:e=>/.+\/\*/.test(e)?true:"Import alias must follow the pattern <prefix>/*"});Q.importAlias=t;d.importAlias=t}}}}try{await createApp({appPath:t,packageManager:ee,example:h&&h!=="default"?h:undefined,examplePath:Q.examplePath,typescript:Q.typescript,tailwind:Q.tailwind,eslint:Q.eslint,appRouter:Q.app,srcDir:Q.srcDir,importAlias:Q.importAlias})}catch(e){if(!(e instanceof DownloadError)){throw e}const r=await p()({onState:onPromptState,type:"confirm",name:"builtin",message:`Could not download "${h}" because of a connectivity issue between your machine and GitHub.\n`+`Do you want to use the default template instead?`,initial:true});if(!r.builtin){throw e}await createApp({appPath:t,packageManager:ee,typescript:Q.typescript,eslint:Q.eslint,tailwind:Q.tailwind,appRouter:Q.app,srcDir:Q.srcDir,importAlias:Q.importAlias})}e.set("preferences",d)}const te=y()(Y).catch((()=>null));async function notifyUpdate(){try{const e=await te;if(e===null||e===void 0?void 0:e.latest){const e=ee==="yarn"?"yarn global add create-next-app":ee==="pnpm"?"pnpm add -g create-next-app":"npm i -g create-next-app";console.log(s().yellow.bold("A new version of `create-next-app` is available!")+"\n"+"You can update by running: "+s().cyan(e)+"\n")}process.exit()}catch{}}run().then(notifyUpdate).catch((async e=>{console.log();console.log("Aborting installation.");if(e.command){console.log(` ${s().cyan(e.command)} has failed.`)}else{console.log(s().red("Unexpected error. Please report it as a bug:")+"\n",e)}console.log();await notifyUpdate();process.exit(1)}))},39491:e=>{"use strict";e.exports=require("assert")},14300:e=>{"use strict";e.exports=require("buffer")},32081:e=>{"use strict";e.exports=require("child_process")},22057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},82361:e=>{"use strict";e.exports=require("events")},57147:e=>{"use strict";e.exports=require("fs")},13685:e=>{"use strict";e.exports=require("http")},95687:e=>{"use strict";e.exports=require("https")},41808:e=>{"use strict";e.exports=require("net")},22037:e=>{"use strict";e.exports=require("os")},71017:e=>{"use strict";e.exports=require("path")},77282:e=>{"use strict";e.exports=require("process")},14521:e=>{"use strict";e.exports=require("readline")},12781:e=>{"use strict";e.exports=require("stream")},71576:e=>{"use strict";e.exports=require("string_decoder")},24404:e=>{"use strict";e.exports=require("tls")},76224:e=>{"use strict";e.exports=require("tty")},57310:e=>{"use strict";e.exports=require("url")},73837:e=>{"use strict";e.exports=require("util")},59796:e=>{"use strict";e.exports=require("zlib")},97918:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},39520:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},33113:e=>{"use strict";e.exports=JSON.parse('["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]')},86107:e=>{"use strict";e.exports=JSON.parse('[{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI","pr":"SYSTEM_PULLREQUEST_PULLREQUESTID"},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"GitHub Actions","constant":"GITHUB_ACTIONS","env":"GITHUB_ACTIONS","pr":{"GITHUB_EVENT_NAME":"pull_request"}},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"ZEIT Now","constant":"ZEIT_NOW","env":"NOW_BUILDER"},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Nevercode","constant":"NEVERCODE","env":"NEVERCODE","pr":{"env":"NEVERCODE_PULL_REQUEST","ne":"false"}},{"name":"Render","constant":"RENDER","env":"RENDER","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Shippable","constant":"SHIPPABLE","env":"SHIPPABLE","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Solano CI","constant":"SOLANO","env":"TDDIUM","pr":"TDDIUM_PR_ID"},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}}]')}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var s=t[r]={id:r,loaded:false,exports:{}};var i=true;try{e[r].call(s.exports,s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(68994);module.exports=r})();
|
|
325
|
+
*/e.exports=function base(e,t){if(!isObject(e)&&typeof e!=="function"){throw new TypeError("expected an object or function")}var r=isObject(t)?t:{};var n=typeof r.prop==="string"?r.prop:"fns";if(!Array.isArray(e[n])){define(e,n,[])}define(e,"use",use);define(e,"run",(function(t){if(!isObject(t))return;if(!t.use||!t.run){define(t,n,t[n]||[]);define(t,"use",use)}if(!t[n]||t[n].indexOf(base)===-1){t.use(base)}var r=this||e;var s=r[n];var i=s.length;var o=-1;while(++o<i){t.use(s[o])}return t}));function use(t,s,i){var o=1;if(typeof t==="string"||Array.isArray(t)){s=wrap(t,s);o++}else{i=s;s=t}if(typeof s!=="function"){throw new TypeError("expected a function")}var a=this||e;var c=a[n];var u=[].slice.call(arguments,o);u.unshift(a);if(typeof r.hook==="function"){r.hook.apply(a,u)}var l=s.apply(a,u);if(typeof l==="function"&&c.indexOf(l)===-1){c.push(l)}return a}function wrap(e,t){return function plugin(){return this.type===e?t.apply(this,arguments):plugin}}return e};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}function define(e,t,r){Object.defineProperty(e,t,{configurable:true,writable:true,value:r})}},42338:(e,t,r)=>{"use strict";var n=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var s=r(33113);var i=["node_modules","favicon.ico"];var o=e.exports=function(e){var t=[];var r=[];if(e===null){r.push("name cannot be null");return done(t,r)}if(e===undefined){r.push("name cannot be undefined");return done(t,r)}if(typeof e!=="string"){r.push("name must be a string");return done(t,r)}if(!e.length){r.push("name length must be greater than zero")}if(e.match(/^\./)){r.push("name cannot start with a period")}if(e.match(/^_/)){r.push("name cannot start with an underscore")}if(e.trim()!==e){r.push("name cannot contain leading or trailing spaces")}i.forEach((function(t){if(e.toLowerCase()===t){r.push(t+" is a blacklisted name")}}));s.forEach((function(r){if(e.toLowerCase()===r){t.push(r+" is a core module name")}}));if(e.length>214){t.push("name can no longer contain more than 214 characters")}if(e.toLowerCase()!==e){t.push("name can no longer contain capital letters")}if(/[~'!()*]/.test(e.split("/").slice(-1)[0])){t.push('name can no longer contain special characters ("~\'!()*")')}if(encodeURIComponent(e)!==e){var o=e.match(n);if(o){var a=o[1];var c=o[2];if(encodeURIComponent(a)===a&&encodeURIComponent(c)===c){return done(t,r)}}r.push("name can only contain URL-friendly characters")}return done(t,r)};o.scopedPackagePattern=n;var done=function(e,t){var r={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};if(!r.warnings.length)delete r.warnings;if(!r.errors.length)delete r.errors;return r}},69423:(e,t,r)=>{e.exports=which;which.sync=whichSync;var n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";var s=r(71017);var i=n?";":":";var o=r(17745);function getNotFoundError(e){var t=new Error("not found: "+e);t.code="ENOENT";return t}function getPathInfo(e,t){var r=t.colon||i;var s=t.path||process.env.PATH||"";var o=[""];s=s.split(r);var a="";if(n){s.unshift(process.cwd());a=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM";o=a.split(r);if(e.indexOf(".")!==-1&&o[0]!=="")o.unshift("")}if(e.match(/\//)||n&&e.match(/\\/))s=[""];return{env:s,ext:o,extExe:a}}function which(e,t,r){if(typeof t==="function"){r=t;t={}}var n=getPathInfo(e,t);var i=n.env;var a=n.ext;var c=n.extExe;var u=[];(function F(n,l){if(n===l){if(t.all&&u.length)return r(null,u);else return r(getNotFoundError(e))}var h=i[n];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=s.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}(function E(e,s){if(e===s)return F(n+1,l);var i=a[e];o(p+i,{pathExt:c},(function(n,o){if(!n&&o){if(t.all)u.push(p+i);else return r(null,p+i)}return E(e+1,s)}))})(0,a.length)})(0,i.length)}function whichSync(e,t){t=t||{};var r=getPathInfo(e,t);var n=r.env;var i=r.ext;var a=r.extExe;var c=[];for(var u=0,l=n.length;u<l;u++){var h=n[u];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=s.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}for(var d=0,y=i.length;d<y;d++){var g=p+i[d];var v;try{v=o.sync(g,{pathExt:a});if(v){if(t.all)c.push(g);else return g}}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw getNotFoundError(e)}},83270:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var n=e.apply(this,t);var s=t[t.length-1];if(typeof n==="function"&&n!==s){Object.keys(s).forEach((function(e){n[e]=s[e]}))}return n}}},49414:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next){yield e.value}}}},13401:(e,t,r)=>{"use strict";e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,n=arguments.length;r<n;r++){t.push(arguments[r])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var r=e.prev;if(t){t.prev=r}if(r){r.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=r}e.list.length--;e.next=null;e.prev=null;e.list=null;return t};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++){e.call(t,r.value,n,this);r=r.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--){e.call(t,r.value,n,this);r=r.prev}};Yallist.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++){r=r.next}if(t===e&&r!==null){return r.value}};Yallist.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++){r=r.prev}if(t===e&&r!==null){return r.value}};Yallist.prototype.map=function(e,t){t=t||this;var r=new Yallist;for(var n=this.head;n!==null;){r.push(e.call(t,n.value,this));n=n.next}return r};Yallist.prototype.mapReverse=function(e,t){t=t||this;var r=new Yallist;for(var n=this.tail;n!==null;){r.push(e.call(t,n.value,this));n=n.prev}return r};Yallist.prototype.reduce=function(e,t){var r;var n=this.head;if(arguments.length>1){r=t}else if(this.head){n=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var s=0;n!==null;s++){r=e(r,n.value,s);n=n.next}return r};Yallist.prototype.reduceReverse=function(e,t){var r;var n=this.tail;if(arguments.length>1){r=t}else if(this.tail){n=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var s=this.length-1;n!==null;s--){r=e(r,n.value,s);n=n.prev}return r};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=0,s=this.head;s!==null&&n<e;n++){s=s.next}for(;s!==null&&n<t;n++,s=s.next){r.push(s.value)}return r};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var n=this.length,s=this.tail;s!==null&&n>t;n--){s=s.prev}for(;s!==null&&n>e;n--,s=s.prev){r.push(s.value)}return r};Yallist.prototype.splice=function(e,t,...r){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var n=0,s=this.head;s!==null&&n<e;n++){s=s.next}var i=[];for(var n=0;s&&n<t;n++){i.push(s.value);s=this.removeNode(s)}if(s===null){s=this.tail}if(s!==this.head&&s!==this.tail){s=s.prev}for(var n=0;n<r.length;n++){s=insert(this,s,r[n])}return i};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next;r.next=n}this.head=t;this.tail=e;return this};function insert(e,t,r){var n=t===e.head?new Node(r,null,t,e):new Node(r,t,t.next,e);if(n.next===null){e.tail=n}if(n.prev===null){e.head=n}e.length++;return n}function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,r,n){if(!(this instanceof Node)){return new Node(e,t,r,n)}this.list=n;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(r){r.prev=this;this.next=r}else{this.next=null}}try{r(49414)(Yallist)}catch(e){}},68994:(e,t,r)=>{"use strict";r.r(t);var n=r(96148);var s=r.n(n);var i=r(44101);var o=r.n(i);var a=r(87136);var c=r.n(a);var u=r(71017);var l=r.n(u);var h=r(89966);var p=r.n(h);var d=r(65656);var y=r.n(d);var g=r(89239);var v=r.n(g);var b=r(57147);var w=r.n(b);var S=r(99312);var x=r.n(S);var O=r(55255);var R=r(12781);var k=r(73837);var A=r.n(k);var P=r(22037);var C=r.n(P);const $=(0,k.promisify)(R.Stream.pipeline);async function isUrlOk(e){const t=await x().head(e).catch((e=>e));return t.statusCode===200}async function getRepoInfo(e,t){const[,r,n,s,i,...o]=e.pathname.split("/");const a=t?t.replace(/^\//,""):o.join("/");if(s===undefined||s===""&&i===undefined){const e=await x()(`https://api.github.com/repos/${r}/${n}`).catch((e=>e));if(e.statusCode!==200){return}const t=JSON.parse(e.body);return{username:r,name:n,branch:t["default_branch"],filePath:a}}const c=t?`${i}/${o.join("/")}`.replace(new RegExp(`/${a}|/$`),""):i;if(r&&n&&c&&s==="tree"){return{username:r,name:n,branch:c,filePath:a}}}function hasRepo({username:e,name:t,branch:r,filePath:n}){const s=`https://api.github.com/repos/${e}/${t}/contents`;const i=`${n?`/${n}`:""}/package.json`;return isUrlOk(s+i+`?ref=${r}`)}function existsInRepo(e){try{const t=new URL(e);return isUrlOk(t.href)}catch{return isUrlOk(`https://api.github.com/repos/vercel/next.js/contents/examples/${encodeURIComponent(e)}`)}}async function downloadTar(e){const t=(0,u.join)((0,P.tmpdir)(),`next.js-cna-example.temp-${Date.now()}`);await $(x().stream(e),(0,b.createWriteStream)(t));return t}async function downloadAndExtractRepo(e,{username:t,name:r,branch:n,filePath:s}){const i=await downloadTar(`https://codeload.github.com/${t}/${r}/tar.gz/${n}`);await O.x({file:i,cwd:e,strip:s?s.split("/").length+1:1,filter:e=>e.startsWith(`${r}-${n.replace(/\//g,"-")}${s?`/${s}/`:"/"}`)});await b.promises.unlink(i)}async function downloadAndExtractExample(e,t){if(t==="__internal-testing-retry"){throw new Error("This is an internal example for testing the CLI.")}const r=await downloadTar("https://codeload.github.com/vercel/next.js/tar.gz/canary");await O.x({file:r,cwd:e,strip:2+t.split("/").length,filter:e=>e.includes(`next.js-canary/examples/${t}/`)});await b.promises.unlink(r)}function makeDir(e,t={recursive:true}){return w().promises.mkdir(e,t)}var T=r(32081);function isInGitRepository(){try{(0,T.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(e){}return false}function isInMercurialRepository(){try{(0,T.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(e){}return false}function isDefaultBranchSet(){try{(0,T.execSync)("git config init.defaultBranch",{stdio:"ignore"});return true}catch(e){}return false}function tryGitInit(e){let t=false;try{(0,T.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,T.execSync)("git init",{stdio:"ignore"});t=true;if(!isDefaultBranchSet()){(0,T.execSync)("git checkout -b main",{stdio:"ignore"})}(0,T.execSync)("git add -A",{stdio:"ignore"});(0,T.execSync)('git commit -m "Initial commit from Create Next App"',{stdio:"ignore"});return true}catch(r){if(t){try{w().rmSync(l().join(e,".git"),{recursive:true,force:true})}catch(e){}}return false}}var j=r(9321);var I=r.n(j);function install(e,t,{packageManager:r,isOnline:n,devDependencies:i}){const o=[];const a=[];return new Promise(((c,u)=>{let l;let h=r;const p=r==="yarn";if(t&&t.length){if(p){l=["add","--exact"];if(!n)l.push("--offline");l.push("--cwd",e);if(i)l.push("--dev");l.push(...t)}else{l=["install","--save-exact"];l.push(i?"--save-dev":"--save");l.push(...t)}}else{l=["install"];if(!n){console.log(s().yellow("You appear to be offline."));if(p){console.log(s().yellow("Falling back to the local Yarn cache."));console.log();l.push("--offline")}else{console.log()}}}if(p){l.push(...a)}else{l.push(...o)}const d=I()(h,l,{stdio:"inherit",env:{...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"}});d.on("close",(e=>{if(e!==0){u({command:`${h} ${l.join(" ")}`});return}c()}))}))}function isFolderEmpty(e,t){const r=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];const n=w().readdirSync(e).filter((e=>!r.includes(e))).filter((e=>!/\.iml$/.test(e)));if(n.length>0){console.log(`The directory ${s().green(t)} contains files that could conflict:`);console.log();for(const t of n){try{const r=w().lstatSync(l().join(e,t));if(r.isDirectory()){console.log(` ${s().blue(t)}/`)}else{console.log(` ${t}`)}}catch{console.log(` ${t}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}var N=r(9523);var M=r.n(N);var D=r(57310);var L=r.n(D);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const e=(0,T.execSync)("npm config get https-proxy").toString().trim();return e!=="null"?e:undefined}catch(e){return}}function getOnline(){return new Promise((e=>{M().lookup("registry.yarnpkg.com",(t=>{if(!t){return e(true)}const r=getProxy();if(!r){return e(false)}const{hostname:n}=L().parse(r);if(!n){return e(false)}M().lookup(n,(t=>{e(t==null)}))}))}))}async function isWriteable(e){try{await w().promises.access(e,(w().constants||w()).W_OK);return true}catch(e){return false}}var B=r(55165);var U=r.n(B);var G=r(84529);var z=r.n(G);var V=r(58383);const q=A().promisify(z());const getTemplateFile=({template:e,mode:t,file:n})=>r.ab+"templates/"+e+"/"+t+"/"+n;const H=["app","pages","styles"];const installTemplate=async({appName:e,root:t,packageManager:n,isOnline:i,template:o,mode:a,tailwind:c,eslint:u,srcDir:h,importAlias:p})=>{console.log(s().bold(`Using ${n}.`));console.log("\nInitializing project with template:",o,"\n");const d=r.ab+"templates/"+o+"/"+a;const y=["**"];if(!u)y.push("!eslintrc.json");if(!c)y.push("!tailwind.config.js","!postcss.config.js");await U()(y,t,{parents:true,cwd:d,rename:e=>{switch(e){case"gitignore":case"eslintrc.json":{return".".concat(e)}case"README-template.md":{return"README.md"}default:{return e}}}});const g=l().join(t,a==="js"?"jsconfig.json":"tsconfig.json");await w().promises.writeFile(g,(await w().promises.readFile(g,"utf8")).replace(`"@/*": ["./*"]`,h?`"@/*": ["./src/*"]`:`"@/*": ["./*"]`).replace(`"@/*":`,`"${p}":`));if(p!=="@/*"){const e=await q("**/*",{cwd:t,dot:true});const r=new V.Sema(8,{capacity:e.length});await Promise.all(e.map((async e=>{if(e==="tsconfig.json"||e==="jsconfig.json")return;await r.acquire();const n=l().join(t,e);if((await w().promises.stat(n)).isFile()){await w().promises.writeFile(n,(await w().promises.readFile(n,"utf8")).replace(`@/`,`${p.replace(/\*/g,"")}`))}await r.release()})))}if(h){await makeDir(l().join(t,"src"));await Promise.all(H.map((async e=>{await w().promises.rename(l().join(t,e),l().join(t,"src",e)).catch((e=>{if(e.code!=="ENOENT"){throw e}}))})));const e=o.startsWith("app");const r=l().join("src",e?"app":"pages",`${e?"page":"index"}.${a==="ts"?"tsx":"js"}`);await w().promises.writeFile(r,(await w().promises.readFile(r,"utf8")).replace(e?"app/page":"pages/index",e?"src/app/page":"src/pages/index"));if(c){const e=l().join(t,"tailwind.config.js");await w().promises.writeFile(e,(await w().promises.readFile(e,"utf8")).replace(/\.\/(\w+)\/\*\*\/\*\.\{js,ts,jsx,tsx,mdx\}/g,"./src/$1/**/*.{js,ts,jsx,tsx,mdx}"))}}const v={name:e,version:"0.1.0",private:true,scripts:{dev:"next dev",build:"next build",start:"next start",lint:"next lint"}};w().writeFileSync(l().join(t,"package.json"),JSON.stringify(v,null,2)+C().EOL);const b={packageManager:n,isOnline:i};const S=["react","react-dom",`next${process.env.NEXT_PRIVATE_TEST_VERSION?`@${process.env.NEXT_PRIVATE_TEST_VERSION}`:""}`];if(a==="ts"){S.push("typescript","@types/react","@types/node","@types/react-dom")}if(c){S.push("tailwindcss","postcss","autoprefixer")}if(u){S.push("eslint","eslint-config-next")}if(S.length){console.log();console.log("Installing dependencies:");for(const e of S){console.log(`- ${s().cyan(e)}`)}console.log();await install(t,S,b)}};class DownloadError extends Error{}async function createApp({appPath:e,packageManager:t,example:r,examplePath:n,typescript:i,tailwind:o,eslint:a,appRouter:c,srcDir:u,importAlias:h}){let p;const d=i?"ts":"js";const y=c?o?"app-tw":"app":o?"default-tw":"default";if(r){let e;try{e=new URL(r)}catch(e){if(e.code!=="ERR_INVALID_URL"){console.error(e);process.exit(1)}}if(e){if(e.origin!=="https://github.com"){console.error(`Invalid URL: ${s().red(`"${r}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}p=await getRepoInfo(e,n);if(!p){console.error(`Found invalid GitHub URL: ${s().red(`"${r}"`)}. Please fix the URL and try again.`);process.exit(1)}const t=await hasRepo(p);if(!t){console.error(`Could not locate the repository for ${s().red(`"${r}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(r!=="__internal-testing-retry"){const e=await existsInRepo(r);if(!e){console.error(`Could not locate an example named ${s().red(`"${r}"`)}. It could be due to the following:\n`,`1. Your spelling of example ${s().red(`"${r}"`)} might be incorrect.\n`,`2. You might not be connected to the internet or you are behind a proxy.`);process.exit(1)}}}const g=l().resolve(e);if(!await isWriteable(l().dirname(g))){console.error("The application path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const b=l().basename(g);await makeDir(g);if(!isFolderEmpty(g,b)){process.exit(1)}const S=t==="yarn";const x=!S||await getOnline();const O=process.cwd();console.log(`Creating a new Next.js app in ${s().green(g)}.`);console.log();process.chdir(g);const R=l().join(g,"package.json");let k=false;if(r){try{if(p){const e=p;console.log(`Downloading files from repo ${s().cyan(r)}. This might take a moment.`);console.log();await v()((()=>downloadAndExtractRepo(g,e)),{retries:3})}else{console.log(`Downloading files for example ${s().cyan(r)}. This might take a moment.`);console.log();await v()((()=>downloadAndExtractExample(g,r)),{retries:3})}}catch(e){function isErrorLike(e){return typeof e==="object"&&e!==null&&typeof e.message==="string"}throw new DownloadError(isErrorLike(e)?e.message:e+"")}const e=l().join(g,".gitignore");if(!w().existsSync(e)){w().copyFileSync(getTemplateFile({template:y,mode:d,file:"gitignore"}),e)}const n=l().join(g,"tsconfig.json");if(w().existsSync(n)){w().copyFileSync(getTemplateFile({template:y,mode:"ts",file:"next-env.d.ts"}),l().join(g,"next-env.d.ts"))}k=w().existsSync(R);if(k){console.log("Installing packages. This might take a couple of minutes.");console.log();await install(g,null,{packageManager:t,isOnline:x});console.log()}}else{await installTemplate({appName:b,root:g,template:y,mode:d,packageManager:t,isOnline:x,tailwind:o,eslint:a,srcDir:u,importAlias:h})}if(tryGitInit(g)){console.log("Initialized a git repository.");console.log()}let A;if(l().join(O,b)===e){A=b}else{A=e}console.log(`${s().green("Success!")} Created ${b} at ${e}`);if(k){console.log("Inside that directory, you can run several commands:");console.log();console.log(s().cyan(` ${t} ${S?"":"run "}dev`));console.log(" Starts the development server.");console.log();console.log(s().cyan(` ${t} ${S?"":"run "}build`));console.log(" Builds the app for production.");console.log();console.log(s().cyan(` ${t} start`));console.log(" Runs the built app in production mode.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(s().cyan(" cd"),A);console.log(` ${s().cyan(`${t} ${S?"":"run "}dev`)}`)}console.log()}function getPkgManager(){const e=process.env.npm_config_user_agent||"";if(e.startsWith("yarn")){return"yarn"}if(e.startsWith("pnpm")){return"pnpm"}return"npm"}var W=r(42338);var K=r.n(W);function validateNpmName(e){const t=K()(e);if(t.validForNewPackages){return{valid:true}}return{valid:false,problems:[...t.errors||[],...t.warnings||[]]}}const Y=JSON.parse('{"name":"create-next-app","version":"13.4.12-canary.0","keywords":["react","next","next.js"],"description":"Create Next.js-powered React apps with one command","repository":{"type":"git","url":"https://github.com/vercel/next.js","directory":"packages/create-next-app"},"author":"Next.js Team <support@vercel.com>","license":"MIT","bin":{"create-next-app":"./dist/index.js"},"files":["dist"],"scripts":{"dev":"ncc build ./index.ts -w -o dist/","prerelease":"node ../../scripts/rm.mjs dist","release":"ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register","prepublishOnly":"cd ../../ && turbo run build","build":"pnpm release","lint-fix":"pnpm prettier -w --plugin prettier-plugin-tailwindcss \'templates/*-tw/{ts,js}/{app,pages}/**/*.{js,ts,tsx}\'"},"devDependencies":{"@types/async-retry":"1.4.2","@types/ci-info":"2.0.0","@types/cross-spawn":"6.0.0","@types/glob":"7.1.1","@types/node":"^20.2.5","@types/prompts":"2.0.1","@types/tar":"6.1.5","@types/validate-npm-package-name":"3.0.0","@vercel/ncc":"0.34.0","async-retry":"1.3.1","chalk":"2.4.2","ci-info":"watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540","commander":"2.20.0","conf":"10.2.0","cpy":"7.3.0","cross-spawn":"6.0.5","glob":"8.0.3","got":"10.7.0","prettier-plugin-tailwindcss":"0.3.0","prompts":"2.1.0","tar":"6.1.15","update-check":"1.5.4","validate-npm-package-name":"3.0.0"},"engines":{"node":">=16.8.0"}}');var J=r(27741);var Z=r.n(J);let X="";const handleSigTerm=()=>process.exit(0);process.on("SIGINT",handleSigTerm);process.on("SIGTERM",handleSigTerm);const onPromptState=e=>{if(e.aborted){process.stdout.write("[?25h");process.stdout.write("\n");process.exit(1)}};const Q=new(o().Command)(Y.name).version(Y.version).arguments("<project-directory>").usage(`${s().green("<project-directory>")} [options]`).action((e=>{X=e})).option("--ts, --typescript",`\n\n Initialize as a TypeScript project. (default)\n`).option("--js, --javascript",`\n\n Initialize as a JavaScript project.\n`).option("--tailwind",`\n\n Initialize with Tailwind CSS config. (default)\n`).option("--eslint",`\n\n Initialize with eslint config.\n`).option("--app",`\n\n Initialize as an App Router project.\n`).option("--src-dir",`\n\n Initialize inside a \`src/\` directory.\n`).option("--import-alias <alias-to-configure>",`\n\n Specify import alias to use (default "@/*").\n`).option("--use-npm",`\n\n Explicitly tell the CLI to bootstrap the application using npm\n`).option("--use-pnpm",`\n\n Explicitly tell the CLI to bootstrap the application using pnpm\n`).option("--use-yarn",`\n\n Explicitly tell the CLI to bootstrap the application using Yarn\n`).option("-e, --example [name]|[github-url]",`\n\n An example to bootstrap the app with. You can use an example name\n from the official Next.js repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).option("--example-path <path-to-example>",`\n\n In a rare case, your GitHub URL might contain a branch name with\n a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).\n In this case, you must specify the path to the example separately:\n --example-path foo/bar\n`).option("--reset-preferences",`\n\n Explicitly tell the CLI to reset any stored preferences\n`).allowUnknownOption().parse(process.argv);const ee=!!Q.useNpm?"npm":!!Q.usePnpm?"pnpm":!!Q.useYarn?"yarn":getPkgManager();async function run(){const e=new(c())({projectName:"create-next-app"});if(Q.resetPreferences){e.clear();console.log(`Preferences reset successfully`);return}if(typeof X==="string"){X=X.trim()}if(!X){const e=await p()({onState:onPromptState,type:"text",name:"path",message:"What is your project named?",initial:"my-app",validate:e=>{const t=validateNpmName(l().basename(l().resolve(e)));if(t.valid){return true}return"Invalid project name: "+t.problems[0]}});if(typeof e.path==="string"){X=e.path.trim()}}if(!X){console.log("\nPlease specify the project directory:\n"+` ${s().cyan(Q.name())} ${s().green("<project-directory>")}\n`+"For example:\n"+` ${s().cyan(Q.name())} ${s().green("my-next-app")}\n\n`+`Run ${s().cyan(`${Q.name()} --help`)} to see all options.`);process.exit(1)}const t=l().resolve(X);const r=l().basename(t);const{valid:n,problems:i}=validateNpmName(r);if(!n){console.error(`Could not create a project called ${s().red(`"${r}"`)} because of npm naming restrictions:`);i.forEach((e=>console.error(` ${s().red.bold("*")} ${e}`)));process.exit(1)}if(Q.example===true){console.error("Please provide an example name or url, otherwise remove the example option.");process.exit(1)}const o=l().resolve(t);const a=l().basename(o);const u=w().existsSync(o);if(u&&!isFolderEmpty(o,a)){process.exit(1)}const h=typeof Q.example==="string"&&Q.example.trim();const d=e.get("preferences")||{};if(!h){const e={typescript:true,eslint:true,tailwind:true,srcDir:false,importAlias:"@/*",customizeImportAlias:false};const getPrefOrDefault=t=>{var r;return(r=d[t])!==null&&r!==void 0?r:e[t]};if(!Q.typescript&&!Q.javascript){if(Z().isCI){Q.typescript=false;Q.javascript=true}else{const e=s().hex("#007acc")("TypeScript");const{typescript:t}=await p()({type:"toggle",name:"typescript",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("typescript"),active:"Yes",inactive:"No"},{onCancel:()=>{console.error("Exiting.");process.exit(1)}});Q.typescript=Boolean(t);Q.javascript=!Boolean(t);d.typescript=Boolean(t)}}if(!process.argv.includes("--eslint")&&!process.argv.includes("--no-eslint")){if(Z().isCI){Q.eslint=true}else{const e=s().hex("#007acc")("ESLint");const{eslint:t}=await p()({onState:onPromptState,type:"toggle",name:"eslint",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("eslint"),active:"Yes",inactive:"No"});Q.eslint=Boolean(t);d.eslint=Boolean(t)}}if(!process.argv.includes("--tailwind")&&!process.argv.includes("--no-tailwind")){if(Z().isCI){Q.tailwind=false}else{const e=s().hex("#007acc")("Tailwind CSS");const{tailwind:t}=await p()({onState:onPromptState,type:"toggle",name:"tailwind",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("tailwind"),active:"Yes",inactive:"No"});Q.tailwind=Boolean(t);d.tailwind=Boolean(t)}}if(!process.argv.includes("--src-dir")&&!process.argv.includes("--no-src-dir")){if(Z().isCI){Q.srcDir=false}else{const e=s().hex("#007acc")("`src/` directory");const{srcDir:t}=await p()({onState:onPromptState,type:"toggle",name:"srcDir",message:`Would you like to use ${e}?`,initial:getPrefOrDefault("srcDir"),active:"Yes",inactive:"No"});Q.srcDir=Boolean(t);d.srcDir=Boolean(t)}}if(!process.argv.includes("--app")&&!process.argv.includes("--no-app")){if(Z().isCI){Q.app=true}else{const e=s().hex("#007acc")("App Router");const{appRouter:t}=await p()({onState:onPromptState,type:"toggle",name:"appRouter",message:`Would you like to use ${e}? (recommended)`,initial:true,active:"Yes",inactive:"No"});Q.app=Boolean(t)}}if(typeof Q.importAlias!=="string"||!Q.importAlias.length){if(Z().isCI){Q.importAlias="@/*"}else{const e=s().hex("#007acc")("import alias");const{customizeImportAlias:t}=await p()({onState:onPromptState,type:"toggle",name:"customizeImportAlias",message:`Would you like to customize the default ${e}?`,initial:getPrefOrDefault("customizeImportAlias"),active:"Yes",inactive:"No"});if(!t){Q.importAlias="@/*"}else{const{importAlias:t}=await p()({onState:onPromptState,type:"text",name:"importAlias",message:`What ${e} would you like configured?`,initial:getPrefOrDefault("importAlias"),validate:e=>/.+\/\*/.test(e)?true:"Import alias must follow the pattern <prefix>/*"});Q.importAlias=t;d.importAlias=t}}}}try{await createApp({appPath:t,packageManager:ee,example:h&&h!=="default"?h:undefined,examplePath:Q.examplePath,typescript:Q.typescript,tailwind:Q.tailwind,eslint:Q.eslint,appRouter:Q.app,srcDir:Q.srcDir,importAlias:Q.importAlias})}catch(e){if(!(e instanceof DownloadError)){throw e}const r=await p()({onState:onPromptState,type:"confirm",name:"builtin",message:`Could not download "${h}" because of a connectivity issue between your machine and GitHub.\n`+`Do you want to use the default template instead?`,initial:true});if(!r.builtin){throw e}await createApp({appPath:t,packageManager:ee,typescript:Q.typescript,eslint:Q.eslint,tailwind:Q.tailwind,appRouter:Q.app,srcDir:Q.srcDir,importAlias:Q.importAlias})}e.set("preferences",d)}const te=y()(Y).catch((()=>null));async function notifyUpdate(){try{const e=await te;if(e===null||e===void 0?void 0:e.latest){const e=ee==="yarn"?"yarn global add create-next-app":ee==="pnpm"?"pnpm add -g create-next-app":"npm i -g create-next-app";console.log(s().yellow.bold("A new version of `create-next-app` is available!")+"\n"+"You can update by running: "+s().cyan(e)+"\n")}process.exit()}catch{}}run().then(notifyUpdate).catch((async e=>{console.log();console.log("Aborting installation.");if(e.command){console.log(` ${s().cyan(e.command)} has failed.`)}else{console.log(s().red("Unexpected error. Please report it as a bug:")+"\n",e)}console.log();await notifyUpdate();process.exit(1)}))},39491:e=>{"use strict";e.exports=require("assert")},14300:e=>{"use strict";e.exports=require("buffer")},32081:e=>{"use strict";e.exports=require("child_process")},22057:e=>{"use strict";e.exports=require("constants")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},82361:e=>{"use strict";e.exports=require("events")},57147:e=>{"use strict";e.exports=require("fs")},13685:e=>{"use strict";e.exports=require("http")},95687:e=>{"use strict";e.exports=require("https")},41808:e=>{"use strict";e.exports=require("net")},22037:e=>{"use strict";e.exports=require("os")},71017:e=>{"use strict";e.exports=require("path")},77282:e=>{"use strict";e.exports=require("process")},14521:e=>{"use strict";e.exports=require("readline")},12781:e=>{"use strict";e.exports=require("stream")},71576:e=>{"use strict";e.exports=require("string_decoder")},24404:e=>{"use strict";e.exports=require("tls")},76224:e=>{"use strict";e.exports=require("tty")},57310:e=>{"use strict";e.exports=require("url")},73837:e=>{"use strict";e.exports=require("util")},59796:e=>{"use strict";e.exports=require("zlib")},97918:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},39520:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},33113:e=>{"use strict";e.exports=JSON.parse('["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]')},86107:e=>{"use strict";e.exports=JSON.parse('[{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI","pr":"SYSTEM_PULLREQUEST_PULLREQUESTID"},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"GitHub Actions","constant":"GITHUB_ACTIONS","env":"GITHUB_ACTIONS","pr":{"GITHUB_EVENT_NAME":"pull_request"}},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"ZEIT Now","constant":"ZEIT_NOW","env":"NOW_BUILDER"},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Nevercode","constant":"NEVERCODE","env":"NEVERCODE","pr":{"env":"NEVERCODE_PULL_REQUEST","ne":"false"}},{"name":"Render","constant":"RENDER","env":"RENDER","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Shippable","constant":"SHIPPABLE","env":"SHIPPABLE","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Solano CI","constant":"SOLANO","env":"TDDIUM","pr":"TDDIUM_PR_ID"},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}}]')}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var s=t[r]={id:r,loaded:false,exports:{}};var i=true;try{e[r].call(s.exports,s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(68994);module.exports=r})();
|