nuxt-atproto 0.1.1 → 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/dist/module.mjs CHANGED
@@ -54,7 +54,6 @@ const module$1 = defineNuxtModule({
54
54
  ...config.optimizeDeps,
55
55
  include: [
56
56
  ...config.optimizeDeps?.include ?? [],
57
- "@atproto/oauth-client-browser",
58
57
  "@atproto/api"
59
58
  ],
60
59
  esbuildOptions: {
@@ -92,6 +91,29 @@ const module$1 = defineNuxtModule({
92
91
  "process.env": config.define?.["process.env"] ?? {},
93
92
  "global": "globalThis"
94
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
+ });
95
117
  });
96
118
  addImportsDir(resolve("./runtime/app/composables"));
97
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),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-atproto",
3
- "version": "0.1.1",
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",
@@ -24,7 +24,8 @@
24
24
  "exports": {
25
25
  ".": {
26
26
  "types": "./dist/types.d.mts",
27
- "import": "./dist/module.mjs"
27
+ "import": "./dist/module.mjs",
28
+ "default": "./dist/module.mjs"
28
29
  }
29
30
  },
30
31
  "main": "./dist/module.mjs",