Skip to content

Commit ed72709

Browse files
authored
Migrate js clients (#47)
1 parent c5964b1 commit ed72709

File tree

119 files changed

+26150
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+26150
-0
lines changed

Diff for: .github/workflows/js-build.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: JS (build)
2+
3+
on:
4+
push:
5+
paths:
6+
- 'visual-js/**'
7+
- .github/workflows/js-build.yml
8+
pull_request:
9+
paths:
10+
- 'visual-js/**'
11+
- .github/workflows/js-build.yml
12+
13+
defaults:
14+
run:
15+
working-directory: visual-js
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup Node 18
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18.x
26+
- name: Build with lerna
27+
run: |
28+
corepack enable
29+
yarn install
30+
npm run lint --workspaces --if-present
31+
npm run build --workspaces --if-present
32+
npm run test --workspaces --if-present
33+
env:
34+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
35+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}

Diff for: .github/workflows/js-release.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: JS (release)
2+
3+
on:
4+
workflow_dispatch: {}
5+
6+
defaults:
7+
run:
8+
working-directory: visual-js
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Setup Node 18
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 18.x
19+
- name: Setup Git
20+
if: ${{ steps.prep.outputs.tag_name == '' }}
21+
run: |
22+
git config --global user.name "sauce-visual-bot"
23+
git config --global user.email "[email protected]"
24+
- name: Build
25+
run: |
26+
corepack enable
27+
yarn install
28+
npm run build --workspaces --if-present
29+
- name: upgrade & publish version(s)
30+
## TODO version and publish commands need to be adjusted when we're confident with the pipeline
31+
run: |
32+
npx changeset version --snapshot migration
33+
npx changeset publish --no-git-tag --snapshot
34+
## TODO enable the git tagging when we're confident with the pipeline
35+
##- name: Push to git
36+
## run: |
37+
## git push --follow-tags

Diff for: visual-js/.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

Diff for: visual-js/.changeset/config.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": true,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [],
11+
"changedFilePatterns": [
12+
"visual*/**",
13+
"package.json"
14+
]
15+
}

Diff for: visual-js/.changeset/mean-horses-yell.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@saucelabs/nightwatch-sauce-visual-service": patch
3+
"@saucelabs/visual-storybook": patch
4+
"@saucelabs/cypress-visual-plugin": patch
5+
"@saucelabs/wdio-sauce-visual-service": patch
6+
"@saucelabs/visual": patch
7+
---
8+
9+
migrate source to github

Diff for: visual-js/.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
.DS_Store
3+
yarn-error.log
4+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored (not using zero install yet)
5+
.pnp.*
6+
.yarn/*
7+
!.yarn/patches
8+
!.yarn/plugins
9+
!.yarn/releases
10+
!.yarn/sdks
11+

Diff for: visual-js/.yarn/plugins/@yarnpkg/plugin-version.cjs

+550
Large diffs are not rendered by default.

Diff for: visual-js/.yarnrc.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
5+
spec: '@yarnpkg/plugin-version'
6+
7+
pnpMode: loose

Diff for: visual-js/package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "visual-clients-workspace",
3+
"private": true,
4+
"workspaces": [
5+
"visual",
6+
"visual-storybook",
7+
"visual-wdio",
8+
"visual-cypress",
9+
"visual-nightwatch"
10+
],
11+
"lint-staged": {
12+
"**/*.{js,jsx,ts,tsx}": [
13+
"yarn lint"
14+
]
15+
},
16+
"packageManager": "[email protected]",
17+
"dependencies": {
18+
"@changesets/cli": "^2.27.1"
19+
}
20+
}

Diff for: visual-js/tsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.prod.json",
3+
"compilerOptions": {
4+
"inlineSourceMap": true,
5+
"esModuleInterop": true
6+
}
7+
}

Diff for: visual-js/tsconfig.prod.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"extends": "@tsconfig/node18/tsconfig.json",
3+
4+
"compilerOptions": {
5+
"outDir": "./build",
6+
"allowJs": true,
7+
"declaration": true,
8+
"declarationMap": true,
9+
"resolveJsonModule": true,
10+
"removeComments": false,
11+
"strictFunctionTypes": false,
12+
"experimentalDecorators": true,
13+
"esModuleInterop": true,
14+
"moduleResolution": "Node",
15+
"module": "ESNext",
16+
"lib": ["dom", "es2021"],
17+
"types": ["node"]
18+
},
19+
20+
"exclude": [
21+
"../node_modules",
22+
"__mocks__",
23+
"packages/**/node_modules",
24+
"coverage",
25+
"examples",
26+
"/*.js"
27+
]
28+
}

