@shwfed/nuxt 0.1.7 → 0.1.11

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.d.mts CHANGED
@@ -1,7 +1,12 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
- load: () => void;
4
+ clientId: string;
5
+ }
6
+ declare module 'nuxt/schema' {
7
+ interface PublicRuntimeConfig {
8
+ shwfed: ModuleOptions;
9
+ }
5
10
  }
6
11
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
12
 
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.1.7",
4
+ "version": "0.1.11",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
- "unbuild": "unknown"
7
+ "unbuild": "3.6.1"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -1,15 +1,20 @@
1
- import { defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addPlugin, addImports } from '@nuxt/kit';
2
2
 
3
3
  const module$1 = defineNuxtModule({
4
4
  meta: {
5
5
  name: "@shwfed/nuxt",
6
6
  configKey: "shwfed"
7
7
  },
8
- // Default configuration options of the Nuxt module
9
8
  defaults: {},
10
- setup(_options, _nuxt) {
9
+ setup(options, nuxt) {
11
10
  const resolver = createResolver(import.meta.url);
11
+ nuxt.options.runtimeConfig.public.shwfed = options;
12
12
  addPlugin(resolver.resolve("./runtime/plugins/cel/index"));
13
+ addImports({
14
+ name: "useCheating",
15
+ as: "useCheating",
16
+ from: resolver.resolve("runtime/composables/useCheating")
17
+ });
13
18
  }
14
19
  });
15
20
 
@@ -0,0 +1 @@
1
+ export declare const useCheating: () => import("vue").Ref<boolean, boolean>;
@@ -0,0 +1,33 @@
1
+ import { createGlobalState, onKeyStroke } from "@vueuse/core";
2
+ import { ref, watch } from "vue";
3
+ export const useCheating = createGlobalState(() => {
4
+ const isCheating = ref(false);
5
+ const keystrokes = ref([]);
6
+ onKeyStroke(true, (e) => {
7
+ keystrokes.value.push(e.code);
8
+ if (keystrokes.value.length > 10) {
9
+ keystrokes.value.shift();
10
+ }
11
+ });
12
+ const cancel = watch(keystrokes, (keystrokes2) => {
13
+ const code = [
14
+ "ArrowUp",
15
+ "ArrowUp",
16
+ "ArrowDown",
17
+ "ArrowDown",
18
+ "ArrowLeft",
19
+ "ArrowRight",
20
+ "ArrowLeft",
21
+ "ArrowRight",
22
+ "KeyB",
23
+ "KeyA"
24
+ ];
25
+ if (keystrokes2.every((keystroke, index) => code[index] === keystroke) && keystrokes2.length === code.length) {
26
+ isCheating.value = true;
27
+ cancel();
28
+ }
29
+ }, {
30
+ deep: true
31
+ });
32
+ return isCheating;
33
+ });
@@ -1,2 +1,14 @@
1
- declare const _default: any;
1
+ import { TypeError, EvaluationError, type Context } from '@marcbachmann/cel-js';
2
+ import { Effect, Either } from 'effect';
3
+ declare const _default: import("#app").Plugin<{
4
+ dsl: {
5
+ check: (source: string) => Either.Either<string, TypeError>;
6
+ evaluate: <T>(source: string, context?: Context) => Effect.Effect<T, EvaluationError | TypeError, never>;
7
+ };
8
+ }> & import("#app").ObjectPlugin<{
9
+ dsl: {
10
+ check: (source: string) => Either.Either<string, TypeError>;
11
+ evaluate: <T>(source: string, context?: Context) => Effect.Effect<T, EvaluationError | TypeError, never>;
12
+ };
13
+ }>;
2
14
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { defineNuxtPlugin } from "#app";
1
2
  import { TypeError, EvaluationError } from "@marcbachmann/cel-js";
2
3
  import defu from "defu";
3
4
  import { Effect, Either } from "effect";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.1.7",
3
+ "version": "0.1.11",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "dist"
26
26
  ],
27
27
  "workspaces": [
28
- "playground"
28
+ "playground/*"
29
29
  ],
30
30
  "scripts": {
31
31
  "prepack": "nuxt-module-build build",
@@ -43,9 +43,13 @@
43
43
  "@date-fns/tz": "^1.4.1",
44
44
  "@marcbachmann/cel-js": "^7.2.1",
45
45
  "@nuxt/kit": "^4.3.0",
46
+ "@vueuse/core": "^14.1.0",
46
47
  "date-fns": "^4.1.0",
47
48
  "defu": "^6.1.4",
48
- "effect": "^3.19.15"
49
+ "effect": "^3.19.15",
50
+ "markdown-it": "^14.1.0",
51
+ "reka-ui": "^2.7.0",
52
+ "vue": "^3.5.27"
49
53
  },
50
54
  "devDependencies": {
51
55
  "@commitlint/cli": "^20.3.1",
@@ -53,10 +57,10 @@
53
57
  "@nuxt/devtools": "^3.1.1",
54
58
  "@nuxt/eslint": "1.13.0",
55
59
  "@nuxt/eslint-config": "^1.13.0",
56
- "@nuxt/icon": "2.2.1",
57
60
  "@nuxt/module-builder": "^1.0.2",
58
61
  "@nuxt/schema": "^4.3.0",
59
62
  "@nuxt/test-utils": "^3.23.0",
63
+ "@types/markdown-it": "^14.1.2",
60
64
  "@types/node": "latest",
61
65
  "changelogen": "^0.6.2",
62
66
  "eslint": "^9.39.2",