Skip to content

Commit 53c8edd

Browse files
author
Matej Lednicky
committed
feat(DIST-39): Initial commit
0 parents  commit 53c8edd

File tree

98 files changed

+18943
-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.

98 files changed

+18943
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
max_line_length=120
8+
end_of_line=lf
9+
charset=utf-8
10+
trim_trailing_whitespace=true
11+
insert_final_newline=true
12+
13+
[*.js]
14+
indent_style=space
15+
indent_size=2

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
EYES_API_KEY=YOURKEY
2+
URL=http://localhost:8080

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/node_modules/**
2+
dist/**
3+
lib/**
4+
redvelvet/**

.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
extends: ['@typeform/eslint-config'],
3+
globals: {
4+
Feature: true,
5+
Scenario: true,
6+
within: true,
7+
actor: true,
8+
cy: true,
9+
Cypress: true
10+
},
11+
rules: {
12+
"comma-dangle": ["error", "never"],
13+
complexity: 0
14+
}
15+
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Typeform/distribution

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- Thanks for submitting a PR! Please before merging this PR ensure all the following steps are fullfilled: -->
2+
3+
- [ ] Explain the **motivation** for making this change.
4+
- [ ] Provide a **test plan** demonstrating that the code is solid.
5+
- [ ] Match the **code formatting** of the rest of the codebase.
6+
- [ ] Two other colleagues must **approve** this change.
7+
- [ ] **QA** have tested the solution provided.
8+
- [ ] **Design and UX** must validate this change.

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# OSX and ide's folder attributes
2+
.DS_Store
3+
Thumbs.db
4+
.cache
5+
.project
6+
.settings
7+
.tmproj
8+
*.esproj
9+
nbproject
10+
*.sublime-project
11+
*.sublime-workspace
12+
*.sublime-*
13+
jsconfig.json
14+
.vscode
15+
.idea
16+
.env
17+
18+
# common node files and folders
19+
# https://github.com/github/gitignore/blob/master/Node.gitignore
20+
lib-cov
21+
*.seed
22+
*.log
23+
*.csv
24+
*.dat
25+
*.out
26+
*.pid
27+
*.gz
28+
29+
pids
30+
logs
31+
results
32+
33+
build/Release # Compiled binary addons (http://nodejs.org/api/addons.html)
34+
35+
# always-ignore extensions
36+
*.diff
37+
*.err
38+
*.orig
39+
*.rej
40+
*.swo
41+
*.swp
42+
*.vi
43+
*~
44+
*.sass-cache
45+
46+
# Coverage directory used by tools like istanbul
47+
coverage
48+
49+
# nodemon
50+
.monitor
51+
52+
dist
53+
lib
54+
node_modules
55+
.npmrc
56+
57+
# codeceptjs
58+
e2e/output
59+
60+
# cypress
61+
cypress

.travis.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
os: linux
2+
dist: trusty
3+
4+
language: node_js
5+
6+
node_js:
7+
- "12"
8+
9+
python:
10+
- "3.6"
11+
12+
addons:
13+
chrome: stable
14+
firefox: latest
15+
16+
branches:
17+
only:
18+
- master
19+
- release
20+
21+
cache:
22+
npm: false
23+
yarn: false
24+
25+
notifications:
26+
email: false
27+
slack:
28+
rooms:
29+
- $SLACK_NOTIFICATION_TOKEN#distribution-alerts
30+
on_pull_requests: true
31+
32+
env:
33+
VERSION: "$TRAVIS_BUILD_NUMBER"
34+
35+
before_install:
36+
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY
37+
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY
38+
39+
jobs:
40+
include:
41+
- stage: "Test"
42+
name: "Test"
43+
if: branch = master OR branch = release
44+
script:
45+
- yarn start --no-info & export EMBED_PID=$!
46+
- yarn test
47+
- kill $EMBED_PID
48+
- name: "Visual Test Chrome"
49+
if: fork = false AND (branch = master OR branch = release)
50+
script:
51+
- yarn start --no-info & export EMBED_PID=$!
52+
- yarn test:visual:install
53+
- yarn test:visual:chrome
54+
- kill $EMBED_PID
55+
- name: "Visual Test Firefox"
56+
if: fork = false AND (branch = master OR branch = release)
57+
script:
58+
- yarn start --no-info & export EMBED_PID=$!
59+
- yarn test:visual:install
60+
- yarn test:visual:firefox
61+
- kill $EMBED_PID
62+
- name: "Deploy"
63+
# Deploy to preview preview URL for testing purposes. Only deploy pull requests to 'release' branch.
64+
if: branch = release
65+
script:
66+
- pip install --user awscli
67+
- aws s3 cp ./dist s3://$AWS_ASSETS_BUCKET/$TRAVIS_COMMIT --recursive --acl public-read
68+
- stage: "Release"
69+
name: "Release to NPM"
70+
if: branch = release AND type = push
71+
script:
72+
- yarn semantic-release
73+
- name: "Release to AWS"
74+
# Deploy to AWS production is done by copying already deployed sources via "Test and Publish" job.
75+
# This allows us to rollback quickly (no building, just copy existing file).
76+
git:
77+
clone: false
78+
if: branch = release AND type = push
79+
script:
80+
- pip install --user awscli
81+
- aws s3 cp s3://$AWS_ASSETS_BUCKET/$TRAVIS_COMMIT s3://$AWS_ASSETS_BUCKET/ --recursive --acl public-read

.typeform.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Embed"
2+
description: "Library for embedding Typeforms in external websites"
3+
team:
4+
name: "Sticky bugs"
5+
slack_channel: "#stick_bug"
6+
metrics:
7+
logging: "https://rpm.newrelic.com/accounts/291864/browser/9223656"
8+
ci_url:
9+
- "https://travis-ci.com/Typeform/embed"
10+
- "https://jenkins.typeform.tf/view/Embed/"
11+
deploy_url: "https://s3-eu-west-1.amazonaws.com/share.typeform.com"
12+
dependencies:
13+
- { name: "jarvis", url: "https://github.com/Typeform/jarvis" }

CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# How to contribute
2+
3+
Thank you for contributing to the Typeform Embed software development kit (SDK)! We're glad you're here and grateful for your help.
4+
5+
This document describes how to set up the project locally, our development goals, and how to submit your changes in pull requests and send us your ideas and feedback.
6+
7+
## Local set up
8+
9+
Requirements:
10+
* `node` >= 12
11+
* `yarn`
12+
* `java` >= 14 (to run visual tests)
13+
14+
To work with Embed as a developer:
15+
16+
1. [fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) this repository (https://github.com/Typeform/embed)
17+
2. clone your fork:
18+
```bash
19+
$ git clone git@github.com:<your-github-username>/embed.git
20+
$ cd embed
21+
```
22+
3. install dependencies
23+
```bash
24+
$ yarn
25+
```
26+
4. run:
27+
```bash
28+
$ yarn start # start mock-server and run in development the renderer
29+
$ yarn test # run lint, unit and functional tests
30+
$ yarn test:visual # run visual tests (requires EYES_API_KEY env var for AppliTools)
31+
$ yarn build # build project to ./dist and ./lib
32+
$ yarn clean # delete directories with built files (./dist and ./lib)
33+
```
34+
35+
## Development goals
36+
37+
<!-- * TODO: add items to this bullet list of your current goals for Embed -->
38+
<!-- * TODO: add any priorities you want readers to know about -->
39+
40+
## Development suggestions
41+
42+
<!-- TODO: add any "wishlist" items you hope someone might develop -->
43+
44+
We're always looking for new ways to embed the typeform, code samples and more.
45+
46+
If you have an idea for a community project, please [tell us about it](https://collect.typeform.com/to/F9jz78)!
47+
48+
## Submit your changes via pull request
49+
50+
Submit your changes via [GitHub pull request](https://help.github.com/articles/about-pull-requests/) to [/Typeform/embed](https://github.com/Typeform/embed/pulls) with a clear list of the changes you're making. Only one feature per commit.
51+
52+
Commit messages should follow the [angular project guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits). In short, your message needs to include:
53+
* type (feat, fix, docs, style, refactor, perf, test, chore, revert)
54+
* scope - uppercase JIRA ticket number goes here, you can leave it empty
55+
* message
56+
* body (optional)
57+
* footer (for breaking change only)
58+
59+
Commit message example:
60+
```
61+
type(scope): Commit headline
62+
63+
Body of your commit message is optional. Explain your changes in detail here.
64+
Can have multiple lines.
65+
66+
BREAKING CHANGE: This line should explain which changes. It is required onyl for commits with breaking change.
67+
```
68+
69+
Each open pull request will be tested automatically with:
70+
```bash
71+
$ yarn test
72+
$ yarn test:visual
73+
```
74+
75+
## Send us feedback
76+
77+
[Send us feedback about the Embed SDK](https://collect.typeform.com/to/F9jz78). We can't wait to hear what you think!

0 commit comments

Comments
 (0)