Diff for: visual-js/visual-cypress/.eslintrc.cjs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
project: 'tsconfig.json',
6+
tsconfigRootDir: __dirname,
7+
sourceType: 'module',
8+
},
9+
plugins: ['@typescript-eslint'],
10+
extends: [
11+
'plugin:@typescript-eslint/recommended',
12+
'plugin:prettier/recommended',
13+
],
14+
root: true,
15+
env: {
16+
node: true,
17+
jest: true,
18+
},
19+
ignorePatterns: ['.eslintrc.cjs', 'build'],
20+
rules: {
21+
'@typescript-eslint/interface-name-prefix': 'off',
22+
'@typescript-eslint/explicit-function-return-type': 'off',
23+
'@typescript-eslint/explicit-module-boundary-types': 'off',
24+
'@typescript-eslint/no-explicit-any': 'off',
25+
26+
// Allow unused vars that start with _
27+
"@typescript-eslint/no-unused-vars": [
28+
"warn",
29+
{
30+
"argsIgnorePattern": "^_",
31+
"varsIgnorePattern": "^_",
32+
"caughtErrorsIgnorePattern": "^_"
33+
}
34+
],
35+
},
36+
};

Diff for: visual-js/visual-cypress/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
.work
3+
build/
4+
coverage/
5+
yarn.lock

Diff for: visual-js/visual-cypress/.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

Diff for: visual-js/visual-cypress/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Sauce Labs Visual for Cypress
2+
3+
This package is Sauce Labs Visual integration for Cypress.<br />
4+
It comes as both a plugin and commands that will be made available for your tests.
5+
6+
## Installation & Usage
7+
8+
View installation and usage instructions on the [Sauce Docs website](https://docs.saucelabs.com/visual-testing/integrations/cypress/).

Diff for: visual-js/visual-cypress/package.json

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"name": "@saucelabs/cypress-visual-plugin",
3+
"version": "0.3.0",
4+
"description": "Cypress plugin for Sauce Visual Testing",
5+
"main": "build/index.cjs",
6+
"module": "build/index.js",
7+
"types": "build/index.d.ts",
8+
"type": "module",
9+
"license": "MIT",
10+
"files": [
11+
"build",
12+
"README.md"
13+
],
14+
"engines": {
15+
"node": "^16.13 || >=18"
16+
},
17+
"typeScriptVersion": "5.1.6",
18+
"keywords": [
19+
"cypress",
20+
"saucelabs",
21+
"visual"
22+
],
23+
"exports": {
24+
".": {
25+
"require": "./build/index.cjs",
26+
"import": "./build/index.js",
27+
"types": "./build/index.d.ts"
28+
},
29+
"./commands": {
30+
"require": "./build/commands.cjs",
31+
"import": "./build/commands.js",
32+
"types": "./build/commands.d.ts"
33+
},
34+
"./package.json": "./package.json"
35+
},
36+
"peerDependencies": {
37+
"cypress": "^12.0.0 || ^13.0.0"
38+
},
39+
"dependencies": {
40+
"@saucelabs/visual": "0.3.0",
41+
"chalk": "^5.3.0",
42+
"exponential-backoff": "^3.1.1",
43+
"macos-release": "^3.2.0",
44+
"node-fetch": "^3.3.1",
45+
"tsup": "^7.2.0"
46+
},
47+
"tsup": {
48+
"entry": [
49+
"./src/commands.ts",
50+
"./src/index.ts"
51+
],
52+
"dts": true,
53+
"outDir": "./build",
54+
"format": [
55+
"cjs",
56+
"esm"
57+
],
58+
"noExternal": [
59+
"chalk",
60+
"macos-release"
61+
]
62+
},
63+
"devDependencies": {
64+
"@tsconfig/node18": "^2.0.1",
65+
"@types/cypress": "^1.1.3",
66+
"@types/node": "^20.4.4",
67+
"@typescript-eslint/eslint-plugin": "^5.59.1",
68+
"@typescript-eslint/parser": "^5.59.1",
69+
"eslint": "^8.0.1",
70+
"eslint-config-prettier": "^8.3.0",
71+
"eslint-plugin-prettier": "^4.0.0",
72+
"jest": "^29.5.0",
73+
"jest-junit-reporter": "^1.1.0",
74+
"prettier": "^2.8.8",
75+
"ts-node": "^10.9.1",
76+
"tsc-watch": "^6.0.4",
77+
"typescript": "^5.1.6"
78+
},
79+
"scripts": {
80+
"build": "tsup",
81+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
82+
"test-ignored": "jest --collect-coverage",
83+
"watch": "tsc-watch --declaration -p .",
84+
"test": "node ./test-cjs.cjs"
85+
},
86+
"publishConfig": {
87+
"access": "public"
88+
}
89+
}

0 commit comments

Comments
 (0)