@yaasl/devtools 0.10.2 → 0.11.0-alpha.1

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,4 +1,4 @@
1
- import { Action, ActionCreator } from "./Action";
1
+ import type { Action, ActionCreator } from "./Action";
2
2
  export interface ExtensionOptions {
3
3
  /**
4
4
  * the instance name to be showed on the monitor page. Default value is `document.title`.
@@ -1,5 +1,5 @@
1
- import { Prettify } from "@yaasl/utils";
2
- import { Action } from "./Action";
1
+ import type { Prettify } from "@yaasl/utils";
2
+ import type { Action } from "./Action";
3
3
  type GenericMessage<Type extends string, State extends string | undefined, Payload extends {
4
4
  type?: string;
5
5
  } | undefined> = Action<Type> & {
@@ -1,5 +1,5 @@
1
- import { Action } from "./Action";
2
- import { Message } from "./Message";
1
+ import type { Action } from "./Action";
2
+ import type { Message } from "./Message";
3
3
  export interface ConnectionResponse {
4
4
  /** Initiate the connection and add it to the extension connections.
5
5
  * Should only be executed once in the live time of the connection.
@@ -1,5 +1,5 @@
1
- import { ExtensionOptions } from "./ExtensionOptions";
2
- import { ConnectionResponse } from "./getReduxConnection";
1
+ import type { ExtensionOptions } from "./ExtensionOptions";
2
+ import type { ConnectionResponse } from "./getReduxConnection";
3
3
  interface Config extends ExtensionOptions {
4
4
  type?: string;
5
5
  }
@@ -1,4 +1,4 @@
1
- import { Atom } from "@yaasl/core";
1
+ import type { Atom } from "@yaasl/core";
2
2
  export declare const cache: {
3
3
  getAtomValue: (atom: Atom) => unknown;
4
4
  setAtomValue: (atom: Atom, value: unknown) => unknown;
@@ -1,4 +1,4 @@
1
- import { Atom } from "@yaasl/core";
2
- import { ConnectionResponse } from "../redux-devtools";
1
+ import type { Atom } from "@yaasl/core";
2
+ import type { ConnectionResponse } from "../redux-devtools";
3
3
  export declare const subscribeStore: (atom: Atom, connection: ConnectionResponse) => void;
4
4
  export declare const resetSubscriptions: () => void;
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.logger = void 0;
4
4
  const core_1 = require("@yaasl/core");
5
+ const utils_1 = require("@yaasl/utils");
5
6
  const createLogger = (text) => ({ atom, value, options }) => {
6
7
  if (options === null || options === void 0 ? void 0 : options.disable)
7
8
  return;
8
- console.log(`[YAASL]["${atom.name}"]: ${text}`, value);
9
+ console.log((0, utils_1.consoleMessage)(text, { scope: atom.name }), value);
9
10
  };
10
11
  /** Effect to monitor atom activities and log them to the console.
11
12
  *
@@ -1,8 +1,9 @@
1
1
  import { createEffect } from "@yaasl/core";
2
+ import { consoleMessage } from "@yaasl/utils";
2
3
  const createLogger = (text) => ({ atom, value, options }) => {
3
4
  if (options?.disable)
4
5
  return;
5
- console.log(`[YAASL]["${atom.name}"]: ${text}`, value);
6
+ console.log(consoleMessage(text, { scope: atom.name }), value);
6
7
  };
7
8
  /** Effect to monitor atom activities and log them to the console.
8
9
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaasl/devtools",
3
- "version": "0.10.2",
3
+ "version": "0.11.0-alpha.1",
4
4
  "description": "yaasl debugging tools (e.g. redux-devtools-extension middleware)",
5
5
  "author": "PrettyCoffee",
6
6
  "license": "MIT",
@@ -15,18 +15,20 @@
15
15
  "bugs": {
16
16
  "url": "https://github.com/PrettyCoffee/yaasl/issues"
17
17
  },
18
+ "sideEffects": false,
18
19
  "main": "./dist/cjs/index.js",
20
+ "module": "./dist/esm/index.js",
19
21
  "types": "./dist/@types/index.d.ts",
20
22
  "exports": {
21
23
  "types": "./dist/@types/index.d.ts",
22
- "import": "./dist/mjs/index.js",
23
- "require": "./dist/cjs/index.js"
24
+ "require": "./dist/cjs/index.js",
25
+ "default": "./dist/esm/index.js"
24
26
  },
25
27
  "scripts": {
26
28
  "build": "run-s clean compile",
27
29
  "clean": "rimraf ./dist",
28
- "compile": "run-p compile:mjs compile:cjs compile:types",
29
- "compile:mjs": "tsc -p ./tsconfig.node.json --outDir ./dist/mjs -m esnext -t esnext",
30
+ "compile": "run-p compile:esm compile:cjs compile:types",
31
+ "compile:esm": "tsc -p ./tsconfig.node.json --outDir ./dist/esm -m esnext -t esnext",
30
32
  "compile:cjs": "tsc -p ./tsconfig.node.json --outDir ./dist/cjs -m commonjs -t es2015",
31
33
  "compile:types": "tsc -p ./tsconfig.node.json --outDir ./dist/@types --declaration --emitDeclarationOnly",
32
34
  "test": "vitest run",
@@ -36,8 +38,8 @@
36
38
  "validate": "run-s lint test build"
37
39
  },
38
40
  "dependencies": {
39
- "@yaasl/core": "0.10.2",
40
- "@yaasl/utils": "0.10.2"
41
+ "@yaasl/core": "0.11.0-alpha.1",
42
+ "@yaasl/utils": "0.11.0-alpha.1"
41
43
  },
42
44
  "eslintConfig": {
43
45
  "extends": [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes