Skip to content

Commit ff81dd1

Browse files
authored
Merge pull request #139 from devmehq/develop
develop
2 parents 8abcb6a + 9265a43 commit ff81dd1

18 files changed

+8970
-10093
lines changed

.github/renovate.json

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"extends": [
33
"config:base"
44
],
5+
"branchPrefix": "renovate-",
6+
"baseBranches": [
7+
"develop"
8+
],
59
"assigneesFromCodeOwners": true,
610
"packageRules": [
711
{

.github/workflows/ci.yml

+31-11
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,60 @@
1-
name: ci
1+
name: CI
22
on:
3+
workflow_dispatch:
4+
workflow_call:
35
push:
46
paths:
57
- 'src/**'
6-
- 'test/**'
8+
- '__tests__/**'
79
- 'package.json'
810
- 'yarn.lock'
11+
- 'release.config.js'
12+
- '.github/workflows/ci.yml'
913
branches:
1014
- '*'
15+
- '**'
16+
- '!master'
1117

1218
env:
19+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1321
CI: true
1422

1523
jobs:
16-
build:
17-
runs-on: ubuntu-18.04
24+
CI:
25+
runs-on: ubuntu-latest
1826
timeout-minutes: 20
1927

28+
permissions:
29+
packages: write
30+
contents: write
31+
2032
steps:
33+
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
2134
- uses: styfle/[email protected]
2235
with:
23-
workflow_id: build-docker.yml
36+
workflow_id: ci.yml
2437
access_token: ${{ github.token }}
2538

2639
- uses: actions/checkout@v3
2740
with:
2841
fetch-depth: 30
29-
persist-credentials: false
30-
31-
- uses: bahmutov/npm-install@v1
3242

33-
- name: Yarn install
34-
uses: bahmutov/npm-install@v1
43+
- uses: FranzDiebold/github-env-vars-action@v2
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v3
3546
with:
36-
install-command: yarn --frozen-lockfile --silent
47+
node-version: 19
48+
49+
- name: Yarn
50+
run: yarn install --frozen-lockfile
3751

3852
- name: Test
3953
run: |
4054
yarn test
55+
56+
- name: Release
57+
if: github.ref == 'refs/heads/develop'
58+
run: |
59+
npm i -g semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
60+
npx semantic-release --no-ci --debug

.github/workflows/release.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
push:
6+
paths:
7+
- 'src/**'
8+
- 'yarn.lock'
9+
branches:
10+
- 'master'
11+
12+
env:
13+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
CI: true
16+
17+
jobs:
18+
Release:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 20
21+
22+
permissions:
23+
packages: write
24+
contents: write
25+
26+
steps:
27+
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
28+
- uses: styfle/[email protected]
29+
with:
30+
workflow_id: release.yml
31+
access_token: ${{ github.token }}
32+
33+
- uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 30
36+
37+
- uses: FranzDiebold/github-env-vars-action@v2
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: 19
42+
43+
- name: Yarn
44+
run: yarn install --frozen-lockfile
45+
46+
- name: Test
47+
run: |
48+
yarn test
49+
50+
- name: Release
51+
run: |
52+
npm i -g semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
53+
npx semantic-release --no-ci --debug

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1+
node_modules/.bin/pretty-quick
12
node_modules/.bin/lint-staged
2-
yarn run test

.mocharc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
recursive: false,
2424
reporter: 'spec',
2525
require: ['ts-node/register', 'should'],
26-
spec: ['./test/*-test.ts'],
26+
spec: ['./__tests__/*-test.ts'],
2727
timeout: '8s',
2828
'trace-warnings': true,
2929
};

test/basic-integration-test.ts renamed to __tests__/basic-integration-test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('basic', async function () {
3535
expect(result.favicon).to.be.eql('https://www.namecheap.com/assets/img/nc-icon/favicon.ico');
3636
expect(result.ogUrl).to.be.eql('https://www.namecheap.com/');
3737
expect(result.ogTitle).to.be.eql('Buy a domain name - Register cheap domain names from $0.99 - Namecheap');
38-
expect(result.ogDescription).to.be.eql('Register domain names at Namecheap. Buy cheap domain names and enjoy 24/7 support. With over 13 million domains under management, you know you’re in good hands.');
38+
expect(result.ogDescription).to.be.eql('Register domain names at Namecheap. Buy cheap domain names and enjoy 24/7 support. With over 16 million domains under management, you know you’re in good hands.');
3939
// expect(result.ogImage).to.be.an('array').and.to.not.be.empty;
4040
// expect(result.charset).to.be.eql('utf8');
4141
expect(result).to.have.all.keys(
@@ -148,7 +148,7 @@ describe('basic', async function () {
148148
expect(result.ogTitle).to.be.eql('Date.prototype.toLocaleString() - JavaScript | MDN');
149149
expect(result.ogLocale).to.be.eql('en-US');
150150
expect(result.ogUrl).to.be.eql('https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString');
151-
expect(result.ogDate).to.be.eql('2022-03-27T17:30:40.000Z');
151+
expect(result.ogDate).to.be.eql('2022-12-21T06:06:58.000Z');
152152
expect(result.favicon).to.be.eql('/favicon-48x48.cbbd161b.png');
153153
// expect(result.charset).to.be.eql('utf8');
154154
expect(result.ogImage).to.be.eql({
@@ -172,16 +172,16 @@ describe('basic', async function () {
172172
});
173173
it('net-a-porter should return open graph data with one title', async function () {
174174
const result = await ogs({
175-
url: 'https://www.net-a-porter.com/en-au/shop/product/gucci/shoes/mid-heel/plastique-logo-embossed-rubber-mules/1647597276960849',
175+
url: 'https://www.net-a-porter.com/en-ca/shop/product/gucci/shoes/mid-heel/plastique-logo-embossed-rubber-mules/1647597276126997',
176176
});
177-
expect(result.ogTitle).to.be.eql('Blue Plastique logo-embossed rubber mules | GUCCI | NET-A-PORTER');
177+
expect(result.ogTitle).to.be.eql('Ivory Plastique logo-embossed rubber mules | GUCCI | NET-A-PORTER');
178178
expect(result.ogLocale).to.be.eql('en');
179-
expect(result.ogUrl).to.be.eql('https://www.net-a-porter.com/en-au/shop/product/gucci/shoes/mid-heel/plastique-logo-embossed-rubber-mules/1647597276960849');
179+
expect(result.ogUrl).to.be.eql('https://www.net-a-porter.com/en-ca/shop/product/gucci/shoes/mid-heel/plastique-logo-embossed-rubber-mules/1647597276126997');
180180
expect(result.ogDate).to.be.eql(undefined);
181181
expect(result.favicon).to.be.eql('/favicon.png');
182182
// expect(result.charset).to.be.eql('utf8');
183183
expect(result.ogImage).to.be.eql({
184-
url: '//www.net-a-porter.com/variants/images/1647597276960849/in/w2000_q60.jpg',
184+
url: '//www.net-a-porter.com/variants/images/1647597276126997/in/w2000_q60.jpg',
185185
width: null,
186186
height: null,
187187
type: 'jpg',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)