@shopify/shopify_function 0.2.0 → 1.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/CONTRIBUTING.md +1 -1
- package/package.json +2 -3
- package/run.ts +1 -3
package/CONTRIBUTING.md
CHANGED
|
@@ -10,7 +10,7 @@ We love receiving pull requests!
|
|
|
10
10
|
|
|
11
11
|
## How to contribute
|
|
12
12
|
|
|
13
|
-
1. Fork it ( https://github.com/Shopify/shopify-function-
|
|
13
|
+
1. Fork it ( https://github.com/Shopify/shopify-function-javascript/fork )
|
|
14
14
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
15
15
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
16
16
|
4. Push to the branch (`git push origin my-new-feature`)
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"@shopify:registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "1.0.0",
|
|
8
8
|
"description": "",
|
|
9
9
|
"main": "index.ts",
|
|
10
10
|
"keywords": [],
|
|
@@ -16,6 +16,5 @@
|
|
|
16
16
|
"@graphql-codegen/typescript-operations": "^2.5.5",
|
|
17
17
|
"graphql": "^16.6.0",
|
|
18
18
|
"typescript": "^4.8.4"
|
|
19
|
-
}
|
|
20
|
-
"peerDependencies": {}
|
|
19
|
+
}
|
|
21
20
|
}
|
package/run.ts
CHANGED
|
@@ -2,7 +2,6 @@ export type ShopifyFunction<Input extends {}, Output extends {}> = (
|
|
|
2
2
|
input: Input
|
|
3
3
|
) => Output;
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
interface Javy {
|
|
7
6
|
JSON: {
|
|
8
7
|
fromStdin(): any;
|
|
@@ -14,9 +13,8 @@ declare global {
|
|
|
14
13
|
const Javy: Javy;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
|
|
18
16
|
export default function <I extends {}, O extends {}>(userfunction: ShopifyFunction<I, O>) {
|
|
19
17
|
const input_obj = Javy.JSON.fromStdin();
|
|
20
18
|
const output_obj = userfunction(input_obj);
|
|
21
|
-
Javy.JSON.toStdout(output_obj)
|
|
19
|
+
Javy.JSON.toStdout(output_obj)
|
|
22
20
|
}
|