@vue-solana/nuxt 0.1.0
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/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/module.cjs +34 -0
- package/dist/module.d.cts +9 -0
- package/dist/module.d.mts +9 -0
- package/dist/module.d.ts +9 -0
- package/dist/module.mjs +31 -0
- package/dist/runtime/plugin.cjs +17 -0
- package/dist/runtime/plugin.d.cts +3 -0
- package/dist/runtime/plugin.d.mts +3 -0
- package/dist/runtime/plugin.d.ts +3 -0
- package/dist/runtime/plugin.mjs +15 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vue-solana
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @vue-solana/nuxt
|
|
2
|
+
|
|
3
|
+
Nuxt module for Solana applications.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @vue-solana/nuxt @vue-solana/vue @vue-solana/core @solana/web3-compat
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
export default defineNuxtConfig({
|
|
15
|
+
modules: ['@vue-solana/nuxt'],
|
|
16
|
+
solana: {
|
|
17
|
+
cluster: 'devnet'
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Known TypeScript Issue
|
|
23
|
+
|
|
24
|
+
`@solana/web3-compat@0.0.21` currently has broken TypeScript metadata. Runtime imports still use the real package, but TypeScript consumers may need a local declaration shim.
|
|
25
|
+
|
|
26
|
+
Add `types/web3-compat.d.ts` to your app if TypeScript cannot resolve `@solana/web3-compat`. See the repository README for the full workaround.
|
package/dist/module.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const kit = require('@nuxt/kit');
|
|
4
|
+
|
|
5
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
6
|
+
const module$1 = kit.defineNuxtModule({
|
|
7
|
+
meta: {
|
|
8
|
+
name: "@vue-solana/nuxt",
|
|
9
|
+
configKey: "solana"
|
|
10
|
+
},
|
|
11
|
+
defaults: {
|
|
12
|
+
cluster: "devnet",
|
|
13
|
+
autoConnect: false
|
|
14
|
+
},
|
|
15
|
+
setup(options, nuxt) {
|
|
16
|
+
const resolver = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
|
|
17
|
+
const publicConfig = nuxt.options.runtimeConfig.public;
|
|
18
|
+
publicConfig.solana = {
|
|
19
|
+
...typeof publicConfig.solana === "object" && publicConfig.solana !== null ? publicConfig.solana : {},
|
|
20
|
+
...options
|
|
21
|
+
};
|
|
22
|
+
kit.addPlugin(resolver.resolve("./runtime/plugin"));
|
|
23
|
+
kit.addImports([
|
|
24
|
+
{ name: "useBalance", as: "useSolanaBalance", from: "@vue-solana/vue" },
|
|
25
|
+
{ name: "useConnection", as: "useSolanaConnection", from: "@vue-solana/vue" },
|
|
26
|
+
{ name: "useRpc", as: "useSolanaRpc", from: "@vue-solana/vue" },
|
|
27
|
+
{ name: "useSignAndSendTransaction", as: "useSolanaSignAndSendTransaction", from: "@vue-solana/vue" },
|
|
28
|
+
{ name: "useSolana", as: "useSolana", from: "@vue-solana/vue" },
|
|
29
|
+
{ name: "useWallet", as: "useSolanaWallet", from: "@vue-solana/vue" }
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
module.exports = module$1;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
|
+
import { SolanaConfig } from '@vue-solana/core';
|
|
3
|
+
|
|
4
|
+
interface ModuleOptions extends SolanaConfig {
|
|
5
|
+
}
|
|
6
|
+
declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
+
|
|
8
|
+
export = _default;
|
|
9
|
+
export type { ModuleOptions };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
|
+
import { SolanaConfig } from '@vue-solana/core';
|
|
3
|
+
|
|
4
|
+
interface ModuleOptions extends SolanaConfig {
|
|
5
|
+
}
|
|
6
|
+
declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
+
|
|
8
|
+
export { _default as default };
|
|
9
|
+
export type { ModuleOptions };
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
|
+
import { SolanaConfig } from '@vue-solana/core';
|
|
3
|
+
|
|
4
|
+
interface ModuleOptions extends SolanaConfig {
|
|
5
|
+
}
|
|
6
|
+
declare const _default: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
+
|
|
8
|
+
export = _default;
|
|
9
|
+
export type { ModuleOptions };
|
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addImports } from '@nuxt/kit';
|
|
2
|
+
|
|
3
|
+
const module$1 = defineNuxtModule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "@vue-solana/nuxt",
|
|
6
|
+
configKey: "solana"
|
|
7
|
+
},
|
|
8
|
+
defaults: {
|
|
9
|
+
cluster: "devnet",
|
|
10
|
+
autoConnect: false
|
|
11
|
+
},
|
|
12
|
+
setup(options, nuxt) {
|
|
13
|
+
const resolver = createResolver(import.meta.url);
|
|
14
|
+
const publicConfig = nuxt.options.runtimeConfig.public;
|
|
15
|
+
publicConfig.solana = {
|
|
16
|
+
...typeof publicConfig.solana === "object" && publicConfig.solana !== null ? publicConfig.solana : {},
|
|
17
|
+
...options
|
|
18
|
+
};
|
|
19
|
+
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
20
|
+
addImports([
|
|
21
|
+
{ name: "useBalance", as: "useSolanaBalance", from: "@vue-solana/vue" },
|
|
22
|
+
{ name: "useConnection", as: "useSolanaConnection", from: "@vue-solana/vue" },
|
|
23
|
+
{ name: "useRpc", as: "useSolanaRpc", from: "@vue-solana/vue" },
|
|
24
|
+
{ name: "useSignAndSendTransaction", as: "useSolanaSignAndSendTransaction", from: "@vue-solana/vue" },
|
|
25
|
+
{ name: "useSolana", as: "useSolana", from: "@vue-solana/vue" },
|
|
26
|
+
{ name: "useWallet", as: "useSolanaWallet", from: "@vue-solana/vue" }
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('@vue-solana/vue');
|
|
4
|
+
const _app = require('#app');
|
|
5
|
+
|
|
6
|
+
const plugin = _app.defineNuxtPlugin((nuxtApp) => {
|
|
7
|
+
const config = _app.useRuntimeConfig().public.solana;
|
|
8
|
+
nuxtApp.vueApp.use(vue.createSolanaPlugin({
|
|
9
|
+
cluster: config.cluster,
|
|
10
|
+
endpoint: config.endpoint,
|
|
11
|
+
wsEndpoint: config.wsEndpoint,
|
|
12
|
+
commitment: config.commitment,
|
|
13
|
+
autoConnect: config.autoConnect
|
|
14
|
+
}));
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
module.exports = plugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createSolanaPlugin } from '@vue-solana/vue';
|
|
2
|
+
import { defineNuxtPlugin, useRuntimeConfig } from '#app';
|
|
3
|
+
|
|
4
|
+
const plugin = defineNuxtPlugin((nuxtApp) => {
|
|
5
|
+
const config = useRuntimeConfig().public.solana;
|
|
6
|
+
nuxtApp.vueApp.use(createSolanaPlugin({
|
|
7
|
+
cluster: config.cluster,
|
|
8
|
+
endpoint: config.endpoint,
|
|
9
|
+
wsEndpoint: config.wsEndpoint,
|
|
10
|
+
commitment: config.commitment,
|
|
11
|
+
autoConnect: config.autoConnect
|
|
12
|
+
}));
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { plugin as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vue-solana/nuxt",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Nuxt module for Solana applications.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"solana",
|
|
8
|
+
"nuxt",
|
|
9
|
+
"nuxt-module",
|
|
10
|
+
"vue",
|
|
11
|
+
"web3",
|
|
12
|
+
"wallet"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/vue-solana/vue-solana#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/vue-solana/vue-solana/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/vue-solana/vue-solana.git",
|
|
21
|
+
"directory": "packages/nuxt"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "./dist/module.cjs",
|
|
25
|
+
"module": "./dist/module.mjs",
|
|
26
|
+
"types": "./dist/module.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/module.d.ts",
|
|
30
|
+
"import": "./dist/module.mjs",
|
|
31
|
+
"require": "./dist/module.cjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@vue-solana/core": "0.1.0",
|
|
42
|
+
"@vue-solana/vue": "0.1.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@solana/web3-compat": "^0.0.21",
|
|
46
|
+
"nuxt": "^3.0.0 || ^4.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@nuxt/kit": "^3.17.5",
|
|
50
|
+
"@solana/web3-compat": "^0.0.21",
|
|
51
|
+
"nuxt": "^3.17.5",
|
|
52
|
+
"typescript": "^5.8.3",
|
|
53
|
+
"unbuild": "^3.5.0",
|
|
54
|
+
"vue": "^3.5.16"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "unbuild",
|
|
58
|
+
"dev": "unbuild --stub",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"clean": "rm -rf dist"
|
|
61
|
+
}
|
|
62
|
+
}
|