Skip to content

Commit 3ee05a4

Browse files
authored
Merge pull request #360 from vip-git/xhr-schema
feat: xhr schema integration
2 parents 1038776 + c49859a commit 3ee05a4

File tree

155 files changed

+56499
-20178
lines changed

Some content is hidden

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

155 files changed

+56499
-20178
lines changed

.dockerignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
test*.js
2+
dist/demo.js
3+
node_modules
4+
mocheawesome-report-unit
5+
docs/
6+
.gitbook/
7+
.idea/
8+
.github/
9+
todo
10+
jsdom-setup.js
11+
mocha.setup.js
12+
postcss.config.js
13+
webpack.config.demo.js
14+
.prettier.json
15+
now.json
16+
renovate.json
17+
webpack.out.json
18+
README.md
19+
SUMMARY.md
20+
LICENSE
21+
.eslintrc.js
22+
browserstack.js
23+
src/generated

.eslintrc.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
2-
extends: 'airbnb',
3-
rules: {
2+
'extends': [
3+
'airbnb',
4+
'plugin:react-hooks/recommended',
5+
],
6+
'rules': {
47
'import/no-extraneous-dependencies': 'off',
58
'no-trailing-spaces': 'off',
69
'react/jsx-indent': 'off',
@@ -26,5 +29,8 @@ module.exports = {
2629
'no-plusplus': 'off',
2730
'object-curly-newline': 'off',
2831
},
29-
parser: 'babel-eslint',
32+
'parser': 'babel-eslint',
33+
'env': {
34+
'jest/globals': true,
35+
},
3036
};

.github/workflows/node.js.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ name: Build and Test CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ main ]
9+
pull_request:
10+
branches: [main]
11+
types: [opened, synchronize, closed]
912
pull_request_target:
10-
branches: [ master ]
13+
branches: [ main ]
1114

1215
jobs:
1316
build:
@@ -16,7 +19,7 @@ jobs:
1619

1720
strategy:
1821
matrix:
19-
node-version: [12.x, 14.x]
22+
node-version: [14.x] # Add support for 12.x, 15.x later just build and unit tests
2023

2124
steps:
2225
- uses: actions/checkout@v2
@@ -26,4 +29,33 @@ jobs:
2629
node-version: ${{ matrix.node-version }}
2730
- run: npm install
2831
- run: npm test
29-
- run: npm run test:e2e
32+
- name: "Check if deployment is done"
33+
env:
34+
VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
35+
VERCEL_API: ${{secrets.VERCEL_API}}
36+
run : |
37+
isReadyState()
38+
{
39+
GIT_SHA=$(git log -1 --pretty=%B | grep ^Merge | cut -d " " -f 2)
40+
VERCEL_STATE=$(curl -H "$VERCEL_TOKEN" "$VERCEL_API$GIT_SHA" | jq -r '.deployments[0].state')
41+
if [ $VERCEL_STATE = "READY" ]; then
42+
echo Valid state $VERCEL_STATE
43+
elif [ $VERCEL_STATE = "ERROR" ]; then
44+
echo InValid state $VERCEL_STATE 1>&2
45+
exit 64
46+
else
47+
echo invalid state found - $VERCEL_STATE
48+
isReadyState
49+
fi
50+
}
51+
isReadyState
52+
- run: |
53+
GIT_SHA=$(git log -1 --pretty=%B | grep ^Merge | cut -d " " -f 2)
54+
VERCEL_URI=$(curl -H "$VERCEL_TOKEN" "$VERCEL_API$GIT_SHA" | jq -r '.deployments[0].url')
55+
echo ${VERCEL_URI} for ${GITHUB_SHA} with ${GIT_SHA} - ${GITHUB_REF} - ${GITHUB_HEAD_REF} - ${VERCEL_API}
56+
VERCEL_URL="https://${VERCEL_URI}" npm run test:e2e:ci
57+
env:
58+
BROWSERSTACK_USER: ${{secrets.BROWSERSTACK_USER}}
59+
BROWSERSTACK_ACCESSKEY: ${{secrets.BROWSERSTACK_ACCESSKEY}}
60+
VERCEL_TOKEN: ${{secrets.VERCEL_TOKEN}}
61+
VERCEL_API: ${{secrets.VERCEL_API}}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ node_modules
44
mochawesome-report-unit
55
todo
66
generated
7-
7+
src/demo/**/__e2e__
8+
_results_
9+
.DS_Store
810
generator/package-lock.json
911
generator/package.json

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ SUMMARY.md
2424
LICENSE
2525
.eslintrc.js
2626
browserstack.js
27+
generator/

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"command": "npm test",
9+
"name": "Run npm test",
10+
"request": "launch",
11+
"type": "node-terminal"
12+
}
13+
14+
]
15+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"workbench.editor.enablePreview": false,
3+
"notebook.diff.enablePreview": false
4+
}

Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
# Use an official node image
3+
FROM node:lts-alpine
4+
5+
RUN set -xe \
6+
&& apk add --no-cache bash git openssh \
7+
&& git --version && bash --version && ssh -V && npm -v && node -v
8+
9+
# Environment Variables
10+
ENV NODE_ENV production
11+
12+
RUN mkdir -p /opt/react-json-schema
13+
14+
WORKDIR /opt/react-json-schema
15+
COPY src/ /opt/react-json-schema/src
16+
COPY .babelrc /opt/react-json-schema/.babelrc
17+
COPY generator/ /opt/react-json-schema/generator
18+
COPY package.json /opt/react-json-schema/package.json
19+
COPY package-lock.json /opt/react-json-schema/package-lock.json
20+
COPY index.js /opt/react-json-schema/index.js
21+
COPY webpack.config.js /opt/react-json-schema/webpack.config.js
22+
23+
RUN npm install
24+
RUN npm link webpack && \
25+
npm link webpack-cli && \
26+
npm link compression-webpack-plugin && \
27+
npm link babel-loader && \
28+
npm link @babel/core && \
29+
npm link @babel/plugin-transform-runtime && \
30+
npm link @babel/plugin-proposal-class-properties && \
31+
npm link @babel/plugin-proposal-object-rest-spread && \
32+
npm link @babel/plugin-proposal-optional-chaining && \
33+
npm link @babel/plugin-syntax-dynamic-import && \
34+
npm link @babel/plugin-transform-modules-commonjs && \
35+
npm link @babel/plugin-transform-runtime && \
36+
npm link @babel/polyfill && \
37+
npm link @babel/preset-env && \
38+
npm link @babel/preset-react && \
39+
npm link @babel/preset-typescript && \
40+
npm link @babel/register && \
41+
npm link @babel/runtime
42+
RUN node generator/index.js
43+
RUN npx webpack
44+
# EXPOSE 3000
45+
46+
CMD ["node", "index.js"]
47+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default Example;
103103
> For more info you can follow our [changelog](https://github.com/vip-git/react-jsonschema-form-material-ui/blob/master/changelog.md)
104104
105105
## Contributing
106-
> We welcome [all contributions](https://github.com/vip-git/react-jsonschema-form-material-ui/graphs/contributors), enhancements, and bug-fixes.
106+
> We welcome [all contributions](/contributing.md), enhancements, and bug-fixes.
107107
> Open an [issue on GitHub](https://github.com/vip-git/react-jsonschema-form-material-ui/issues) and submit a [pull request](https://github.com/vip-git/react-jsonschema-form-material-ui/pulls).
108108
109109
#### Building/Testing

browserstack.js

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)