@twin.org/nameof-vitest-plugin 0.0.2-next.8 → 0.0.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
@@ -1,16 +1,20 @@
1
1
  # TWIN Nameof Vitest Plugin
2
2
 
3
- The regular TypeScript transformer cannot be used with ESBuild, so this plugin for Vitest performs the same transformation in a plugin.
3
+ This package is part of the framework workspace and provides vitest plugin which perform the nameof transformation to support consistent development workflows across the ecosystem.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```shell
8
- npm install @twin.org/nameof-vitest-plugin -D
8
+ npm install -D @twin.org/nameof-vitest-plugin
9
9
  ```
10
10
 
11
11
  ## Configuration
12
12
 
13
- Configuration of the package is shown in [docs/configuration.md](docs/configuration.md)
13
+ Configuration options are documented in [docs/configuration.md](docs/configuration.md)
14
+
15
+ ## Examples
16
+
17
+ Usage of the APIs is shown in the examples [docs/examples.md](docs/examples.md)
14
18
 
15
19
  ## Reference
16
20
 
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./nameOfPlugin.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,mBAAmB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./nameOfPlugin.js\";\n"]}
@@ -0,0 +1,19 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { manual } from "@twin.org/nameof-transformer";
4
+ /**
5
+ * Transforms the code using the nameOf plugin.
6
+ * @param code The code to transform.
7
+ * @param id The id of the file being transformed.
8
+ * @returns The transformed code.
9
+ */
10
+ export function nameOfPluginTransform(code, id) {
11
+ return manual(code);
12
+ }
13
+ // eslint-disable-next-line @typescript-eslint/naming-convention
14
+ export const NameOfPlugin = {
15
+ name: "name-of",
16
+ enforce: "pre",
17
+ transform: nameOfPluginTransform
18
+ };
19
+ //# sourceMappingURL=nameOfPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameOfPlugin.js","sourceRoot":"","sources":["../../src/nameOfPlugin.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,EAAU;IAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAW;IACnC,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,qBAAqB;CAChC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { manual } from \"@twin.org/nameof-transformer\";\nimport type { Plugin } from \"vitest/config\";\n\n/**\n * Transforms the code using the nameOf plugin.\n * @param code The code to transform.\n * @param id The id of the file being transformed.\n * @returns The transformed code.\n */\nexport function nameOfPluginTransform(code: string, id: string): string {\n\treturn manual(code);\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const NameOfPlugin: Plugin = {\n\tname: \"name-of\",\n\tenforce: \"pre\",\n\ttransform: nameOfPluginTransform\n};\n"]}
@@ -1 +1 @@
1
- export * from "./nameOfPlugin";
1
+ export * from "./nameOfPlugin.js";
@@ -1,3 +1,9 @@
1
1
  import type { Plugin } from "vitest/config";
2
- export declare const nameOfPluginTransform: (code: string, id: string) => string;
2
+ /**
3
+ * Transforms the code using the nameOf plugin.
4
+ * @param code The code to transform.
5
+ * @param id The id of the file being transformed.
6
+ * @returns The transformed code.
7
+ */
8
+ export declare function nameOfPluginTransform(code: string, id: string): string;
3
9
  export declare const NameOfPlugin: Plugin;