@inglorious/create-app 1.0.2 → 1.1.1
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/README.md +23 -0
- package/bin/index.js +355 -0
- package/package.json +2 -2
- package/templates/js/index.html +4 -1
- package/templates/js/package.json +1 -0
- package/templates/js/src/store/index.js +1 -1
- package/templates/js/src/store/middlewares.js +1 -1
- package/templates/js-jsx/index.html +4 -1
- package/templates/js-jsx/package.json +1 -0
- package/templates/js-jsx/src/store/index.js +1 -1
- package/templates/js-jsx/src/store/middlewares.js +1 -1
- package/templates/js-vue/index.html +4 -1
- package/templates/js-vue/package.json +1 -0
- package/templates/js-vue/src/store/index.js +1 -1
- package/templates/js-vue/src/store/middlewares.js +1 -1
- package/templates/minimal/index.html +6 -2
- package/templates/minimal/src/store/index.js +1 -1
- package/templates/minimal/src/store/middlewares.js +1 -1
- package/templates/ssx-js/src/site.config.js +1 -0
- package/templates/ssx-ts/src/site.config.ts +1 -0
- package/templates/ts/index.html +4 -1
- package/templates/ts/package.json +1 -0
- package/templates/ts/src/store/index.ts +1 -1
- package/templates/ts/src/store/middlewares.ts +2 -1
- package/templates/ts/types/index.d.ts +1 -1
- package/templates/ts-jsx/index.html +4 -1
- package/templates/ts-jsx/package.json +1 -0
- package/templates/ts-jsx/src/store/index.ts +1 -1
- package/templates/ts-jsx/src/store/middlewares.ts +2 -1
- package/templates/ts-jsx/types/index.d.ts +2 -1
- package/templates/ts-vue/index.html +4 -1
- package/templates/ts-vue/package.json +1 -0
- package/templates/ts-vue/src/store/index.ts +1 -1
- package/templates/ts-vue/src/store/middlewares.ts +1 -1
- package/templates/ts-vue/types/index.d.ts +2 -1
package/README.md
CHANGED
|
@@ -23,6 +23,17 @@ pnpm create @inglorious/app
|
|
|
23
23
|
|
|
24
24
|
The CLI will guide you through the setup process, asking for a project name and which template you'd like to use.
|
|
25
25
|
|
|
26
|
+
For JavaScript and TypeScript Vite app templates, the CLI can also add optional app targets:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm create @inglorious/app@latest -- --pwa
|
|
30
|
+
npm create @inglorious/app@latest -- --mobile
|
|
31
|
+
npm create @inglorious/app@latest -- --pwa --mobile
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- `--pwa` adds a web app manifest, service worker, and browser-only service worker registration.
|
|
35
|
+
- `--mobile` adds Capacitor dependencies, config, and mobile scripts for iOS and Android.
|
|
36
|
+
|
|
26
37
|
## Templates
|
|
27
38
|
|
|
28
39
|
The following templates are available to get you started:
|
|
@@ -50,6 +61,18 @@ pnpm install
|
|
|
50
61
|
pnpm dev
|
|
51
62
|
```
|
|
52
63
|
|
|
64
|
+
When mobile support is enabled, build and sync native projects with:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pnpm mobile:sync
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For Android and iOS builds, install Android Studio with the Android SDK and a Java runtime compatible with Capacitor. Capacitor currently works reliably with JDK 21, so prefer JDK 21 over newer Java versions if you hit Java compatibility issues. Set `JAVA_HOME` to your JDK 21 install and `ANDROID_HOME` to your Android SDK path before running the native app. See the official Capacitor setup guides for platform-specific instructions:
|
|
71
|
+
|
|
72
|
+
- Android: https://capacitorjs.com/docs/android
|
|
73
|
+
- iOS: https://capacitorjs.com/docs/ios
|
|
74
|
+
- Android Studio: https://developer.android.com/studio
|
|
75
|
+
|
|
53
76
|
## License
|
|
54
77
|
|
|
55
78
|
**MIT License - Free and open source**
|
package/bin/index.js
CHANGED
|
@@ -9,10 +9,19 @@ import prompts from "prompts"
|
|
|
9
9
|
import { fileURLToPath } from "url"
|
|
10
10
|
|
|
11
11
|
const INDENTATION = 2
|
|
12
|
+
const CAPACITOR_VERSION = "^8.5.0"
|
|
13
|
+
const AFTER_FIRST_CHARACTER_INDEX = 1
|
|
14
|
+
const EMPTY_LENGTH = 0
|
|
15
|
+
const FIRST_CHARACTER_INDEX = 0
|
|
16
|
+
const FIRST_ITEM_INDEX = 0
|
|
17
|
+
const NPM_VIEW_TIMEOUT_MS = 10_000
|
|
18
|
+
const USER_ARG_START_INDEX = 2
|
|
19
|
+
const VITE_APP_TEMPLATES = new Set(["js", "ts"])
|
|
12
20
|
|
|
13
21
|
async function main() {
|
|
14
22
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
15
23
|
const templatesRoot = path.join(__dirname, "../templates")
|
|
24
|
+
const cliOptions = parseCliOptions(process.argv.slice(USER_ARG_START_INDEX))
|
|
16
25
|
|
|
17
26
|
let canceled = false
|
|
18
27
|
|
|
@@ -71,6 +80,8 @@ async function main() {
|
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
let renderer = "lit-html"
|
|
83
|
+
let pwa = cliOptions.pwa === true
|
|
84
|
+
let mobile = cliOptions.mobile === true
|
|
74
85
|
|
|
75
86
|
// Ask about renderer for non-minimal templates
|
|
76
87
|
if (baseTemplate !== "minimal") {
|
|
@@ -108,6 +119,48 @@ async function main() {
|
|
|
108
119
|
renderer = selectedRenderer
|
|
109
120
|
}
|
|
110
121
|
|
|
122
|
+
const supportsAppFeatures = VITE_APP_TEMPLATES.has(baseTemplate)
|
|
123
|
+
|
|
124
|
+
if (supportsAppFeatures) {
|
|
125
|
+
const featureQuestions = []
|
|
126
|
+
|
|
127
|
+
if (cliOptions.pwa === null) {
|
|
128
|
+
featureQuestions.push({
|
|
129
|
+
type: "confirm",
|
|
130
|
+
name: "pwa",
|
|
131
|
+
message: "Enable PWA support?",
|
|
132
|
+
initial: false,
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (cliOptions.mobile === null) {
|
|
137
|
+
featureQuestions.push({
|
|
138
|
+
type: "confirm",
|
|
139
|
+
name: "mobile",
|
|
140
|
+
message: "Add hybrid mobile support with Capacitor?",
|
|
141
|
+
initial: false,
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (featureQuestions.length > EMPTY_LENGTH) {
|
|
146
|
+
const answers = await prompts(featureQuestions, { onCancel })
|
|
147
|
+
|
|
148
|
+
if (canceled) {
|
|
149
|
+
console.log("Operation canceled.")
|
|
150
|
+
return
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
pwa = cliOptions.pwa === true ? true : answers.pwa === true
|
|
154
|
+
mobile = cliOptions.mobile === true ? true : answers.mobile === true
|
|
155
|
+
}
|
|
156
|
+
} else if (pwa || mobile) {
|
|
157
|
+
console.warn(
|
|
158
|
+
"PWA and mobile options are only available for JavaScript and TypeScript Vite app templates.",
|
|
159
|
+
)
|
|
160
|
+
pwa = false
|
|
161
|
+
mobile = false
|
|
162
|
+
}
|
|
163
|
+
|
|
111
164
|
const spinner = ora(`Creating project "${projectName}"...`).start()
|
|
112
165
|
|
|
113
166
|
try {
|
|
@@ -143,6 +196,16 @@ async function main() {
|
|
|
143
196
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"))
|
|
144
197
|
pkg.name = projectName
|
|
145
198
|
|
|
199
|
+
if (pwa) {
|
|
200
|
+
spinner.text = "Adding PWA support..."
|
|
201
|
+
addPwaSupport(targetDir, projectName)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (mobile) {
|
|
205
|
+
spinner.text = "Adding Capacitor support..."
|
|
206
|
+
addMobileSupport(targetDir, pkg, projectName, templateName)
|
|
207
|
+
}
|
|
208
|
+
|
|
146
209
|
for (const depType of ["dependencies", "devDependencies"]) {
|
|
147
210
|
if (pkg[depType]) {
|
|
148
211
|
for (const [name, version] of Object.entries(pkg[depType])) {
|
|
@@ -195,6 +258,7 @@ async function main() {
|
|
|
195
258
|
const version = execSync(`npm view ${packageName} version`, {
|
|
196
259
|
encoding: "utf-8",
|
|
197
260
|
stdio: "pipe", // Prevent npm view output from cluttering the console
|
|
261
|
+
timeout: NPM_VIEW_TIMEOUT_MS,
|
|
198
262
|
}).trim()
|
|
199
263
|
return `^${version}`
|
|
200
264
|
} catch {
|
|
@@ -203,6 +267,297 @@ async function main() {
|
|
|
203
267
|
}
|
|
204
268
|
}
|
|
205
269
|
|
|
270
|
+
function parseCliOptions(args) {
|
|
271
|
+
return {
|
|
272
|
+
mobile: readBooleanFlag(args, "mobile"),
|
|
273
|
+
pwa: readBooleanFlag(args, "pwa"),
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function readBooleanFlag(args, name) {
|
|
278
|
+
if (args.includes(`--${name}`)) {
|
|
279
|
+
return true
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (args.includes(`--no-${name}`)) {
|
|
283
|
+
return false
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return null
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function addPwaSupport(targetDir, projectName) {
|
|
290
|
+
const publicDir = path.join(targetDir, "public")
|
|
291
|
+
fs.mkdirSync(publicDir, { recursive: true })
|
|
292
|
+
fs.writeFileSync(path.join(publicDir, "sw.js"), createServiceWorkerSource())
|
|
293
|
+
fs.writeFileSync(
|
|
294
|
+
path.join(publicDir, "manifest.webmanifest"),
|
|
295
|
+
JSON.stringify(createWebManifest(projectName), null, INDENTATION) + EOL,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
injectPwaHeadTags(path.join(targetDir, "index.html"))
|
|
299
|
+
injectServiceWorkerRegistration(targetDir)
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function addMobileSupport(targetDir, pkg, projectName, templateName) {
|
|
303
|
+
pkg.dependencies ??= {}
|
|
304
|
+
pkg.devDependencies ??= {}
|
|
305
|
+
pkg.scripts ??= {}
|
|
306
|
+
|
|
307
|
+
pkg.dependencies["@capacitor/core"] = CAPACITOR_VERSION
|
|
308
|
+
pkg.devDependencies["@capacitor/android"] = CAPACITOR_VERSION
|
|
309
|
+
pkg.devDependencies["@capacitor/cli"] = CAPACITOR_VERSION
|
|
310
|
+
pkg.devDependencies["@capacitor/ios"] = CAPACITOR_VERSION
|
|
311
|
+
|
|
312
|
+
pkg.scripts.cap = "cap"
|
|
313
|
+
pkg.scripts["mobile:sync"] = "pnpm build && cap sync"
|
|
314
|
+
pkg.scripts["mobile:ios"] = "pnpm build && cap run ios"
|
|
315
|
+
pkg.scripts["mobile:android"] = "pnpm build && cap run android"
|
|
316
|
+
|
|
317
|
+
const extension = templateName.startsWith("ts") ? "ts" : "js"
|
|
318
|
+
fs.writeFileSync(
|
|
319
|
+
path.join(targetDir, `capacitor.config.ts`), // HACK: apparently only ts config works!
|
|
320
|
+
createCapacitorConfigSource(projectName, extension),
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
appendMobileSetupToReadme(targetDir)
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function appendMobileSetupToReadme(targetDir) {
|
|
327
|
+
const readmePath = path.join(targetDir, "README.md")
|
|
328
|
+
if (!fs.existsSync(readmePath)) {
|
|
329
|
+
return
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const readme = fs.readFileSync(readmePath, "utf-8")
|
|
333
|
+
if (readme.includes("## Mobile Setup")) {
|
|
334
|
+
return
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const mobileReadme = `
|
|
338
|
+
## Mobile Setup
|
|
339
|
+
|
|
340
|
+
This project includes Capacitor for Android and iOS support.
|
|
341
|
+
|
|
342
|
+
Please note that mobile development depends on external platform tooling that is not installed or managed by the CLI. If the app does not just work after scaffolding, it is usually because one or more native prerequisites are missing on the machine.
|
|
343
|
+
|
|
344
|
+
### Android
|
|
345
|
+
|
|
346
|
+
Before you run the native apps, make sure you have:
|
|
347
|
+
|
|
348
|
+
- Android Studio installed with the Android SDK: https://developer.android.com/studio
|
|
349
|
+
- A Java Development Kit compatible with Capacitor. Capacitor is currently known to work reliably with JDK 21, so prefer JDK 21 over newer versions if you run into Java compatibility errors.
|
|
350
|
+
- The SDK path available via ANDROID_HOME (for example, on macOS this is often $HOME/Library/Android/sdk)
|
|
351
|
+
|
|
352
|
+
On macOS, the following shell variables are commonly needed:
|
|
353
|
+
|
|
354
|
+
\`\`\`bash
|
|
355
|
+
export JAVA_HOME="/path/to/jdk-21"
|
|
356
|
+
export ANDROID_HOME="$HOME/Library/Android/sdk"
|
|
357
|
+
export PATH="$ANDROID_HOME/platform-tools:$PATH"
|
|
358
|
+
\`\`\`
|
|
359
|
+
|
|
360
|
+
### iOS
|
|
361
|
+
|
|
362
|
+
For iOS you also need the Apple toolchain and device setup on a Mac:
|
|
363
|
+
|
|
364
|
+
- Xcode from the App Store
|
|
365
|
+
- iOS development tools and simulator components (this can be very large, often multiple GB)
|
|
366
|
+
- A valid Apple Developer team / signing identity in Xcode
|
|
367
|
+
- Device trust setup for your iPhone in Settings > General > VPN & Device Management
|
|
368
|
+
|
|
369
|
+
The most common first-time setup commands are:
|
|
370
|
+
|
|
371
|
+
\`\`\`bash
|
|
372
|
+
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
|
|
373
|
+
sudo xcodebuild -license accept
|
|
374
|
+
\`\`\`
|
|
375
|
+
|
|
376
|
+
If you are using a physical device, you may also need to approve the developer certificate on the device and ensure the app is signed with a valid team.
|
|
377
|
+
|
|
378
|
+
### Official resources
|
|
379
|
+
|
|
380
|
+
- Android: https://capacitorjs.com/docs/android
|
|
381
|
+
- iOS: https://capacitorjs.com/docs/ios
|
|
382
|
+
- Android Studio: https://developer.android.com/studio
|
|
383
|
+
- Xcode: https://developer.apple.com/xcode/
|
|
384
|
+
|
|
385
|
+
Then sync and open the native project:
|
|
386
|
+
|
|
387
|
+
\`\`\`bash
|
|
388
|
+
pnpm mobile:sync
|
|
389
|
+
pnpm mobile:android
|
|
390
|
+
# or
|
|
391
|
+
pnpm mobile:ios
|
|
392
|
+
\`\`\`
|
|
393
|
+
`
|
|
394
|
+
|
|
395
|
+
fs.writeFileSync(
|
|
396
|
+
readmePath,
|
|
397
|
+
`${readme.trimEnd()}${EOL}${EOL}${mobileReadme.trim()}${EOL}`,
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function createServiceWorkerSource() {
|
|
402
|
+
return `const CACHE_NAME = "inglorious-app-v1"
|
|
403
|
+
const APP_SHELL = ["/", "/index.html", "/logo.png", "/style.css"]
|
|
404
|
+
|
|
405
|
+
self.addEventListener("install", (event) => {
|
|
406
|
+
event.waitUntil(
|
|
407
|
+
caches.open(CACHE_NAME).then((cache) => cache.addAll(APP_SHELL)),
|
|
408
|
+
)
|
|
409
|
+
self.skipWaiting()
|
|
410
|
+
})
|
|
411
|
+
|
|
412
|
+
self.addEventListener("activate", (event) => {
|
|
413
|
+
event.waitUntil(
|
|
414
|
+
caches
|
|
415
|
+
.keys()
|
|
416
|
+
.then((keys) =>
|
|
417
|
+
Promise.all(keys.map((key) => key === CACHE_NAME ? null : caches.delete(key))),
|
|
418
|
+
),
|
|
419
|
+
)
|
|
420
|
+
self.clients.claim()
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
self.addEventListener("fetch", (event) => {
|
|
424
|
+
if (event.request.method !== "GET") {
|
|
425
|
+
return
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
event.respondWith(
|
|
429
|
+
caches.match(event.request).then((cachedResponse) => {
|
|
430
|
+
if (cachedResponse) {
|
|
431
|
+
return cachedResponse
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
return fetch(event.request).catch(() => {
|
|
435
|
+
if (event.request.mode === "navigate") {
|
|
436
|
+
return caches.match("/index.html")
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
throw new Error("Network request failed")
|
|
440
|
+
})
|
|
441
|
+
}),
|
|
442
|
+
)
|
|
443
|
+
})
|
|
444
|
+
`
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function createWebManifest(projectName) {
|
|
448
|
+
return {
|
|
449
|
+
name: projectName,
|
|
450
|
+
short_name: projectName,
|
|
451
|
+
description: "An Inglorious Web app.",
|
|
452
|
+
start_url: "/",
|
|
453
|
+
display: "standalone",
|
|
454
|
+
background_color: "#ffffff",
|
|
455
|
+
theme_color: "#111827",
|
|
456
|
+
icons: [
|
|
457
|
+
{
|
|
458
|
+
src: "/logo.png",
|
|
459
|
+
sizes: "192x192",
|
|
460
|
+
type: "image/png",
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
src: "/logo.png",
|
|
464
|
+
sizes: "512x512",
|
|
465
|
+
type: "image/png",
|
|
466
|
+
},
|
|
467
|
+
],
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function injectPwaHeadTags(indexPath) {
|
|
472
|
+
let index = fs.readFileSync(indexPath, "utf-8")
|
|
473
|
+
|
|
474
|
+
if (!index.includes('rel="manifest"')) {
|
|
475
|
+
index = index.replace(
|
|
476
|
+
/^([ \t]*<link rel="icon"[^>]*>\r?\n)/m,
|
|
477
|
+
`$1 <link rel="manifest" href="/manifest.webmanifest" />${EOL}`,
|
|
478
|
+
)
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if (!index.includes('name="theme-color"')) {
|
|
482
|
+
index = index.replace(
|
|
483
|
+
/^([ \t]*<meta name="viewport"[^>]*>\r?\n)/m,
|
|
484
|
+
`$1 <meta name="theme-color" content="#111827" />${EOL}`,
|
|
485
|
+
)
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
fs.writeFileSync(indexPath, index)
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function injectServiceWorkerRegistration(targetDir) {
|
|
492
|
+
const mainPath = findMainPath(targetDir)
|
|
493
|
+
|
|
494
|
+
if (!mainPath) {
|
|
495
|
+
return
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
let main = fs.readFileSync(mainPath, "utf-8")
|
|
499
|
+
|
|
500
|
+
if (!main.includes("@inglorious/web/mobile")) {
|
|
501
|
+
main = main.replace(
|
|
502
|
+
/^([ \t]*import \{ mount \} from "@inglorious\/web"\r?\n)/m,
|
|
503
|
+
(match) =>
|
|
504
|
+
`${match}import { isNative } from "@inglorious/web/mobile"${EOL}`,
|
|
505
|
+
)
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (!main.includes('navigator.serviceWorker.register("/sw.js")')) {
|
|
509
|
+
main = `${main.trimEnd()}${EOL}${EOL}if (!isNative() && "serviceWorker" in navigator) {
|
|
510
|
+
navigator.serviceWorker.register("/sw.js")
|
|
511
|
+
}${EOL}`
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
fs.writeFileSync(mainPath, main)
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function findMainPath(targetDir) {
|
|
518
|
+
const candidates = [
|
|
519
|
+
path.join(targetDir, "src/main.ts"),
|
|
520
|
+
path.join(targetDir, "src/main.js"),
|
|
521
|
+
]
|
|
522
|
+
|
|
523
|
+
return candidates.find((candidate) => fs.existsSync(candidate)) ?? null
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function createCapacitorConfigSource(projectName /* , extension */) {
|
|
527
|
+
const appId = `com.inglorious.${toJavaIdentifier(projectName)}`
|
|
528
|
+
|
|
529
|
+
//if (extension === "ts") { // HACK: apparently only ts config files work!
|
|
530
|
+
return `import type { CapacitorConfig } from "@capacitor/cli"
|
|
531
|
+
|
|
532
|
+
const config: CapacitorConfig = {
|
|
533
|
+
appId: "${appId}",
|
|
534
|
+
appName: "${projectName}",
|
|
535
|
+
webDir: "dist",
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export default config
|
|
539
|
+
`
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function toJavaIdentifier(value) {
|
|
543
|
+
const identifier = value
|
|
544
|
+
.toLowerCase()
|
|
545
|
+
.replace(/[^a-z0-9]+/g, " ")
|
|
546
|
+
.trim()
|
|
547
|
+
.split(" ")
|
|
548
|
+
.filter(Boolean)
|
|
549
|
+
.map((part, index) =>
|
|
550
|
+
index === FIRST_ITEM_INDEX
|
|
551
|
+
? part
|
|
552
|
+
: part.charAt(FIRST_CHARACTER_INDEX).toUpperCase() +
|
|
553
|
+
part.slice(AFTER_FIRST_CHARACTER_INDEX),
|
|
554
|
+
)
|
|
555
|
+
.join("")
|
|
556
|
+
.replace(/^[^a-z]+/, "")
|
|
557
|
+
|
|
558
|
+
return identifier || "app"
|
|
559
|
+
}
|
|
560
|
+
|
|
206
561
|
main().catch((e) => {
|
|
207
562
|
console.error(e)
|
|
208
563
|
})
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/create-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A scaffolding tool to quickly create a new app with Inglorious Web.",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "Matteo Antony Mistretta <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
package/templates/js/index.html
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
8
|
+
/>
|
|
6
9
|
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
10
|
<link rel="stylesheet" href="/style.css" />
|
|
8
11
|
<title>Inglorious App</title>
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
8
|
+
/>
|
|
6
9
|
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
10
|
<link rel="stylesheet" href="/style.css" />
|
|
8
11
|
<title>Inglorious App</title>
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
8
|
+
/>
|
|
6
9
|
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
10
|
<link rel="stylesheet" href="/style.css" />
|
|
8
11
|
<title>Inglorious App</title>
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/public/logo.png" />
|
|
6
6
|
<link rel="stylesheet" href="/public/style.css" />
|
|
7
|
-
<meta
|
|
7
|
+
<meta
|
|
8
|
+
name="viewport"
|
|
9
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
10
|
+
/>
|
|
8
11
|
<title>Inglorious App</title>
|
|
9
12
|
</head>
|
|
10
13
|
|
|
@@ -24,7 +27,8 @@
|
|
|
24
27
|
"@inglorious/utils/": "https://unpkg.com/@inglorious%2Futils@latest/src/",
|
|
25
28
|
"@inglorious/store": "https://unpkg.com/@inglorious%2Fstore@latest/src/store.js",
|
|
26
29
|
"@inglorious/store/": "https://unpkg.com/@inglorious%2Fstore@latest/src/",
|
|
27
|
-
"@inglorious/web": "https://unpkg.com/@inglorious%2Fweb@latest/src/index.js"
|
|
30
|
+
"@inglorious/web": "https://unpkg.com/@inglorious%2Fweb@latest/src/index.js",
|
|
31
|
+
"@inglorious/web/": "https://unpkg.com/@inglorious%2Fweb@latest/src/"
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
</script>
|
package/templates/ts/index.html
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
8
|
+
/>
|
|
6
9
|
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
10
|
<link rel="stylesheet" href="/style.css" />
|
|
8
11
|
<title>Inglorious App</title>
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
8
|
+
/>
|
|
6
9
|
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
10
|
<link rel="stylesheet" href="/style.css" />
|
|
8
11
|
<title>Inglorious App</title>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./vite-end"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { BaseEntity, EntitiesState } from "@inglorious/store"
|
|
4
|
+
import { Api, TemplateResult } from "@inglorious/web"
|
|
4
5
|
|
|
5
6
|
// Define your entity types
|
|
6
7
|
export interface MessageEntity extends BaseEntity {
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta
|
|
5
|
+
<meta
|
|
6
|
+
name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
8
|
+
/>
|
|
6
9
|
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
10
|
<link rel="stylesheet" href="/style.css" />
|
|
8
11
|
<title>Inglorious App</title>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./vite-end"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { BaseEntity, EntitiesState } from "@inglorious/store"
|
|
4
|
+
import { Api, TemplateResult } from "@inglorious/web"
|
|
4
5
|
|
|
5
6
|
// Define your entity types
|
|
6
7
|
export interface MessageEntity extends BaseEntity {
|