@loczer/storefront-sdk 0.1.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.
@@ -0,0 +1,13 @@
1
+ export interface GreetingOptions {
2
+ /** Custom punctuation to use when building the greeting. */
3
+ punctuation?: string;
4
+ /** When true, ensures the greeting ends with an exclamation mark. */
5
+ excited?: boolean;
6
+ }
7
+ export declare function createGreeting(name?: string, options?: GreetingOptions): string;
8
+ export declare class StorefrontSdk {
9
+ #private;
10
+ greet(name?: string, options?: GreetingOptions): string;
11
+ getLastGreeting(): string | null;
12
+ }
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAUD,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAInF;AAED,qBAAa,aAAa;;IAGxB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM;IAMvD,eAAe,IAAI,MAAM,GAAG,IAAI;CAGjC"}
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ const o = "Storefront SDK";
2
+ function c(e) {
3
+ const t = e?.trim();
4
+ return t && t.length > 0 ? t : o;
5
+ }
6
+ function s(e, t = {}) {
7
+ const r = c(e), n = t.punctuation ?? (t.excited, "!");
8
+ return `Hello, ${r}${n}`;
9
+ }
10
+ class i {
11
+ #t = null;
12
+ greet(t, r) {
13
+ const n = s(t, r);
14
+ return this.#t = n, n;
15
+ }
16
+ getLastGreeting() {
17
+ return this.#t;
18
+ }
19
+ }
20
+ export {
21
+ i as StorefrontSdk,
22
+ s as createGreeting
23
+ };
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@loczer/storefront-sdk",
3
+ "version": "0.1.0",
4
+ "publishConfig": {
5
+ "registry": "https://registry.npmjs.org/",
6
+ "access": "public"
7
+ },
8
+ "type": "module",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "main": "./dist/index.js",
13
+ "module": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "import": "./dist/index.js",
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ }
21
+ },
22
+ "scripts": {
23
+ "dev": "wireit",
24
+ "build": "vite build && tsc --project tsconfig.build.json",
25
+ "test": "tsc --noEmit && playwright test",
26
+ "typecheck": "tsc --noEmit"
27
+ },
28
+ "wireit": {
29
+ "dev": {
30
+ "command": "vite",
31
+ "dependencies": [],
32
+ "service": {
33
+ "readyWhen": {
34
+ "lineMatches": ".*http://localhost:3133/.*"
35
+ }
36
+ }
37
+ }
38
+ },
39
+ "devDependencies": {
40
+ "@playwright/test": "1.56.1",
41
+ "@vitejs/plugin-react": "5.1.1",
42
+ "react": "19.2.0",
43
+ "react-dom": "19.2.0",
44
+ "vite": "7.2.2"
45
+ }
46
+ }