@toptal/davinci-skeleton 7.2.1-alpha-feat-fx-2770-init-command.6 → 7.3.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/.eslintignore CHANGED
@@ -2,3 +2,4 @@
2
2
  /node_modules
3
3
  /reports
4
4
  !.happo.js
5
+ /storybook-static
@@ -0,0 +1,87 @@
1
+ name: Deploy Storybook to Staging
2
+
3
+ on:
4
+ # when PR was merged to master/main branch
5
+ push:
6
+ branches:
7
+ - master
8
+ - main
9
+ # when a workflow was triggered manually
10
+ workflow_dispatch:
11
+ inputs:
12
+ version:
13
+ description: 'Commit hash to deploy'
14
+ required: true
15
+
16
+ concurrency:
17
+ group: storybook-staging-${{ github.head_ref }}
18
+ cancel-in-progress: true
19
+
20
+ env:
21
+ GITHUB_TOKEN: ${{ secrets.TOPTAL_DEVBOT_TOKEN }}
22
+ JENKINS_DEPLOY_TOKEN: ${{ secrets.TOPTAL_JENKINS_MAIN_TOKEN }}
23
+ REPOSITORY_NAME: ${{ github.event.repository.name }}
24
+ GCR_ACCOUNT_KEY: ${{ secrets.GCR_ACCOUNT_KEY }}
25
+
26
+ jobs:
27
+ check-event:
28
+ name: Check Event
29
+ timeout-minutes: 5
30
+ runs-on: ubuntu-latest
31
+ if: >
32
+ github.event_name == 'push' || (
33
+ github.event_name == 'workflow_dispatch' && github.event.inputs.version
34
+ )
35
+ outputs:
36
+ sha: ${{ steps.specify-sha.outputs.result }}
37
+ should-deploy-to-staging: ${{ steps.deployment-necessity.outputs.should-deploy-to-staging }}
38
+ steps:
39
+ - id: specify-sha
40
+ uses: toptal/davinci-github-actions/get-workflow-sha@v3.2.0
41
+
42
+ - name: Checkout
43
+ uses: actions/checkout@v2
44
+ with:
45
+ token: ${{ env.GITHUB_TOKEN }}
46
+ ref: ${{ steps.specify-sha.outputs.result }}
47
+
48
+ - name: Read davinci configuration
49
+ id: davinci-config-data
50
+ if: hashFiles('davinci.yaml') != ''
51
+ uses: KJ002/read-yaml@87ea341cbbca892fb195e0c4aa49a114c5363b78
52
+ with:
53
+ file: './davinci.yaml'
54
+ key-path: '["master"]'
55
+
56
+ - name: Check if it should be deployed
57
+ id: deployment-necessity
58
+ uses: actions/github-script@v3.0.0
59
+ env:
60
+ DAVINCI_CONFIG_DATA: ${{ steps.davinci-config-data.outputs.data }}
61
+ EVENT_NAME: ${{ github.event_name }}
62
+ with:
63
+ github-token: ${{ env.GITHUB_TOKEN }}
64
+ result-encoding: string
65
+ script: |
66
+ const {DAVINCI_CONFIG_DATA, EVENT_NAME} = process.env
67
+ const configData = DAVINCI_CONFIG_DATA ? JSON.parse(DAVINCI_CONFIG_DATA) : null
68
+ const shouldDeployToStaging = EVENT_NAME === 'workflow_dispatch' ? true : configData ? configData.deploy_storybook_staging : false
69
+ core.setOutput('should-deploy-to-staging', shouldDeployToStaging)
70
+
71
+ deploy-storybook-staging:
72
+ name: Build & Deploy Storybook image
73
+ if: ${{ fromJSON(needs.check-event.outputs.should-deploy-to-staging) == true }}
74
+ needs: [ check-event ]
75
+ timeout-minutes: 45
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - name: Checkout
79
+ uses: actions/checkout@v3
80
+ with:
81
+ token: ${{ env.GITHUB_TOKEN }}
82
+ ref: ${{ needs.check-event.outputs.sha }}
83
+
84
+ - uses: toptal/davinci-github-actions/deploy-storybook@v4.0.0
85
+ with:
86
+ sha: ${{ needs.check-event.outputs.sha }}
87
+ environment: staging
@@ -0,0 +1,41 @@
1
+ name: Deploy Storybook to Temploy
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [ created ]
6
+
7
+ concurrency:
8
+ group: storybook-staging-${{ github.head_ref }}
9
+ cancel-in-progress: true
10
+
11
+ env:
12
+ GITHUB_TOKEN: ${{ secrets.TOPTAL_DEVBOT_TOKEN }}
13
+ JENKINS_DEPLOY_TOKEN: ${{ secrets.TOPTAL_JENKINS_BUILD_TOKEN }}
14
+ GCR_ACCOUNT_KEY: ${{ secrets.GCR_ACCOUNT_KEY }}
15
+
16
+ jobs:
17
+ deploy-storybook-temploy:
18
+ name: Build & Deploy Storybook image
19
+ if: github.event.issue.pull_request && github.event.comment.body == '@toptal-bot run storybook-temploy'
20
+ timeout-minutes: 45
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - id: branch
24
+ uses: xt0rted/pull-request-comment-branch@v1.3.0
25
+
26
+ - name: Specify branch
27
+ id: get-branch
28
+ run: |
29
+ echo "::set-output name=branch::${{ steps.branch.outputs.head_ref }}"
30
+ echo "::set-output name=sha::${{ steps.branch.outputs.head_sha }}"
31
+
32
+ - name: Checkout
33
+ uses: actions/checkout@v3
34
+ with:
35
+ ref: ${{ steps.get-branch.outputs.branch }}
36
+
37
+ - uses: toptal/davinci-github-actions/deploy-storybook@v4.1.0
38
+ with:
39
+ sha: ${{ steps.get-branch.outputs.sha }}
40
+ environment: temploy
41
+ env-file: .env.temploy
@@ -16,6 +16,7 @@
16
16
  /dist
