rspress-plugin-vercel-analytics 0.1.4 → 0.1.5-beta.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.
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
2
  import va from '@vercel/analytics';
3
3
 
4
- export type InjectOptions = NonNullable<
5
- NonNullable<Parameters<typeof va.inject>>[0]
6
- >;
7
-
8
- export interface VercelAnalyticsProps extends InjectOptions {}
4
+ import type { VercelAnalyticsProps } from '../src/typings';
9
5
 
10
6
  const VercelAnalytics: React.FC<VercelAnalyticsProps> = (props = {}) => {
11
7
  React.useLayoutEffect(() => {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { RspressPlugin } from '@rspress/shared';
2
- import type { VercelAnalyticsProps } from './VercelAnalytics';
2
+ import type { VercelAnalyticsProps } from './typings';
3
3
  interface RspressPluginVercelAnalyticsOptions extends VercelAnalyticsProps {
4
4
  }
5
5
  export default function rspressPluginVercelAnalytics(options?: RspressPluginVercelAnalyticsOptions): RspressPlugin;
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ export default function rspressPluginVercelAnalytics(options = {}) {
7
7
  },
8
8
  globalUIComponents: [
9
9
  [
10
- path.join(__dirname, 'VercelAnalytics.tsx'),
10
+ path.join(__dirname, '../components/VercelAnalytics.tsx'),
11
11
  {
12
12
  mode: process.env.NODE_ENV === 'production'
13
13
  ? 'production'
@@ -1,7 +1,4 @@
1
- import React from 'react';
2
1
  import va from '@vercel/analytics';
3
2
  export type InjectOptions = NonNullable<NonNullable<Parameters<typeof va.inject>>[0]>;
4
3
  export interface VercelAnalyticsProps extends InjectOptions {
5
4
  }
6
- declare const VercelAnalytics: React.FC<VercelAnalyticsProps>;
7
- export default VercelAnalytics;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "rspress-plugin-vercel-analytics",
3
- "version": "0.1.4",
3
+ "version": "0.1.5-beta.0",
4
4
  "description": "Rspress plugin for vercel analytics",
5
+ "files": [
6
+ "dist",
7
+ "components"
8
+ ],
5
9
  "keywords": [
6
10
  "rspress",
7
11
  "plugin",
package/CHANGELOG.md DELETED
@@ -1,47 +0,0 @@
1
- # rspress-plugin-vercel-analytics
2
-
3
- ## 0.1.4
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [2891f27]
8
- - rspress-plugin-devkit@0.1.3
9
-
10
- ## 0.1.4-beta.0
11
-
12
- ### Patch Changes
13
-
14
- - Updated dependencies [2891f27]
15
- - rspress-plugin-devkit@0.1.3-beta.0
16
-
17
- ## 0.1.3
18
-
19
- ### Patch Changes
20
-
21
- - Updated dependencies [932dbb7]
22
- - rspress-plugin-devkit@0.1.2
23
-
24
- ## 0.1.3-beta.0
25
-
26
- ### Patch Changes
27
-
28
- - Updated dependencies [932dbb7]
29
- - rspress-plugin-devkit@0.1.2-beta.0
30
-
31
- ## 0.1.2
32
-
33
- ### Patch Changes
34
-
35
- - 546dcf0: release beta
36
- - 5e28903: fixup publish config
37
- - Updated dependencies [546dcf0]
38
- - Updated dependencies [5e28903]
39
- - rspress-plugin-devkit@0.1.1
40
-
41
- ## 0.1.2-beta.0
42
-
43
- ### Patch Changes
44
-
45
- - 546dcf0: release beta
46
- - Updated dependencies [546dcf0]
47
- - rspress-plugin-devkit@0.1.1-beta.0
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import va from '@vercel/analytics';
3
- const VercelAnalytics = (props = {}) => {
4
- React.useLayoutEffect(() => {
5
- va.inject(props);
6
- }, []);
7
- return null;
8
- };
9
- export default VercelAnalytics;
@@ -1 +0,0 @@
1
- [{"id":0,"title":"RSPress x Mermaid","content":"#\n\n","routePath":"/","lang":"","toc":[],"domain":"","frontmatter":{},"version":""}]
package/docs/index.md DELETED
@@ -1 +0,0 @@
1
- # RSPress x Vercel Analytics
package/rspress.config.ts DELETED
@@ -1,9 +0,0 @@
1
- import * as path from 'path';
2
- import { defineConfig } from 'rspress/config';
3
- import vercelAnalytics from './src';
4
-
5
- export default defineConfig({
6
- root: path.join(__dirname, 'docs'),
7
- title: 'Rspress x Vercel Analytics Example',
8
- plugins: [vercelAnalytics()],
9
- });
package/src/index.ts DELETED
@@ -1,29 +0,0 @@
1
- import path from 'node:path';
2
-
3
- import type { RspressPlugin } from '@rspress/shared';
4
- import type { VercelAnalyticsProps } from './VercelAnalytics';
5
-
6
- interface RspressPluginVercelAnalyticsOptions extends VercelAnalyticsProps {}
7
-
8
- export default function rspressPluginVercelAnalytics(
9
- options: RspressPluginVercelAnalyticsOptions = {},
10
- ): RspressPlugin {
11
- return {
12
- name: 'rspress-plugin-vercel-analytics',
13
- config(config, utils, isProd) {
14
- return config;
15
- },
16
- globalUIComponents: [
17
- [
18
- path.join(__dirname, 'VercelAnalytics.tsx'),
19
- {
20
- mode:
21
- process.env.NODE_ENV === 'production'
22
- ? 'production'
23
- : 'development',
24
- ...options,
25
- } satisfies VercelAnalyticsProps,
26
- ],
27
- ],
28
- };
29
- }
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "src",
4
- "outDir": "dist"
5
- },
6
- "include": ["src"],
7
- "extends": "../../tsconfig.base.json"
8
- }