@swc/plugin-swc-confidential 6.0.3 → 7.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @swc/plugin-swc-confidential
2
2
 
3
+ ## 7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - cf2636b: Update swc_core to v27
8
+
9
+ ## 6.0.5
10
+
11
+ ### Patch Changes
12
+
13
+ - e3e743d: Update swc_core to v27
14
+
15
+ ## 6.0.4
16
+
17
+ ### Patch Changes
18
+
19
+ - 5ddbaeb: Update swc_core to v23
20
+
3
21
  ## 6.0.3
4
22
 
5
23
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/plugin-swc-confidential",
3
- "version": "6.0.3",
3
+ "version": "7.0.0",
4
4
  "description": "SWC plugin for swc-confidential",
5
5
  "main": "swc_plugin_swc_confidential.wasm",
6
6
  "homepage": "https://swc.rs",
Binary file
package/Cargo.toml DELETED
@@ -1,25 +0,0 @@
1
- [package]
2
-
3
- description = "SWC Plugin for swc-confidential"
4
-
5
-
6
- authors = { workspace = true }
7
- edition = { workspace = true }
8
- homepage = { workspace = true }
9
- license = { workspace = true }
10
- name = "swc_plugin_swc_confidential"
11
- publish = false
12
- repository = { workspace = true }
13
- rust-version = { workspace = true }
14
- version = "0.7.4"
15
-
16
-
17
- [lib]
18
- crate-type = ["cdylib", "rlib"]
19
-
20
- [dependencies]
21
- serde_json = { workspace = true }
22
- swc_core = { workspace = true, features = ["ecma_plugin_transform"] }
23
-
24
-
25
- swc_confidential = { path = "./transform" }
@@ -1,6 +0,0 @@
1
- // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
-
3
- exports[`Should load swc-confidential wasm plugin correctly > Should transform simple correctly 1`] = `
4
- "console.log("secure:de454774988d624b8f317bbe9dadfe1f");
5
- "
6
- `;
@@ -1,81 +0,0 @@
1
- import { expect, test, describe } from "vitest";
2
- import { transform } from "@swc/core";
3
- import path from "node:path";
4
- import url from "node:url";
5
- import fs from "node:fs/promises";
6
-
7
- const pluginName = "swc_plugin_swc_confidential.wasm";
8
-
9
- const transformCode = async (
10
- code: string,
11
- options = {
12
- algorithm: "AES-256",
13
- encryptionKey: "secret",
14
- prefix: "secure:",
15
- },
16
- ) => {
17
- return transform(code, {
18
- jsc: {
19
- parser: {
20
- syntax: "ecmascript",
21
- },
22
- target: "es2018",
23
- experimental: {
24
- plugins: [
25
- [
26
- path.join(
27
- path.dirname(url.fileURLToPath(import.meta.url)),
28
- "..",
29
- pluginName,
30
- ),
31
- options,
32
- ],
33
- ],
34
- },
35
- },
36
- filename: "test.js",
37
- });
38
- };
39
-
40
- async function walkDir(
41
- dir: URL,
42
- callback: (
43
- dir: string,
44
- input: string,
45
- config?: Record<string, unknown>,
46
- ) => Promise<void>,
47
- ) {
48
- const dirs = await fs.readdir(dir);
49
- const baseDir = url.fileURLToPath(dir);
50
-
51
- for (const dir of dirs) {
52
- const inputFilePath = path.join(baseDir, dir, "input.js");
53
- const configPath = path.join(baseDir, dir, "config.json");
54
-
55
- const config = await fs.readFile(configPath, "utf-8").then(
56
- (json) => {
57
- return JSON.parse(json);
58
- },
59
- (_) => undefined,
60
- );
61
-
62
- try {
63
- const input = await fs.readFile(inputFilePath, "utf-8");
64
- await callback(dir, input, config);
65
- } catch (e) {
66
- console.log(e);
67
- }
68
- }
69
- }
70
-
71
- describe("Should load swc-confidential wasm plugin correctly", async () => {
72
- await walkDir(
73
- new URL("../transform/tests/fixture", import.meta.url),
74
- async (dir, input, config) => {
75
- await test(`Should transform ${dir} correctly`, async () => {
76
- const { code } = await transformCode(input, config);
77
- expect(code).toMatchSnapshot();
78
- });
79
- },
80
- );
81
- });