@vtex/checkout 0.0.8 → 0.0.10

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 (87) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app.js +1 -1
  3. package/.next/build-manifest.json +26 -26
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  8. package/.next/cache/webpack/server-production/0.pack +0 -0
  9. package/.next/cache/webpack/server-production/index.pack +0 -0
  10. package/.next/prerender-manifest.json +1 -1
  11. package/.next/server/chunks/400.js +1 -1
  12. package/.next/server/middleware-build-manifest.js +1 -1
  13. package/.next/server/pages/404.html +1 -1
  14. package/.next/server/pages/500.html +1 -1
  15. package/.next/server/pages/cart.html +1 -1
  16. package/.next/server/pages/error.html +1 -1
  17. package/.next/server/pages/index.html +1 -1
  18. package/.next/server/pages/information.html +1 -1
  19. package/.next/server/pages/order-placed.html +1 -1
  20. package/.next/server/pages/payment.html +1 -1
  21. package/.next/server/pages/review.html +1 -1
  22. package/.next/server/pages/shipping.html +1 -1
  23. package/.next/standalone/.next/BUILD_ID +1 -1
  24. package/.next/standalone/.next/build-manifest.json +26 -26
  25. package/.next/standalone/.next/prerender-manifest.json +1 -1
  26. package/.next/standalone/.next/server/chunks/400.js +1 -1
  27. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  28. package/.next/standalone/.next/server/pages/404.html +1 -1
  29. package/.next/standalone/.next/server/pages/500.html +1 -1
  30. package/.next/standalone/.next/server/pages/cart.html +1 -1
  31. package/.next/standalone/.next/server/pages/error.html +1 -1
  32. package/.next/standalone/.next/server/pages/index.html +1 -1
  33. package/.next/standalone/.next/server/pages/information.html +1 -1
  34. package/.next/standalone/.next/server/pages/order-placed.html +1 -1
  35. package/.next/standalone/.next/server/pages/payment.html +1 -1
  36. package/.next/standalone/.next/server/pages/review.html +1 -1
  37. package/.next/standalone/.next/server/pages/shipping.html +1 -1
  38. package/.next/standalone/.next/static/{d3rnv_PTmize_AfdZT0mQ → D39HhaRdycmVapGyJTwER}/_buildManifest.js +1 -1
  39. package/.next/standalone/.next/static/chunks/main-e2254fa47db149d4.js +57 -0
  40. package/.next/standalone/.next/static/chunks/mf-manifest.json +32 -32
  41. package/.next/standalone/.next/static/chunks/mf-stats.json +32 -32
  42. package/.next/standalone/.next/static/chunks/pages/{_app-9f47f29ca781c0d2.js → _app-5614585568072a7b.js} +4 -4
  43. package/.next/standalone/.next/static/chunks/pages/order-placed-bc02732f16535ebb.js +1 -0
  44. package/.next/standalone/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  45. package/.next/standalone/.next/static/chunks/{webpack-9611ecf3bafb6ec9.js → webpack-a9c09a4cddf677b4.js} +1 -1
  46. package/.next/standalone/.next/static/css/{33cd250a1c4a6bb2.css → 6f48a3a477d7e03e.css} +1 -1
  47. package/.next/standalone/package.json +2 -2
  48. package/.next/trace +275 -272
  49. package/README.md +8 -29
  50. package/dist/commands/build.d.ts +9 -5
  51. package/dist/commands/build.js +26 -15
  52. package/dist/commands/build.js.map +1 -1
  53. package/dist/commands/create.d.ts +10 -0
  54. package/dist/commands/create.js +34 -0
  55. package/dist/commands/create.js.map +1 -0
  56. package/dist/commands/dev.d.ts +11 -2
  57. package/dist/commands/dev.js +55 -100
  58. package/dist/commands/dev.js.map +1 -1
  59. package/dist/commands/index.d.ts +1 -1
  60. package/dist/commands/index.js +1 -1
  61. package/dist/commands/index.js.map +1 -1
  62. package/dist/index.d.ts +2 -2
  63. package/dist/index.js +2 -2
  64. package/dist/index.js.map +1 -1
  65. package/dist/lib/bundler.d.ts +14 -0
  66. package/dist/lib/bundler.js +120 -0
  67. package/dist/lib/bundler.js.map +1 -0
  68. package/dist/lib/constants.d.ts +3 -2
  69. package/dist/lib/constants.js +3 -2
  70. package/dist/lib/constants.js.map +1 -1
  71. package/dist/lib/logger.d.ts +5 -0
  72. package/dist/lib/logger.js +12 -0
  73. package/dist/lib/logger.js.map +1 -0
  74. package/package.json +8 -5
  75. package/scripts/set-as-pristine.sh +2 -0
  76. package/template/package.template.json +11 -0
  77. package/template/src/HelloWorld.tsx +12 -0
  78. package/template/src/hello-world.css +6 -0
  79. package/template/src/index.tsx +6 -0
  80. package/template/tsconfig.json +18 -0
  81. package/.next/standalone/.next/static/chunks/main-0a2b108d0f6b9d42.js +0 -57
  82. package/.next/standalone/.next/static/chunks/pages/order-placed-19c94f6f42e62dae.js +0 -1
  83. package/.next/standalone/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +0 -1
  84. package/dist/commands/init.d.ts +0 -13
  85. package/dist/commands/init.js +0 -23
  86. package/dist/commands/init.js.map +0 -1
  87. /package/.next/standalone/.next/static/{d3rnv_PTmize_AfdZT0mQ → D39HhaRdycmVapGyJTwER}/_ssgManifest.js +0 -0
