Skip to content

Commit c52b8d3

Browse files
Added files from public repo
2 parents 3bf9d90 + 124e06f commit c52b8d3

File tree

368 files changed

+66930
-1
lines changed

Some content is hidden

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

368 files changed

+66930
-1
lines changed

.babel-preset.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var plugins = [
2+
'transform-object-rest-spread',
3+
'lodash',
4+
['inline-replace-variables', {
5+
// Inject version number into code
6+
'__VERSION__': require('./package.json').version
7+
}]
8+
]
9+
10+
11+
function babelConfig () {
12+
return plugins
13+
}
14+
module.exports = babelConfig

.babelrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"presets": ["@babel/preset-env"],
3+
"plugins": [
4+
["@babel/plugin-transform-runtime", {
5+
"regenerator": true
6+
}]
7+
],
8+
"env": {
9+
"test": {
10+
"presets": [
11+
["@babel/env"]
12+
],
13+
"plugins": ["rewire"],
14+
"sourceMaps": "inline"
15+
},
16+
"es5": {
17+
"presets": [
18+
["@babel/env"]
19+
],
20+
"plugins": [
21+
"add-module-exports",
22+
"@babel/plugin-transform-runtime",
23+
"transform-es2015-modules-commonjs"
24+
]
25+
},
26+
"es-modules": {
27+
"presets": [
28+
["@babel/env", {
29+
"modules": false
30+
}]
31+
]
32+
}
33+
}
34+
}

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
// "env": {
3+
// "browser": true,
4+
// "amd": true
5+
// },
6+
extends: 'standard',
7+
// "globals": {
8+
// "Atomics": "readonly",
9+
// "SharedArrayBuffer": "readonly"
10+
// },
11+
// "parserOptions": {
12+
// "ecmaFeatures": {
13+
// "jsx": true
14+
// },
15+
// "ecmaVersion": 2015,
16+
// "sourceType": "module"
17+
// },
18+
plugins: [
19+
'standard',
20+
'promise'
21+
],
22+
rules: {
23+
}
24+
}

.github/workflows/check-branch.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Check Branch'
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
check_branch:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Comment PR
11+
if: github.base_ref == 'master' && github.head_ref != 'next'
12+
uses: thollander/actions-comment-pull-request@v2
13+
with:
14+
message: |
15+
We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch.
16+
- name: Check branch
17+
if: github.base_ref == 'master' && github.head_ref != 'next'
18+
run: |
19+
echo "ERROR: We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch."
20+
exit 1
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
pull_request:
16+
# The branches below must be a subset of the branches above
17+
branches: '*'
18+
19+
jobs:
20+
analyze:
21+
name: Analyze
22+
runs-on: ubuntu-latest
23+
permissions:
24+
actions: read
25+
contents: read
26+
security-events: write
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'javascript' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
33+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
# Initializes the CodeQL tools for scanning.
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v2
42+
with:
43+
languages: ${{ matrix.language }}
44+
# If you wish to specify custom queries, you can do so here or in a config file.
45+
# By default, queries listed here will override any specified in a config file.
46+
# Prefix the list here with "+" to use these queries and those in the config file.
47+
48+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
49+
# queries: security-extended,security-and-quality
50+
51+
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
- name: Autobuild
55+
uses: github/codeql-action/autobuild@v2
56+
57+
# ℹ️ Command-line programs to run using the OS shell.
58+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
59+
60+
# If the Autobuild fails above, remove it and uncomment the following three lines.
61+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
62+
63+
# - run: |
64+
# echo "Run, Build Application using script"
65+
# ./location_of_script_within_repo/buildscript.sh
66+
67+
- name: Perform CodeQL Analysis
68+
uses: github/codeql-action/analyze@v2

.github/workflows/jira.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Create JIRA ISSUE
2+
on:
3+
pull_request:
4+
types: [opened]
5+
jobs:
6+
security:
7+
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}}
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Login into JIRA
12+
uses: atlassian/gajira-login@master
13+
env:
14+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
15+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
16+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
17+
- name: Create a JIRA Issue
18+
id: create
19+
uses: atlassian/gajira-create@master
20+
with:
21+
project: ${{ secrets.JIRA_PROJECT }}
22+
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
23+
summary: |
24+
${{ github.event.pull_request.title }}
25+
description: |
26+
PR: ${{ github.event.pull_request.html_url }}
27+
28+
fields: "${{ secrets.JIRA_FIELDS }}"

.github/workflows/npm-publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Publish package to NPM repository
5+
on:
6+
release:
7+
types: [created]
8+
9+
jobs:
10+
publish-npm:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: '12.x'
17+
registry-url: 'https://registry.npmjs.org'
18+
- run: npm ci
19+
- run: npm publish
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
publish-git:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: '12.x'
29+
registry-url: 'https://npm.pkg.github.com'
30+
scope: '@contentstack'
31+
- run: npm ci
32+
- run: npm publish
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sca-scan.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Source Composition Analysis Scan
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
jobs:
6+
security:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- name: Run Snyk to check for vulnerabilities
11+
uses: snyk/actions/node@master
12+
env:
13+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
14+
with:
15+
args: --all-projects --fail-on=all

.github/workflows/unit-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Unit Test & Reports
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- main
7+
- next
8+
jobs:
9+
build-test:
10+
name: Build & Test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2 # checkout the repo
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: '12.x'
17+
registry-url: 'https://registry.npmjs.org'
18+
- run: npm ci # install packages
19+
- run: npm run test:unit:report:json # run tests (configured to use jest-junit reporter)
20+
- name: Test Report
21+
uses: dorny/test-reporter@v1
22+
if: success() || failure() # run this step even if previous step failed
23+
with:
24+
name: Mocha Unit test # Name of the check run which will be created
25+
path: report.json # Path to test results
26+
reporter: mocha-json # Format of test results
27+
- name: Coverage report
28+
uses: lucassabreu/comment-coverage-clover@main
29+
with:
30+
file: coverage/clover.xml

.gitignore

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Logs
2+
logs
3+
*.log
4+
*.DS_Store
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
25+
.grunt
26+
27+
# Bower dependency directory (https://bower.io/)
28+
bower_components
29+
30+
# node-waf configuration
31+
.lock-wscript
32+
33+
# Compiled binary addons (https://nodejs.org/api/addons.html)
34+
build/Release
35+
36+
# Dependency directories
37+
node_modules/
38+
jspm_packages/
39+
mochawesome-report/
40+
coverage/
41+
test/utility/dataFiles/
42+
test/sanity-check/utility/dataFiles/
43+
report.json
44+
45+
# TypeScript v1 declaration files
46+
typings/
47+
tsconfig.json
48+
# Optional npm cache directory
49+
.npm
50+
51+
# Optional eslint cache
52+
.eslintcache
53+
54+
# Optional REPL history
55+
.node_repl_history
56+
57+
# Output of 'npm pack'
58+
*.tgz
59+
60+
# Yarn Integrity file
61+
.yarn-integrity
62+
63+
# dotenv environment variables file
64+
.env
65+
66+
# next.js build output
67+
.next
68+
.dccache
69+
dist
70+
jsdocs

0 commit comments

Comments
 (0)