@prosopo/procaptcha-bundle 2.4.1 → 2.5.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.
Files changed (28) hide show
  1. package/dist/bundle/{ProcaptchaWidget-DOETad4N.js → ProcaptchaWidget-CAyH6qD7.js} +33 -31
  2. package/dist/bundle/{ProcaptchaWidget-79FRw4Va.js → ProcaptchaWidget-CY3qomFu.js} +153 -149
  3. package/dist/bundle/{asU8a-2GgUBNjQ.js → asU8a-Br9wz334.js} +1 -1
  4. package/dist/bundle/{bip39-C01p7UHO.js → bip39-BtaWByKg.js} +7 -7
  5. package/dist/bundle/browser-ponyfill-Ck_bwPOY.js +339 -0
  6. package/dist/bundle/{hash-0yoKUuST.js → hash-KElfghPn.js} +7 -7
  7. package/dist/bundle/{index-Ckreqz7Q.js → index-B0trzdT2.js} +3 -3
  8. package/dist/bundle/index-Cb-XcaMX.js +4372 -0
  9. package/dist/bundle/index-VYSrdSle.js +11587 -0
  10. package/dist/bundle/{index-DlBTo0Xd.js → index-n-2hvBzo.js} +405 -405
  11. package/dist/bundle/locales/de/translation.json +405 -0
  12. package/dist/bundle/locales/en/translation.json +405 -0
  13. package/dist/bundle/locales/es/translation.json +405 -0
  14. package/dist/bundle/locales/fr/translation.json +405 -0
  15. package/dist/bundle/locales/it/translation.json +405 -0
  16. package/dist/bundle/locales/pt/translation.json +405 -0
  17. package/dist/bundle/locales/pt-BR/translation.json +405 -0
  18. package/dist/bundle/procaptcha.bundle.js +1 -1
  19. package/dist/bundle/useTranslation-CcYxvTxi.js +2435 -0
  20. package/package.json +11 -11
  21. package/stats.html +1 -1
  22. package/vite.cjs.config.ts +1 -1
  23. package/vite.config.ts +32 -1
  24. package/vite.test.config.ts +1 -1
  25. package/webpack.config.cjs +1 -1
  26. package/dist/bundle/index-C8sSamyh.js +0 -6521
  27. package/dist/bundle/index-DOFIggts.js +0 -17295
  28. package/dist/bundle/useTranslation-CgamIJ5S.js +0 -550
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- // Copyright 2021-2024 Prosopo (UK) Ltd.
2
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
package/vite.config.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Prosopo (UK) Ltd.
1
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ import * as fs from "node:fs";
16
16
  import * as path from "node:path";
17
17
  import { ViteFrontendConfig } from "@prosopo/config";
18
18
  import { loadEnv } from "@prosopo/dotenv";
19
+ import fg from "fast-glob";
19
20
  import { defineConfig } from "vite";
20
21
 
21
22
  // load env using our util because vite loadEnv is not working for .env.development
@@ -46,6 +47,18 @@ for (const packageName of packages) {
46
47
  // Add the tsconfig for each package to tsConfigPaths
47
48
  tsConfigPaths.push(path.resolve(`../${packageName}/tsconfig.json`));
48
49
  }
50
+
51
+ const copyDir = {
52
+ srcDir: `${workspaceRoot}/packages/locale/src/locales`,
53
+ destDir: `${workspaceRoot}/packages/procaptcha-bundle/dist/bundle/locales`,
54
+ };
55
+
56
+ const localFiles = await fg.glob(
57
+ `${workspaceRoot}/packages/locale/src/locales/**/*.json`,
58
+ );
59
+
60
+ console.log(localFiles);
61
+
49
62
  // Merge with generic frontend config
50
63
  export default defineConfig(async ({ command, mode }) => {
51
64
  const frontendConfig = await ViteFrontendConfig(
@@ -59,7 +72,25 @@ export default defineConfig(async ({ command, mode }) => {
59
72
  tsConfigPaths,
60
73
  workspaceRoot,
61
74
  );
75
+
62
76
  return {
63
77
  ...frontendConfig,
78
+ plugins: [
79
+ {
80
+ name: "copy-dir",
81
+ async writeBundle() {
82
+ if (copyDir) {
83
+ const containingFolder = path.dirname(copyDir.destDir);
84
+ if (!fs.existsSync(containingFolder)) {
85
+ fs.mkdirSync(containingFolder, { recursive: true });
86
+ }
87
+ fs.cpSync(copyDir.srcDir, copyDir.destDir, {
88
+ recursive: true,
89
+ });
90
+ }
91
+ },
92
+ },
93
+ ...(frontendConfig.plugins ? frontendConfig.plugins : []),
94
+ ],
64
95
  };
65
96
  });
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Prosopo (UK) Ltd.
1
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Prosopo (UK) Ltd.
1
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.