@@ -1,7 +1,8 @@
1
1
  export declare const PACKAGE_PATH: string;
2
+ export declare const TEMPLATE_PATH: string;
3
+ export declare const PACKAGE_JSON_TEMPLATE = "package.template.json";
2
4
  export declare const CORE_PATH: string;
3
5
  export declare const STANDALONE_PATH: string;
4
6
  export declare const CHECKOUTRC_PATH: string;
5
- export declare const STATIC_TMP_FOLDER = "tmp";
6
- export declare const CHECKOUT_PORT = 4301;
7
+ export declare const STATIC_TMP_FOLDER = "dist";
7
8
  export declare const IS_DEBUGGING: boolean;
@@ -1,9 +1,10 @@
1
1
  import path from 'path';
2
2
  export const PACKAGE_PATH = path.resolve('node_modules', '@vtex', 'checkout');
3
+ export const TEMPLATE_PATH = path.resolve(PACKAGE_PATH, 'template');
4
+ export const PACKAGE_JSON_TEMPLATE = 'package.template.json';
3
5
  export const CORE_PATH = path.resolve(PACKAGE_PATH, '.next');
4
6
  export const STANDALONE_PATH = path.resolve(CORE_PATH, 'standalone');
5
7
  export const CHECKOUTRC_PATH = path.resolve(PACKAGE_PATH, '.checkoutrc');
6
- export const STATIC_TMP_FOLDER = 'tmp';
7
- export const CHECKOUT_PORT = 4301;
8
+ export const STATIC_TMP_FOLDER = 'dist';
8
9
  export const IS_DEBUGGING = process.env.CHECKOUT_CLI_DEBUG === 'true';
9
10
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const logger: {
2
+ info: (...args: any[]) => void;
3
+ error: (...args: any[]) => void;
4
+ debug: (...args: any[]) => void;
5
+ };
@@ -0,0 +1,12 @@
1
+ import { IS_DEBUGGING } from './constants.js';
2
+ const PREFIX = '[CHECKOUT]';
3
+ export const logger = {
4
+ info: (...args) => console.log(PREFIX, ...args),
5
+ error: (...args) => console.error(PREFIX, ...args),
6
+ debug: (...args) => {
7
+ if (IS_DEBUGGING) {
8
+ console.log(PREFIX, ...args);
9
+ }
10
+ },
11
+ };
12
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,GAAG,YAAY,CAAC;AAE5B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;IACtD,KAAK,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;IACzD,KAAK,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE;QACxB,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/checkout",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "author": "VTEX",
5
5
  "bin": {
6
6
  "checkout": "./bin/run.js"
@@ -22,10 +22,12 @@
22
22
  "@babel/preset-typescript": "^7.24.7",
23
23
  "@module-federation/enhanced": "0.6.4",
24
24
  "webpack": "^5.90.0",
25
- "ws": "^8.18.0"
25
+ "ws": "^8.18.0",
26
+ "cors": "2.8.5"
26
27
  },
27
28
  "devDependencies": {
28
- "@types/react": "^18.3.5"
29
+ "@types/react": "^18.3.5",
30
+ "@types/cors": "2.8.17"
29
31
  },
30
32
  "engines": {
31
33
  "node": ">=18.0.0"
@@ -47,13 +49,14 @@
47
49
  "topicSeparator": " "
48
50
  },
49
51
  "scripts": {
50
- "cli": "./bin/dev.js",
51
52
  "postinstall": "bash ./scripts/set-as-pristine.sh"
52
53
  },
53
54
  "types": "dist/index.d.ts",
54
55
  "files": [
55
56
  ".next",
56
57
  "dist",
57
- "bin"
58
+ "bin",
59
+ "scripts",
60
+ "template"
58
61
  ]
59
62
  }
@@ -0,0 +1,2 @@
1
+ rm -rf .checkoutrc
2
+ echo 'pristine' >> .checkoutrc
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "checkout",
3
+ "version": "1.0.0",
4
+ "dependencies": {
5
+ "react": "^18",
6
+ "typescript": "^5"
7
+ },
8
+ "devDependencies": {
9
+ "@types/react": "^18"
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ import React, { useState } from 'react';
2
+ import './hello-world.css';
3
+
4
+ export const HelloWorld = () => {
5
+ const [count, setCount] = useState(0);
6
+
7
+ return (
8
+ <button className="hello-world-btn" onClick={() => setCount(count + 1)}>
9
+ Count: {count}
10
+ </button>
11
+ );
12
+ };
@@ -0,0 +1,6 @@
1
+ .hello-world-btn {
2
+ background: #000;
3
+ color: #fafafa;
4
+ border-radius: 2px;
5
+ font-size: 14px;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { ExtensionPoints } from '@vtex/checkout';
2
+ import { HelloWorld } from './HelloWorld';
3
+
4
+ export default {
5
+ 'cart.cart-list.before': HelloWorld,
6
+ } satisfies ExtensionPoints;
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "target": "es6",
5
+ "module": "esnext",
6
+ "lib": ["dom", "es2015"],
7
+ "allowJs": true,
8
+ "jsx": "react-jsx",
9
+ "sourceMap": true,
10
+ "strict": true,
11
+ "moduleResolution": "node",
12
+ "esModuleInterop": true,
13
+ "skipLibCheck": true,
14
+ "forceConsistentCasingInFileNames": true
15
+ },
16
+ "include": ["src/**/*"],
17
+ "exclude": ["node_modules", "dist"]
18
+ }