@thg-altitude/schemaorg 1.0.18 → 1.0.20-alpha

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,25 @@
1
+ name: Publish
2
+
3
+ permissions:
4
+ contents: write
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - uses: actions/setup-node@v3
17
+ with:
18
+ node-version: 18.17.1
19
+ cache: 'npm'
20
+ - run: |
21
+ git config --local user.email "DL-HeadlessTech@thehutgroup.com"
22
+ git config --local user.name "THG Altitude [bot]"
23
+ - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
24
+ - run: npm i
25
+ - run: npm publish
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 18.15.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thg-altitude/schemaorg",
3
- "version": "1.0.18",
3
+ "version": "1.0.20-alpha",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "author": "Phillip Gourley",
12
12
  "license": "ISC",
13
- "dependencies": {
14
- "astro": "^3.0.12"
13
+ "peerDependencies": {
14
+ "astro": "^4.0.8"
15
15
  }
16
16
  }
@@ -8,7 +8,7 @@ let offersArray = []
8
8
  Astro.props.variants?.forEach((variant)=>{
9
9
  offersArray.push({
10
10
  "@type": "Offer",
11
- "sku": variant.sku,
11
+ "sku": variant.sku.toString(),
12
12
  "url": Astro.props.variants.length > 1 ? `${url}${Astro.props.url}?variation=${variant?.sku}`: `${url}${Astro.props.url}`,
13
13
  "price": variant?.price?.price?.amount,
14
14
  "priceCurrency": Astro.props.currency,
@@ -44,8 +44,8 @@ let aggregateRating = Astro.props.reviewsCount > 0 ? {
44
44
  let schema = {
45
45
  "@type": "Product",
46
46
  "@context": "https://schema.org",
47
- "@id": `${url}${Astro.props.url}`,
48
- "sku": Astro.props.sku,
47
+ "@id": Astro.props.sku.toString(),
48
+ "sku": Astro.props.sku.toString(),
49
49
  "name": Astro.props.name,
50
50
  "description": Astro.props.description,
51
51
  "image": `${import.meta.env.IMAGE_PROXY_URL}?url=${Astro.props.image}&format=webp&width=1500&height=1500&fit=cover`,
@@ -54,7 +54,7 @@ let schema = {
54
54
  "name": Astro.props.brand,
55
55
  },
56
56
  "aggregateRating": aggregateRating,
57
- "review": reviewsArray,
57
+ "review": reviewsArray.length ? reviewsArray : null,
58
58
  "offers": offersArray
59
59
  };
60
60
 
package/.idea/misc.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/schemaorg.iml" filepath="$PROJECT_DIR$/.idea/schemaorg.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>