@develate/quasar-ext-utils 0.0.2
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 +33 -0
- package/package.json +31 -0
- package/src/index.ts +46 -0
- package/src/install.ts +18 -0
- package/src/runtime/MyComponent.vue +16 -0
- package/src/runtime/boot.register.ts +6 -0
- package/src/runtime/env.d.ts +15 -0
- package/src/runtime/shims-vue.d.ts +5 -0
- package/src/templates/.gitkeep +0 -0
- package/src/uninstall.ts +9 -0
- package/tsconfig.json +23 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# `@develate/quasar-ext-utils`
|
|
2
|
+
|
|
3
|
+
A Quasar App Extension with shared Quasar/Vue utilities and development helpers.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
quasar ext add @develate/quasar-ext-utils
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Uninstall
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
quasar ext remove @develate/quasar-ext-utils
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Local network development
|
|
18
|
+
|
|
19
|
+
Pass `--ni` to a development run to bind Quasar to the current local IPv4
|
|
20
|
+
address. The extra `--` is required because Quasar does not accept extension
|
|
21
|
+
specific top-level options:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
quasar dev -- --ni
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The extension prefers private LAN addresses (`10.x.x.x`, `192.168.x.x`, or
|
|
28
|
+
`172.16.x.x` through `172.31.x.x`) and falls back to another non-internal IPv4
|
|
29
|
+
address or `localhost`.
|
|
30
|
+
|
|
31
|
+
## Donate
|
|
32
|
+
|
|
33
|
+
If you appreciate the work that went into this App Extension, please consider [donating to Quasar](https://donate.quasar.dev).
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@develate/quasar-ext-utils",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "A Quasar App Extension",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"quasar",
|
|
7
|
+
"quasar-app-extension",
|
|
8
|
+
"quasar-app-vite",
|
|
9
|
+
"quasar-cli",
|
|
10
|
+
"vue",
|
|
11
|
+
"vuejs"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "Thorsten <tk@programmierung.deutschehandarbeit.de>",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "src/index.ts",
|
|
17
|
+
"imports": {
|
|
18
|
+
"#q-app": "@quasar/app-vite"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@quasar/app-vite": "^3.7.0",
|
|
22
|
+
"quasar": "^2.25.1",
|
|
23
|
+
"vue": "^3.5.39"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@quasar/app-vite": "^3.5.0"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">= 26 || ^24 || ^22.12"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quasar App Extension index/runner script
|
|
3
|
+
* (runs on each dev/build)
|
|
4
|
+
*
|
|
5
|
+
* Docs: https://quasar.dev/app-extensions/development-guide/index-api
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import os from "node:os";
|
|
9
|
+
import { defineIndexScript } from "#q-app";
|
|
10
|
+
|
|
11
|
+
function getLocalIp() {
|
|
12
|
+
const addresses = Object.values(os.networkInterfaces())
|
|
13
|
+
.flatMap(networkInterface => networkInterface ?? [])
|
|
14
|
+
.filter(addr => addr.family === "IPv4" && !addr.internal);
|
|
15
|
+
|
|
16
|
+
// Prefer actual LAN/private addresses over VPNs such as Tailscale.
|
|
17
|
+
const lan = addresses.find(
|
|
18
|
+
({ address }) =>
|
|
19
|
+
address.startsWith("10.") ||
|
|
20
|
+
address.startsWith("192.168.") ||
|
|
21
|
+
/^172\.(1[6-9]|2\d|3[01])\./.test(address)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return lan?.address ?? addresses[0]?.address ?? "localhost";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// can be async
|
|
28
|
+
export default defineIndexScript(api => {
|
|
29
|
+
api.extendQuasarConf(() => ({
|
|
30
|
+
boot: [
|
|
31
|
+
"~@develate/quasar-app-extension-quasar-ext-utils/src/runtime/boot.register.ts"
|
|
32
|
+
]
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
api.extendQuasarConf((_, extensionApi) => {
|
|
36
|
+
if (!extensionApi.ctx.dev || !process.argv.includes("--ni")) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
devServer: {
|
|
42
|
+
host: getLocalIp()
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
});
|
package/src/install.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quasar App Extension install script
|
|
3
|
+
* https://quasar.dev/app-extensions/development-guide/install-api
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { defineInstallScript } from "#q-app";
|
|
7
|
+
|
|
8
|
+
// can be async
|
|
9
|
+
export default defineInstallScript(api => {
|
|
10
|
+
api.extendPackageJson({
|
|
11
|
+
scripts: {
|
|
12
|
+
pull: "git pull --rebase --autostash && npm run setup",
|
|
13
|
+
setup: "npm install && npm install --prefix src-capacitor",
|
|
14
|
+
"build-ios": "quasar build -m capacitor -T ios --ide",
|
|
15
|
+
"dev-ios": "quasar dev -m capacitor -T ios"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="my-component">
|
|
3
|
+
<div>My Component</div>
|
|
4
|
+
<div>This is a simple Vue component.</div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
//
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<style lang="sass">
|
|
13
|
+
.my-component
|
|
14
|
+
> div:first-child
|
|
15
|
+
font-weight: bold
|
|
16
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="@quasar/app-vite/client" />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Uncomment and add types for your custom environment
|
|
5
|
+
* variables to avoid TypeScript errors
|
|
6
|
+
* when using them via import.meta.env.VARIABLE_NAME
|
|
7
|
+
*
|
|
8
|
+
* Example:
|
|
9
|
+
*
|
|
10
|
+
* interface ImportMetaEnv {
|
|
11
|
+
* readonly MY_VAR: string
|
|
12
|
+
* readonly MY_OTHER_VAR: boolean
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
// interface ImportMetaEnv {}
|
|
File without changes
|
package/src/uninstall.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"esModuleInterop": true,
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"moduleDetection": "force",
|
|
9
|
+
"moduleResolution": "bundler",
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"module": "preserve",
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"lib": ["esnext", "dom", "dom.iterable"],
|
|
14
|
+
"strict": true,
|
|
15
|
+
"allowUnreachableCode": false,
|
|
16
|
+
"allowUnusedLabels": false,
|
|
17
|
+
"noImplicitOverride": true,
|
|
18
|
+
"exactOptionalPropertyTypes": true,
|
|
19
|
+
"noUncheckedIndexedAccess": true
|
|
20
|
+
},
|
|
21
|
+
"include": ["./src/**/*"],
|
|
22
|
+
"exclude": ["./node_modules"]
|
|
23
|
+
}
|