| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 18f8773 commit d2aa1be
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,8 +12,7 @@ const installStarterkit = (starterkit, config) => | |||
| 12 | 12 | wrapAsync(function*() { | |
| 13 | 13 | const sourceDir = config.paths.source.root; | |
| 14 | 14 | const name = starterkit.value || starterkit; | |
| 15 | - const url = name.startsWith('@pattern-lab/') ? name : `pattern-lab/${name}`; | ||
| 16 | - yield checkAndInstallPackage(name, url); | ||
| 15 | + yield checkAndInstallPackage(name); | ||
| 17 | 16 | const kitPath = path.resolve('./node_modules', name); | |
| 18 | 17 | yield copyAsync(path.resolve(kitPath, 'dist'), path.resolve(sourceDir)); | |
| 19 | 18 | let kitConfig; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -126,16 +126,15 @@ const copyWithPattern = (cwd, pattern, dest) => | |||
| 126 | 126 | * @func fetchPackage | |
| 127 | 127 | * @desc Fetches and saves packages from npm into node_modules and adds a reference in the package.json under dependencies | |
| 128 | 128 | * @param {string} packageName - The package name | |
| 129 | - * @param {string} [url] - A URL which will be used to fetch the package from | ||
| 130 | 129 | */ | |
| 131 | - const fetchPackage = (packageName, url) => | ||
| 130 | + const fetchPackage = packageName => | ||
| 132 | 131 | wrapAsync(function*() { | |
| 133 | 132 | const useYarn = hasYarn(); | |
| 134 | 133 | const pm = useYarn ? 'yarn' : 'npm'; | |
| 135 | 134 | const installCmd = useYarn ? 'add' : 'install'; | |
| 136 | 135 | try { | |
| 137 | - if (packageName || url) { | ||
| 138 | - const cmd = yield spawn(pm, [installCmd, url || packageName]); | ||
| 136 | + if (packageName) { | ||
| 137 | + const cmd = yield spawn(pm, [installCmd, packageName]); | ||
| 139 | 138 | error(cmd.stderr); | |
| 140 | 139 | } | |
| 141 | 140 | } catch (err) { | |
@@ -150,10 +149,9 @@ const fetchPackage = (packageName, url) => | |||
| 150 | 149 | * @func checkAndInstallPackage | |
| 151 | 150 | * Checks whether a package for a given packageName is installed locally. If package cannot be found, fetch and install it | |
| 152 | 151 | * @param {string} packageName - The package name | |
| 153 | - * @param {string} [url] - A URL which will be used to fetch the package from | ||
| 154 | 152 | * @return {boolean} | |
| 155 | 153 | */ | |
| 156 | - const checkAndInstallPackage = (packageName, url) => | ||
| 154 | + const checkAndInstallPackage = packageName => | ||
| 157 | 155 | wrapAsync(function*() { | |
| 158 | 156 | try { | |
| 159 | 157 | require.resolve(packageName); | |
@@ -162,7 +160,7 @@ const checkAndInstallPackage = (packageName, url) => | |||
| 162 | 160 | debug( | |
| 163 | 161 | `checkAndInstallPackage: ${packageName} not installed. Fetching it now …` | |
| 164 | 162 | ); | |
| 165 | - yield fetchPackage(packageName, url); | ||
| 163 | + yield fetchPackage(packageName); | ||
| 166 | 164 | return false; | |
| 167 | 165 | } | |
| 168 | 166 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments