Skip to content

Commit

Permalink
v. 1.2.1:
Browse files Browse the repository at this point in the history
New Web documentation
Tests are in a separate package (for better dynamic types checking)
  • Loading branch information
Yoskutik committed Sep 25, 2023
1 parent 4412cb9 commit edc255d
Show file tree
Hide file tree
Showing 487 changed files with 12,325 additions and 17,278 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[*]
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = crlf
charset = utf-8

[*.{ts,tsx,js,json}]
indent_style = space
indent_size = 2
57 changes: 27 additions & 30 deletions .github/scripts/size-badge.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
const https = require('https');
const path = require('path');
const fs = require('fs');

const appDir = path.resolve(__dirname, '../../');

const files = fs.readdirSync(path.resolve(appDir, 'packages/form-schema/dist'))
.filter(it => it.endsWith('.js'))
.map(it => path.resolve(appDir, 'packages/form-schema/dist', it));

const size = files.reduce((acc, file) => acc + fs.statSync(file).size, 0);
const weight = `%E2%89%A4%20${Math.round(size / 10) / 100}KB`;

console.log(`New package size is ${decodeURI(weight)}`);

https
.get(`https://img.shields.io/badge/Weight-${weight}-green`, resp => {
let data = '';

resp.on('data', chunk => {
data += chunk;
});

resp.on('end', () => {
fs.writeFileSync(path.resolve(appDir, 'badges/weight.svg'), data);
});
})
.on("error", (err) => {
console.log("Error: " + err.message);
});
const https = require('https');
const path = require('path');
const fs = require('fs');

const appDir = path.resolve(__dirname, '../../');

const file = path.resolve(appDir, 'packages/mobx-form-schema/dist/mobx-form-schema.production.js');
const size = fs.statSync(file).size;
const weight = `%E2%89%A4%20${Math.round(size / 10) / 100}KB`;

console.log(`New package size is ${decodeURI(weight)}`);

https
.get(`https://img.shields.io/badge/Weight-${weight}-green`, resp => {
let data = '';

resp.on('data', chunk => {
data += chunk;
});

resp.on('end', () => {
fs.writeFileSync(path.resolve(appDir, 'badges/weight.svg'), data);
});
})
.on("error", (err) => {
console.log("Error: " + err.message);
});
120 changes: 60 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install
run: |
yarn cache clean
yarn install
- name: Build 🔧
run: yarn build

- name: Tests
run: yarn test

# - name: Deploy documentation 🚀
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# folder: packages/docs/build
# if: github.event_name != 'pull_request'

- name: Setting upsteam
run: git push --set-upstream origin master
if: github.event_name != 'pull_request'

- name: Generating coverage badges
uses: jpb06/jest-badges-action@latest
with:
coverage-summary-path: packages/form-schema/coverage/coverage-summary.json
branches: master,preprod,staging
if: github.event_name != 'pull_request'

- name: Generating the size badge
run: |
node .github/scripts/size-badge.js
git add badges/weight.svg
git commit -m "Generating the size badge"
git push
if: github.event_name != 'pull_request'
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install
run: |
yarn cache clean
yarn install
- name: Build 🔧
run: yarn build

- name: Tests
run: yarn test

- name: Deploy documentation 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: packages/docs/build
if: github.event_name != 'pull_request'

- name: Setting upsteam
run: git push --set-upstream origin master
if: github.event_name != 'pull_request'

- name: Generating coverage badges
uses: jpb06/jest-badges-action@latest
with:
coverage-summary-path: packages/coverage/coverage-summary.json
branches: master,preprod,staging
if: github.event_name != 'pull_request'

- name: Generating the size badge
run: |
node .github/scripts/size-badge.js
git add badges/weight.svg
git commit -m "Generating the size badge"
git push
if: github.event_name != 'pull_request'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/.idea
.DS_Store
node_modules
/coverage
/packages/coverage
Loading

0 comments on commit edc255d

Please sign in to comment.