create-lupine 1.0.8 → 1.0.10

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/index.js CHANGED
@@ -4,6 +4,20 @@ import fs from 'node:fs';
4
4
  import path from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import crypto from 'node:crypto';
7
+ import { execSync } from 'node:child_process';
8
+
9
+ function getLatestVersion(pkgName, fallback) {
10
+ try {
11
+ const version = execSync(`npm view ${pkgName} version`, {
12
+ encoding: 'utf8',
13
+ stdio: ['ignore', 'pipe', 'ignore'],
14
+ timeout: 3000,
15
+ }).trim();
16
+ return version ? `^${version}` : fallback;
17
+ } catch (e) {
18
+ return fallback;
19
+ }
20
+ }
7
21
 
8
22
  function generateRandomString(length) {
9
23
  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_!@&?-#$';
@@ -183,15 +197,21 @@ async function init() {
183
197
  },
184
198
  };
185
199
 
200
+ console.log('Fetching latest versions...');
201
+ const latestApi = getLatestVersion('lupine.api', '^1.0.1');
202
+ const latestWeb = getLatestVersion('lupine.web', '^1.0.1');
203
+ const latestComponents = getLatestVersion('lupine.components', '^1.0.1');
204
+ const latestPress = getLatestVersion('lupine.press', '^1.0.1');
205
+
186
206
  pkg.dependencies = {
187
- 'lupine.api': '^1.0.1',
188
- 'lupine.components': '^1.0.1',
189
- 'lupine.web': '^1.0.1',
207
+ 'lupine.api': latestApi,
208
+ 'lupine.components': latestComponents,
209
+ 'lupine.web': latestWeb,
190
210
  };
191
211
 
192
212
  const templateObj = TEMPLATES.find((t) => t.name === template);
193
213
  if (templateObj && templateObj.needsPress) {
194
- pkg.dependencies['lupine.press'] = '^1.0.1';
214
+ pkg.dependencies['lupine.press'] = latestPress;
195
215
  pkg.devDependencies['gray-matter'] = '^4.0.3';
196
216
  pkg.devDependencies['marked'] = '^17.0.1';
197
217
  pkg.scripts['cp-docs'] = `node dev/cp-folder.js dist/server_root/${appName}_web/github-pj-name docs`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-lupine",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Scaffolding tool for Lupine.js projects",
5
5
  "bin": {
6
6
  "create-lupine": "index.js"
@@ -35,3 +35,7 @@ A problem-solver at heart with strong collaborative and communication skills. Co
35
35
  - **Location**: Auckland / Remote
36
36
  - **Availability**: 4 weeks notice
37
37
  - **Visa Status**: NZ Resident / Work Visa
38
+
39
+ ---
40
+
41
+ Powered by [Lupine.js](https://github.com/uuware/lupine.js). If you find this template helpful, a star on GitHub is always appreciated ⭐️
@@ -35,3 +35,7 @@ sidebar:
35
35
  - **期望城市**: 上海 / 杭州 / 远程
36
36
  - **期望薪资**: 面议
37
37
  - **目前状态**: 随时到岗
38
+
39
+ ---
40
+
41
+ Powered by [Lupine.js](https://github.com/uuware/lupine.js). 如果本模版对您有帮助,欢迎在 GitHub 上送我们一颗星 ⭐️
@@ -16,3 +16,5 @@
16
16
  <li><strong>Availability</strong>: 4 weeks notice</li>
17
17
  <li><strong>Visa Status</strong>: NZ Resident / Work Visa</li>
18
18
  </ul>
19
+ <hr>
20
+ <p>Powered by <a href="https://github.com/uuware/lupine.js">Lupine.js</a>. If you find this template helpful, a star on GitHub is always appreciated ⭐️</p>
@@ -16,3 +16,5 @@
16
16
  <li><strong>期望薪资</strong>: 面议</li>
17
17
  <li><strong>目前状态</strong>: 随时到岗</li>
18
18
  </ul>
19
+ <hr>
20
+ <p>Powered by <a href="https://github.com/uuware/lupine.js">Lupine.js</a>. 如果本模版对您有帮助,欢迎在 GitHub 上送我们一颗星 ⭐️</p>