@wool-so/vue 0.0.0-stage → 1.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wool
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 CHANGED
@@ -1,3 +1,62 @@
1
- # Temporary Holding Version
1
+ # @wool-so/vue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Wool analytics for Vue and Nuxt.
4
+
5
+ Cookieless, privacy-friendly analytics for your passion projects, from [Wool](https://wool.so).
6
+ It counts pageviews (including client-side route changes), time on page, referrers and campaigns,
7
+ outbound link clicks and file downloads, sets no cookies and stores nothing in the visitor's browser.
8
+
9
+ Your **tracking key** is on your project's setup screen in the Wool dashboard.
10
+
11
+ ```bash
12
+ npm install @wool-so/vue
13
+ ```
14
+
15
+ ## Setup
16
+
17
+ As a component, in `App.vue` or a Nuxt layout:
18
+
19
+ ```vue
20
+ <script setup>
21
+ import { Analytics } from '@wool-so/vue'
22
+ </script>
23
+
24
+ <template>
25
+ <RouterView />
26
+ <Analytics tracking-key="YOUR_TRACKING_KEY" />
27
+ </template>
28
+ ```
29
+
30
+ Or as a plugin, which also gives templates `$wool.track()`:
31
+
32
+ ```ts
33
+ import { wool } from '@wool-so/vue'
34
+
35
+ createApp(App).use(wool({ trackingKey: 'YOUR_TRACKING_KEY' })).mount('#app')
36
+ ```
37
+
38
+ ## Custom events
39
+
40
+ ```ts
41
+ import { track } from '@wool-so/vue'
42
+
43
+ track('Signup')
44
+ track('Signup', { props: { plan: 'pro' } })
45
+ track('Purchase', { revenue: 29, currency: 'USD' })
46
+ ```
47
+
48
+ Up to 10 properties per event, with string, number or boolean values. Calls made before the script
49
+ has loaded are queued and sent once it has. Without any code, clicks on an element with
50
+ `data-wool-event` send that event, with its `data-wool-prop-*` attributes as properties:
51
+
52
+ ```html
53
+ <button data-wool-event="Signup" data-wool-prop-plan="pro">Get started</button>
54
+ ```
55
+
56
+ ## Options
57
+
58
+ Components take the same options as `inject()`, as props: `trackingKey`, `local`, `manual`, `outboundLinks`, `fileDownloads`, `src` and `api`. Every option, and how it works, is in [@wool-so/web](https://www.npmjs.com/package/@wool-so/web).
59
+
60
+ ## License
61
+
62
+ MIT
@@ -0,0 +1,46 @@
1
+ import { type App, type PropType } from 'vue';
2
+ import { type Options } from '@wool-so/web';
3
+ export { track, pageview, type EventOptions, type Options } from '@wool-so/web';
4
+ export declare const Analytics: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ trackingKey: {
6
+ type: StringConstructor;
7
+ required: true;
8
+ };
9
+ src: StringConstructor;
10
+ api: StringConstructor;
11
+ local: BooleanConstructor;
12
+ manual: BooleanConstructor;
13
+ outboundLinks: {
14
+ type: PropType<boolean | undefined>;
15
+ default: undefined;
16
+ };
17
+ fileDownloads: {
18
+ type: PropType<boolean | undefined>;
19
+ default: undefined;
20
+ };
21
+ }>, () => null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
22
+ trackingKey: {
23
+ type: StringConstructor;
24
+ required: true;
25
+ };
26
+ src: StringConstructor;
27
+ api: StringConstructor;
28
+ local: BooleanConstructor;
29
+ manual: BooleanConstructor;
30
+ outboundLinks: {
31
+ type: PropType<boolean | undefined>;
32
+ default: undefined;
33
+ };
34
+ fileDownloads: {
35
+ type: PropType<boolean | undefined>;
36
+ default: undefined;
37
+ };
38
+ }>> & Readonly<{}>, {
39
+ local: boolean;
40
+ manual: boolean;
41
+ outboundLinks: boolean | undefined;
42
+ fileDownloads: boolean | undefined;
43
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
44
+ export declare function wool(options: Options): {
45
+ install(app: App): void;
46
+ };
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
1
+ import { defineComponent, onMounted } from 'vue';
2
+ import { inject, pageview, track } from '@wool-so/web';
3
+ export { track, pageview } from '@wool-so/web';
4
+ // <Analytics tracking-key="…" /> once, in App.vue (or a Nuxt layout). It renders nothing.
5
+ export const Analytics = defineComponent({
6
+ name: 'WoolAnalytics',
7
+ props: {
8
+ trackingKey: { type: String, required: true },
9
+ src: String,
10
+ api: String,
11
+ local: Boolean,
12
+ manual: Boolean,
13
+ outboundLinks: { type: Boolean, default: undefined },
14
+ fileDownloads: { type: Boolean, default: undefined },
15
+ },
16
+ setup(props) {
17
+ onMounted(() => inject({ ...props }));
18
+ return () => null;
19
+ },
20
+ });
21
+ // Or as a plugin: app.use(wool({ trackingKey: '…' })), which also gives templates $wool.track().
22
+ export function wool(options) {
23
+ return {
24
+ install(app) {
25
+ app.config.globalProperties.$wool = { track, pageview };
26
+ inject(options);
27
+ },
28
+ };
29
+ }
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@wool-so/vue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Vue component and plugin for Wool, cookieless analytics for passion projects.",
5
+ "keywords": [
6
+ "analytics",
7
+ "privacy",
8
+ "cookieless",
9
+ "vue",
10
+ "nuxt",
11
+ "wool"
12
+ ],
13
+ "license": "MIT",
14
+ "homepage": "https://wool.so",
15
+ "type": "module",
16
+ "sideEffects": false,
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "main": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "scripts": {
25
+ "build": "rm -rf dist && tsc -p tsconfig.build.json"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
37
+ "dependencies": {
38
+ "@wool-so/web": "^1.0.0"
39
+ },
40
+ "peerDependencies": {
41
+ "vue": ">=3"
42
+ }
43
+ }