diff --git a/package-lock.json b/package-lock.json index 15c6047..dbb74ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,8 @@ "dependencies": { "@oclif/core": "^1.6.4", "@oclif/plugin-help": "^5.1.12", - "fs-extra": "^10.0.1" + "fs-extra": "^10.0.1", + "glob": "^8.1.0" }, "bin": { "laravel-jetstream-react": "bin/run" @@ -1979,6 +1980,26 @@ "node": ">=10" } }, + "node_modules/cacache/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3593,8 +3614,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "node_modules/function-bind": { "version": "1.1.1", @@ -3700,20 +3720,18 @@ } }, "node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -3730,6 +3748,25 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/globals": { "version": "13.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", @@ -4015,7 +4052,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4024,8 +4060,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/inquirer": { "version": "8.2.2", @@ -4684,9 +4719,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5002,6 +5037,26 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/node-gyp/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/node-gyp/node_modules/npmlog": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.1.tgz", @@ -5121,6 +5176,26 @@ "node": ">=10" } }, + "node_modules/npm-packlist/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/npm-pick-manifest": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz", @@ -5415,7 +5490,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "dependencies": { "wrappy": "1" } @@ -6094,6 +6168,26 @@ "universalify": "^0.1.0" } }, + "node_modules/qqjs/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/qqjs/node_modules/globby": { "version": "10.0.2", "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", @@ -6560,6 +6654,26 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -6703,6 +6817,26 @@ "node": ">=4" } }, + "node_modules/shelljs/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/shx": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.3.tgz", @@ -7222,6 +7356,26 @@ "node": ">=6" } }, + "node_modules/tmp/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/tmp/node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -7715,8 +7869,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/write-file-atomic": { "version": "3.0.3", @@ -9678,6 +9831,20 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } } } }, @@ -10921,8 +11088,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "function-bind": { "version": "1.1.1", @@ -11001,17 +11167,33 @@ } }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "glob-parent": { @@ -11238,7 +11420,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -11247,8 +11428,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "inquirer": { "version": "8.2.2", @@ -11752,9 +11932,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } @@ -11996,6 +12176,20 @@ "wide-align": "^1.1.5" } }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "npmlog": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.1.tgz", @@ -12088,6 +12282,22 @@ "ignore-walk": "^4.0.1", "npm-bundled": "^1.1.1", "npm-normalize-package-bin": "^1.0.1" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "npm-pick-manifest": { @@ -12333,7 +12543,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -12837,6 +13046,20 @@ "universalify": "^0.1.0" } }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "globby": { "version": "10.0.2", "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", @@ -13177,6 +13400,22 @@ "dev": true, "requires": { "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "run-async": { @@ -13281,6 +13520,22 @@ "glob": "^7.0.0", "interpret": "^1.0.0", "rechoir": "^0.6.2" + }, + "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "shx": { @@ -13683,6 +13938,20 @@ "rimraf": "^2.6.3" }, "dependencies": { + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -14069,8 +14338,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "3.0.3", diff --git a/package.json b/package.json index 65b0805..4673a08 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "dependencies": { "@oclif/core": "^1.6.4", "@oclif/plugin-help": "^5.1.12", - "fs-extra": "^10.0.1" + "fs-extra": "^10.0.1", + "glob": "^8.1.0" }, "devDependencies": { "@oclif/test": "^2.1.0", diff --git a/src/commands/install.ts b/src/commands/install.ts index b9e188f..299ce37 100644 --- a/src/commands/install.ts +++ b/src/commands/install.ts @@ -3,6 +3,7 @@ import { execSync } from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; import * as fse from 'fs-extra'; +import { glob } from 'glob'; export default class Install extends Command { static description = 'Replaces vue with react in a fresh installation'; @@ -18,6 +19,7 @@ export default class Install extends Command { teams: Flags.boolean({ default: false }), ssr: Flags.boolean({ default: false }), force: Flags.boolean({ default: false }), + dark: Flags.boolean({ default: false }), }; static args = []; @@ -30,21 +32,20 @@ export default class Install extends Command { '@types/react': '^18.0.25', '@types/react-dom': '^18.0.8', '@types/ziggy-js': '^1.3.0', - '@vitejs/plugin-react': '^2.0.0', + '@vitejs/plugin-react': '^2.2.0', autoprefixer: '^10.4.7', - 'laravel-vite-plugin': '^0.5.0', + 'laravel-vite-plugin': '^0.5.4', postcss: '^8.4.14', - prettier: '^2.6.2', - tailwindcss: '^3.1.0', + prettier: '^2.8.4', + tailwindcss: '^3.2.7', typescript: '^4.6.3', vite: '^3.0.0', }; private deps = { - '@headlessui/react': '^1.5.0', - '@inertiajs/inertia': '^0.11.1', - '@inertiajs/inertia-react': '^0.8.1', - '@inertiajs/progress': '^0.2.7', + '@headlessui/react': '^1.7.11', + '@inertiajs/core': '^1.0.2', + '@inertiajs/react': '^1.0.2', axios: '^0.26.1', classnames: '^2.3.1', lodash: '^4.17.21', @@ -54,10 +55,8 @@ export default class Install extends Command { }; private oldDeps = [ - '@inertiajs/inertia', - '@inertiajs/inertia-vue3', - '@inertiajs/progress', - '@inertiajs/server', + '@inertiajs/core', + '@inertiajs/vue3', '@vitejs/plugin-vue', 'laravel-vite-plugin', 'vite', @@ -161,6 +160,10 @@ export default class Install extends Command { fs.rmSync(path.join(process.cwd(), 'resources', 'js', 'ssr.tsx')); } + if (!flags.dark) { + this.removeDarkMode(); + } + this.log('Replacing app.blade.php'); this.moveStub( 'resources/views/app.blade.php', @@ -187,4 +190,20 @@ export default class Install extends Command { .map(([key, value]) => `"${key}@${value}"`) .join(' '); } + + private removeDarkMode() { + const paths = glob.sync(path.join(process.cwd(), 'resources/js/**/*.tsx')); + for (const path of paths) { + if (path.endsWith('Pages/Welcome.tsx')) { + continue; + } + + const contents = fs.readFileSync(path); + + fs.writeFileSync( + path, + contents.toString().replace(/\sdark:[^\s"']+/g, ''), + ); + } + } } diff --git a/src/stubs/resources/js/Components/ActionMessage.tsx b/src/stubs/resources/js/Components/ActionMessage.tsx index 868fe81..a76e873 100644 --- a/src/stubs/resources/js/Components/ActionMessage.tsx +++ b/src/stubs/resources/js/Components/ActionMessage.tsx @@ -19,7 +19,9 @@ export default function ActionMessage({ leave-from-class="opacity-100" leaveTo="opacity-0" > -
{children}
+
+ {children} +
); diff --git a/src/stubs/resources/js/Components/ActionSection.tsx b/src/stubs/resources/js/Components/ActionSection.tsx index 6b00126..9ae4888 100644 --- a/src/stubs/resources/js/Components/ActionSection.tsx +++ b/src/stubs/resources/js/Components/ActionSection.tsx @@ -16,7 +16,7 @@ export default function ActionSection({
-
+
{children}
diff --git a/src/stubs/resources/js/Components/ApplicationLogo.tsx b/src/stubs/resources/js/Components/ApplicationLogo.tsx index 3df2c40..a40ff88 100644 --- a/src/stubs/resources/js/Components/ApplicationLogo.tsx +++ b/src/stubs/resources/js/Components/ApplicationLogo.tsx @@ -1,10 +1,6 @@ import React from 'react'; -export default function ApplicationLogo({ - className, -}: { - className?: string; -}) { +export default function ApplicationLogo({ className }: { className?: string }) { return ( >) { return ( -
+
-
+
{children}
diff --git a/src/stubs/resources/js/Components/AuthenticationCardLogo.tsx b/src/stubs/resources/js/Components/AuthenticationCardLogo.tsx index 98851b6..2524002 100644 --- a/src/stubs/resources/js/Components/AuthenticationCardLogo.tsx +++ b/src/stubs/resources/js/Components/AuthenticationCardLogo.tsx @@ -1,9 +1,9 @@ -import { InertiaLink } from '@inertiajs/inertia-react'; +import { Link } from '@inertiajs/react'; import React from 'react'; export default function AuthenticationCardLogo() { return ( - + - + ); } diff --git a/src/stubs/resources/js/Components/Banner.tsx b/src/stubs/resources/js/Components/Banner.tsx index 20ff90f..4b9970e 100644 --- a/src/stubs/resources/js/Components/Banner.tsx +++ b/src/stubs/resources/js/Components/Banner.tsx @@ -1,11 +1,10 @@ -import { Page } from '@inertiajs/inertia'; -import { usePage } from '@inertiajs/inertia-react'; -import classNames from 'classnames'; import React, { useState } from 'react'; +import classNames from 'classnames'; +import useTypedPage from '@/Hooks/useTypedPage'; export default function Banner() { const [show, setShow] = useState(true); - const { props } = usePage>(); + const { props } = useTypedPage(); const style = props.jetstream.flash?.bannerStyle || 'success'; const message = props.jetstream.flash?.banner || ''; diff --git a/src/stubs/resources/js/Components/Checkbox.tsx b/src/stubs/resources/js/Components/Checkbox.tsx index 160af3d..7826bd6 100644 --- a/src/stubs/resources/js/Components/Checkbox.tsx +++ b/src/stubs/resources/js/Components/Checkbox.tsx @@ -12,7 +12,7 @@ export default function Checkbox( type="checkbox" {...props} className={classNames( - 'rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50', + 'rounded dark:bg-gray-900 border-gray-300 dark:border-gray-700 text-indigo-600 shadow-sm focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:focus:ring-offset-gray-800', props.className, )} /> diff --git a/src/stubs/resources/js/Components/ConfirmationModal.tsx b/src/stubs/resources/js/Components/ConfirmationModal.tsx index 0f79f74..ae9f54d 100644 --- a/src/stubs/resources/js/Components/ConfirmationModal.tsx +++ b/src/stubs/resources/js/Components/ConfirmationModal.tsx @@ -6,11 +6,11 @@ ConfirmationModal.Content = function ConfirmationModalContent({ children, }: PropsWithChildren<{ title: string }>) { return ( -
+
-

{title}

+

+ {title} +

-
{children}
+
+ {children} +
@@ -37,7 +41,11 @@ ConfirmationModal.Content = function ConfirmationModalContent({ ConfirmationModal.Footer = function ConfirmationModalFooter({ children, }: PropsWithChildren>) { - return
{children}
; + return ( +
+ {children} +
+ ); }; export default function ConfirmationModal({ diff --git a/src/stubs/resources/js/Components/DangerButton.tsx b/src/stubs/resources/js/Components/DangerButton.tsx index e135487..af18bc8 100644 --- a/src/stubs/resources/js/Components/DangerButton.tsx +++ b/src/stubs/resources/js/Components/DangerButton.tsx @@ -14,7 +14,7 @@ export default function DangerButton({ @@ -28,19 +28,19 @@ export default function DropdownLink({ return ( {children} ); default: return ( - {children} - + ); } })()} diff --git a/src/stubs/resources/js/Components/FormSection.tsx b/src/stubs/resources/js/Components/FormSection.tsx index cded306..ee7ba64 100644 --- a/src/stubs/resources/js/Components/FormSection.tsx +++ b/src/stubs/resources/js/Components/FormSection.tsx @@ -31,7 +31,7 @@ export default function FormSection({ >
{hasActions && ( -
+
{renderActions?.()}
)} diff --git a/src/stubs/resources/js/Components/InputError.tsx b/src/stubs/resources/js/Components/InputError.tsx index 29d8591..c1e1e31 100644 --- a/src/stubs/resources/js/Components/InputError.tsx +++ b/src/stubs/resources/js/Components/InputError.tsx @@ -15,7 +15,9 @@ export default function InputError({ } return (
-

{message || children}

+

+ {message || children} +

); } diff --git a/src/stubs/resources/js/Components/InputLabel.tsx b/src/stubs/resources/js/Components/InputLabel.tsx index b171615..bbe87b7 100644 --- a/src/stubs/resources/js/Components/InputLabel.tsx +++ b/src/stubs/resources/js/Components/InputLabel.tsx @@ -12,7 +12,7 @@ export default function InputLabel({ }: PropsWithChildren) { return (