nuxt-atproto 0.1.0 → 0.1.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 CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Documentation
11
11
 
12
- **[Documentation](https://dxlliv.github.io/nuxt-atproto/)** — getting started, guides, and API reference.
12
+ **[Documentation](https://nuxt-atproto.pages.dev/)** — getting started, guides, and API reference.
13
13
 
14
14
  Run the docs site locally:
15
15
 
@@ -17,7 +17,7 @@ Run the docs site locally:
17
17
  cd docs && pnpm install && pnpm dev
18
18
  ```
19
19
 
20
- Open **http://127.0.0.1:3456/nuxt-atproto/** (use `127.0.0.1`, not `localhost`, for the OAuth demo).
20
+ Open **http://127.0.0.1:3456/** (use `127.0.0.1`, not `localhost`, for the OAuth demo).
21
21
 
22
22
  ## Features
23
23
 
@@ -76,7 +76,7 @@ await agent.getTimeline()
76
76
  ```
77
77
 
78
78
  > **Client-only OAuth.** Wrap login UI in `<ClientOnly>` or disable SSR on auth routes.
79
- > See the [introduction](https://dxlliv.github.io/nuxt-atproto/getting-started/introduction) in the docs.
79
+ > See the [introduction](https://nuxt-atproto.pages.dev/getting-started/introduction) in the docs.
80
80
 
81
81
  ## Composables
82
82
 
@@ -86,7 +86,7 @@ await agent.getTimeline()
86
86
  | `useAtprotoAuth()` | `signIn`, `signInWithHandle`, `signOut`, `restore` |
87
87
  | `useAtprotoAgent(scope)` | Cached `Agent` / `AtpAgent` (`authenticated`, `public`, or custom URL) |
88
88
 
89
- `useAtproto()` and `useAgent()` are deprecated — see [Migration](https://dxlliv.github.io/nuxt-atproto/advanced/migration).
89
+ `useAtproto()` and `useAgent()` are deprecated — see [Migration](https://nuxt-atproto.pages.dev/advanced/migration).
90
90
 
91
91
  ## License
92
92
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-atproto",
3
3
  "configKey": "atproto",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -54,9 +54,7 @@ const module$1 = defineNuxtModule({
54
54
  ...config.optimizeDeps,
55
55
  include: [
56
56
  ...config.optimizeDeps?.include ?? [],
57
- "@atproto/oauth-client-browser",
58
- "@atproto/api",
59
- "core-js"
57
+ "@atproto/api"
60
58
  ],
61
59
  esbuildOptions: {
62
60
  ...config.optimizeDeps?.esbuildOptions,
@@ -93,6 +91,29 @@ const module$1 = defineNuxtModule({
93
91
  "process.env": config.define?.["process.env"] ?? {},
94
92
  "global": "globalThis"
95
93
  };
94
+ config.plugins = config.plugins ?? [];
95
+ config.plugins.push({
96
+ name: "nuxt-atproto:cjs-iso-datestring-validator",
97
+ enforce: "pre",
98
+ transform(code, id) {
99
+ if (id.includes("iso-datestring-validator") && /dist[\\/]index\.js$/.test(id.split("?")[0] ?? "")) {
100
+ return {
101
+ code: [
102
+ "const __isoDateStringExports = {};",
103
+ ";(function (exports) {",
104
+ code,
105
+ "})(__isoDateStringExports);",
106
+ "export const isValidISODateString = __isoDateStringExports.isValidISODateString;",
107
+ "export const isValidDate = __isoDateStringExports.isValidDate;",
108
+ "export const isValidTime = __isoDateStringExports.isValidTime;",
109
+ "export const isValidYearMonth = __isoDateStringExports.isValidYearMonth;",
110
+ "export default __isoDateStringExports;"
111
+ ].join("\n"),
112
+ map: null
113
+ };
114
+ }
115
+ }
116
+ });
96
117
  });
97
118
  addImportsDir(resolve("./runtime/app/composables"));
98
119
  addImportsDir(resolve("./runtime/app/utils"));
@@ -10,6 +10,10 @@ export function useAtprotoSession() {
10
10
  return serverSessionReturn;
11
11
  }
12
12
  const { $atproto } = useNuxtApp();
13
+ if (!$atproto) {
14
+ console.warn("[nuxt-atproto] $atproto is not registered on NuxtApp. Make sure the plugin is loaded.");
15
+ return serverSessionReturn;
16
+ }
13
17
  return {
14
18
  session: $atproto.session,
15
19
  isLogged: computed(() => !!$atproto.session.value),
@@ -1,7 +1,7 @@
1
1
  import type { AtprotoContext } from '../../../types/index.js';
2
- declare const _default: import("nuxt/app").Plugin<{
2
+ declare const _default: import("#app").Plugin<{
3
3
  atproto: AtprotoContext;
4
- }> & import("nuxt/app").ObjectPlugin<{
4
+ }> & import("#app").ObjectPlugin<{
5
5
  atproto: AtprotoContext;
6
6
  }>;
7
7
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-atproto",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Interact with AT Protocol and Bluesky in your Nuxt.js application",
5
5
  "keywords": [
6
6
  "nuxt",
@@ -11,8 +11,11 @@
11
11
  "authentication"
12
12
  ],
13
13
  "license": "MIT",
14
- "repository": "nuxt-atproto",
15
- "homepage": "https://github.com/dxlliv/nuxt-atproto",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/dxlliv/nuxt-atproto.git"
17
+ },
18
+ "homepage": "https://nuxt-atproto.pages.dev",
16
19
  "author": {
17
20
  "name": "dxlliv",
18
21
  "url": "https://github.com/dxlliv"
@@ -21,7 +24,8 @@
21
24
  "exports": {
22
25
  ".": {
23
26
  "types": "./dist/types.d.mts",
24
- "import": "./dist/module.mjs"
27
+ "import": "./dist/module.mjs",
28
+ "default": "./dist/module.mjs"
25
29
  }
26
30
  },
27
31
  "main": "./dist/module.mjs",