17
17
  /dist-package
18
18
  /reports
19
+ /storybook-static
19
20
 
20
21
  # misc
21
22
  .DS_Store
@@ -0,0 +1,5 @@
1
+ const config = require('@davinci/storybook')
2
+
3
+ module.exports = {
4
+ ...config,
5
+ }
File without changes
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 7.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1423](https://github.com/toptal/davinci/pull/1423) [`45eabb19`](https://github.com/toptal/davinci/commit/45eabb194ccb01173182b5bad6f63b0184a8f640) Thanks [@dmaklygin](https://github.com/dmaklygin)! - - Implement storybook image deployment to staging via GHA
8
+
9
+ * [#1430](https://github.com/toptal/davinci/pull/1430) [`53fdce83`](https://github.com/toptal/davinci/commit/53fdce83b96d7c33c5b9aa55c5cbd5e917664287) Thanks [@dmaklygin](https://github.com/dmaklygin)! - - Implement storybook deployment to temploy
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1440](https://github.com/toptal/davinci/pull/1440) [`b2f9c785`](https://github.com/toptal/davinci/commit/b2f9c78595d5f65c771b44c6dc2ca0a328f8c42c) Thanks [@denieler](https://github.com/denieler)! - Improve type checking for cypress folder in Davinci Skeleton
14
+
3
15
  ## 7.2.0
4
16
 
5
17
  ### Minor Changes
@@ -1,3 +1,5 @@
1
+ import { describe, it, cy } from 'local-cypress'
2
+
1
3
  describe('Application', function () {
2
4
  it('opens correctly', function () {
3
5
  cy.visit('/')
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "extends": "../tsconfig.json",
3
- "compilerOptions": {
4
- "types": ["cypress"]
5
- }
3
+ "include": [
4
+ "../node_modules/cypress",
5
+ "../cypress"
6
+ ]
6
7
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@toptal/davinci-skeleton",
3
+ "version": "7.3.0",
4
+ "description": "Toptal frontend application created with Davinci CLI",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "author": "Toptal",
9
+ "homepage": "https://github.com/toptal/davinci/tree/master/packages/bootstrap#readme",
10
+ "license": "ISC",
11
+ "devDependencies": {
12
+ "@cypress/react": "^6.0.0",
13
+ "@toptal/browserslist-config": "^1.2.0",
14
+ "@types/happo-cypress": "^3.0.0",
15
+ "@types/jest": "^27.5.1",
16
+ "@types/react": "^18.0.14",
17
+ "@types/react-dom": "^18.0.4",
18
+ "@types/styled-components": "^5.1.25",
19
+ "@types/wait-on": "^5.3.1",
20
+ "happo-e2e": "^1.2.0",
21
+ "jest-environment-jsdom": "^28.1.0",
22
+ "local-cypress": "^1.2.6",
23
+ "postinstall-postinstall": "^2.1.0",
24
+ "wait-on": "^6.0.1",
25
+ "yarn-deduplicate": "^4.0.0"
26
+ },
27
+ "resolutions": {
28
+ "cypress": "^10.0.0"
29
+ },
30
+ "scripts": {
31
+ "analyze": "davinci engine analyze",
32
+ "build": "davinci engine build",
33
+ "start": "PORT=3000 davinci engine start --https --open-url https://local-development.staging.toptal.net:3000",
34
+ "start:ci": "PORT=3000 davinci engine start --https",
35
+ "test": "davinci qa unit --runInBand true",
36
+ "test:ci": "LANG=en_US davinci qa unit --ci --maxWorkers 100% --testTimeout=10000 --silent",
37
+ "test:integration": "NODE_ENV=development davinci qa integration run --baseUrl=https://local-development.staging.toptal.net:3000",
38
+ "test:integration:ci": "yarn start:ci & wait-on -i 10000 https://local-development.staging.toptal.net:3000 && yarn happo-e2e -- -- yarn test:integration",
39
+ "test:integration:ct": "NODE_ENV=development davinci qa integration run --component",
40
+ "test:integration:ct:ci": "NODE_ENV=development yarn happo-e2e -- -- davinci qa integration run --component",
41
+ "lint": "davinci syntax lint code . && davinci syntax lint styles .",
42
+ "typecheck": "tsc --noEmit && tsc --project cypress --noEmit",
43
+ "prepublish": "if [ -f 'yarn.lock' ]; then yarn-deduplicate yarn.lock; fi",
44
+ "build:package": "../../bin/build-package.js",
45
+ "storybook": "start-storybook -p 6006",
46
+ "storybook:build": "build-storybook --docs -c .storybook -o ./storybook-static",
47
+ "prepack": "./bin/prepack-skeleton",
48
+ "postpack": "./bin/postpack-skeleton",
49
+ "prepublishOnly": "../../bin/prepublish.js"
50
+ },
51
+ "lint-staged": {
52
+ "*.{js,jsx,ts,tsx}": [
53
+ "davinci syntax lint code",
54
+ "prettier --write"
55
+ ],
56
+ "styles.{js,jsx,ts,tsx}": [
57
+ "davinci syntax lint styles",
58
+ "prettier --write"
59
+ ]
60
+ },
61
+ "sideEffects": false,
62
+ "main": "./src/index.tsx"
63
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-skeleton",
3
- "version": "7.2.1-alpha-feat-fx-2770-init-command.6+c3d87e61",
3
+ "version": "7.3.0",
4
4
  "description": "Toptal frontend application created with Davinci CLI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,7 +10,7 @@
10
10
  "license": "ISC",
11
11
  "devDependencies": {
12
12
  "@cypress/react": "^6.0.0",
13
- "@toptal/browserslist-config": "1.2.1-alpha-feat-fx-2770-init-command.395+c3d87e61",
13
+ "@toptal/browserslist-config": "^1.2.0",
14
14
  "@types/happo-cypress": "^3.0.0",
15
15
  "@types/jest": "^27.5.1",
16
16
  "@types/react": "^18.0.14",
@@ -39,9 +39,11 @@
39
39
  "test:integration:ct": "NODE_ENV=development davinci qa integration run --component",
40
40
  "test:integration:ct:ci": "NODE_ENV=development yarn happo-e2e -- -- davinci qa integration run --component",
41
41
  "lint": "davinci syntax lint code . && davinci syntax lint styles .",
42
- "typecheck": "tsc --noEmit",
42
+ "typecheck": "tsc --noEmit && tsc --project cypress --noEmit",
43
43
  "prepublish": "if [ -f 'yarn.lock' ]; then yarn-deduplicate yarn.lock; fi",
44
44
  "build:package": "../../bin/build-package.js",
45
+ "storybook": "start-storybook -p 6006",
46
+ "storybook:build": "build-storybook --docs -c .storybook -o ./storybook-static",
45
47
  "prepack": "./bin/prepack-skeleton",
46
48
  "postpack": "./bin/postpack-skeleton",
47
49
  "prepublishOnly": "../../bin/prepublish.js"
@@ -57,6 +59,5 @@
57
59
  ]
58
60
  },
59
61
  "sideEffects": false,
60
- "main": "./src/index.tsx",
61
- "gitHead": "c3d87e61b17feba320eb6f76c4f0e4d016955cbd"
62
+ "main": "./src/index.tsx"
62
63
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@toptal/davinci-skeleton",
3
+ "version": "7.3.0",
4
+ "description": "Toptal frontend application created with Davinci CLI",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "author": "Toptal",
9
+ "homepage": "https://github.com/toptal/davinci/tree/master/packages/bootstrap#readme",
10
+ "license": "ISC",
11
+ "devDependencies": {
12
+ "@cypress/react": "^6.0.0",
13
+ "@toptal/browserslist-config": "^1.2.0",
14
+ "@types/happo-cypress": "^3.0.0",
15
+ "@types/jest": "^27.5.1",
16
+ "@types/react": "^18.0.14",
17
+ "@types/react-dom": "^18.0.4",
18
+ "@types/styled-components": "^5.1.25",
19
+ "@types/wait-on": "^5.3.1",
20
+ "happo-e2e": "^1.2.0",
21
+ "jest-environment-jsdom": "^28.1.0",
22
+ "local-cypress": "^1.2.6",
23
+ "postinstall-postinstall": "^2.1.0",
24
+ "wait-on": "^6.0.1",
25
+ "yarn-deduplicate": "^4.0.0"
26
+ },
27
+ "resolutions": {
28
+ "cypress": "^10.0.0"
29
+ },
30
+ "scripts": {
31
+ "analyze": "davinci engine analyze",
32
+ "build": "davinci engine build",
33
+ "start": "PORT=3000 davinci engine start --https --open-url https://local-development.staging.toptal.net:3000",
34
+ "start:ci": "PORT=3000 davinci engine start --https",
35
+ "test": "davinci qa unit --runInBand true",
36
+ "test:ci": "LANG=en_US davinci qa unit --ci --maxWorkers 100% --testTimeout=10000 --silent",
37
+ "test:integration": "NODE_ENV=development davinci qa integration run --baseUrl=https://local-development.staging.toptal.net:3000",
38
+ "test:integration:ci": "yarn start:ci & wait-on -i 10000 https://local-development.staging.toptal.net:3000 && yarn happo-e2e -- -- yarn test:integration",
39
+ "test:integration:ct": "NODE_ENV=development davinci qa integration run --component",
40
+ "test:integration:ct:ci": "NODE_ENV=development yarn happo-e2e -- -- davinci qa integration run --component",
41
+ "lint": "davinci syntax lint code . && davinci syntax lint styles .",
42
+ "typecheck": "tsc --noEmit && tsc --project cypress --noEmit",
43
+ "prepublish": "if [ -f 'yarn.lock' ]; then yarn-deduplicate yarn.lock; fi",
44
+ "build:package": "../../bin/build-package.js",
45
+ "storybook": "start-storybook -p 6006",
46
+ "storybook:build": "build-storybook --docs -c .storybook -o ./storybook-static",
47
+ "prepack": "./bin/prepack-skeleton",
48
+ "postpack": "./bin/postpack-skeleton",
49
+ "prepublishOnly": "../../bin/prepublish.js"
50
+ },
51
+ "lint-staged": {
52
+ "*.{js,jsx,ts,tsx}": [
53
+ "davinci syntax lint code",
54
+ "prettier --write"
55
+ ],
56
+ "styles.{js,jsx,ts,tsx}": [
57
+ "davinci syntax lint styles",
58
+ "prettier --write"
59
+ ]
60
+ },
61
+ "sideEffects": false,
62
+ "main": "./src/index.tsx"
63
+ }
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import Picasso from '@toptal/picasso-provider'
3
- import { cy } from 'local-cypress'
3
+ import { cy, describe, it } from 'local-cypress'
4
4
 
5
5
  import Subtitle from './Subtitle'
6
6
 
package/tsconfig.json CHANGED
@@ -15,7 +15,6 @@
15
15
  "resolveJsonModule": true,
16
16
  "noEmit": true,
17
17
  "jsx": "preserve",
18
- "typeRoots": ["./@types", "./node_modules/@types"],
19
18
  "baseUrl": ".",
20
19
  "outDir": "./dist-package",
21
20
  "paths": {
@@ -26,5 +25,5 @@
26
25
  "@modules": ["src/modules/index"]
27
26
  }
28
27
  },
29
- "include": ["src", "cypress.d.ts"]
28
+ "include": ["src", "./@types"]
30
29
  }
@@ -1,12 +0,0 @@
1
- // Loads plugins required for code orchestration,
2
- // code generation and parallelization (in CI)
3
- // eslint-disable-next-line import/no-extraneous-dependencies
4
- const plugins = require('@toptal/davinci-qa/src/configs/cypress/plugins')
5
-
6
- module.exports = (on, config) => {
7
- plugins(on, config)
8
-
9
- // configure plugins here
10
-
11
- return config
12
- }