Skip to content

Commit 0d4908c

Browse files
authored
Merge pull request #3 from atomic-router/feat/new-build-system-and-ci
Migrate to rollup and new ci
2 parents f33a832 + 73b2bd1 commit 0d4908c

File tree

12 files changed

+3787
-1660
lines changed

12 files changed

+3787
-1660
lines changed

.babelrc

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

.github/release-drafter.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
categories:
2+
- title: '⚠️ Breaking changes'
3+
label: 'BREAKING CHANGES'
4+
5+
- title: '🚀 Features'
6+
labels:
7+
- 'feature'
8+
- 'enhancement'
9+
10+
- title: '🐛 Bug Fixes'
11+
labels:
12+
- 'fix'
13+
- 'bugfix'
14+
- 'bug'
15+
16+
- title: '🧰 Maintenance'
17+
labels:
18+
- 'chore'
19+
- 'dependencies'
20+
21+
- title: '📚 Documentation'
22+
label: 'documentation'
23+
24+
- title: '🧪 Tests'
25+
label: 'tests'
26+
27+
- title: '🏎 Optimizations'
28+
label: 'optimizations'
29+
30+
version-resolver:
31+
major:
32+
labels:
33+
- 'BREAKING CHANGES'
34+
minor:
35+
labels:
36+
- 'feature'
37+
- 'enhancement'
38+
patch:
39+
labels:
40+
- 'fix'
41+
default: patch
42+
43+
name-template: 'v$RESOLVED_VERSION'
44+
tag-template: 'v$RESOLVED_VERSION'
45+
46+
change-template: '- $TITLE #$NUMBER (@$AUTHOR)'
47+
template: |
48+
$CHANGES

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Publish CI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-to-npm:
9+
runs-on: ubuntu-18.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Use Node.js 16.x
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 16.x
18+
cache: 'yarn'
19+
20+
- name: Install dependencies
21+
run: yarn install --frozen-lockfile
22+
23+
- name: Build package
24+
run: yarn build
25+
26+
- name: Extract version from release
27+
id: version
28+
uses: olegtarasov/[email protected]
29+
with:
30+
tagRegex: 'v(.*)'
31+
32+
- name: Set version from release
33+
uses: reedyuk/[email protected]
34+
with:
35+
version: ${{ steps.version.outputs.tag }}
36+
git-tag-version: 'false'
37+
38+
- name: Create NPM config
39+
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
40+
env:
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
43+
- name: Check for NEXT tag
44+
id: next
45+
uses: actions-ecosystem/action-regex-match@v2
46+
with:
47+
text: ${{ steps.version.outputs.tag }}
48+
regex: '-next'
49+
50+
- name: Check for RC tag
51+
id: rc
52+
uses: actions-ecosystem/action-regex-match@v2
53+
with:
54+
text: ${{ steps.version.outputs.tag }}
55+
regex: '-rc'
56+
57+
- name: Publish atomic-router-react@${{ steps.version.outputs.tag }} with NEXT tag
58+
if: ${{ steps.next.outputs.match != '' }}
59+
run: npm publish --tag next
60+
61+
- name: Publish atomic-router-react@${{ steps.version.outputs.tag }} with RC tag
62+
if: ${{ steps.rc.outputs.match != '' }}
63+
run: npm publish --tag rc
64+
65+
- name: Publish atomic-router-react@${{ steps.version.outputs.tag }} to latest
66+
if: ${{ steps.next.outputs.match == '' }}
67+
run: npm publish
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
update_release_draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: release-drafter/release-drafter@v5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.DS_Store
33
node_modules
44
dist
5+
.idea

.prettierrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2+
"arrowParens": "always",
3+
"endOfLine": "lf",
4+
"printWidth": 100,
25
"tabWidth": 2,
3-
"useTabs": false,
4-
"printWidth": 100
6+
"useTabs": false
57
}

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Release process
2+
3+
1. Check out the [draft release](https://github.com/atomic-router/react/releases).
4+
1. All PRs should have correct labels and useful titles. You can [review available labels here](https://github.com/atomic-router/react/blob/master/.github/release-drafter.yml).
5+
1. Update labels for PRs and titles, next [manually run the release drafter action](https://github.com/atomic-router/react/actions/workflows/release-drafter.yml) to regenerate the draft release.
6+
1. Review the new version and press "Publish"
7+
1. If required check "Create discussion for this release"

babel.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
plugins: [
3+
['effector/babel-plugin', { factories: ['./src/create-route-view', './src/create-routes-view'] }],
4+
['@babel/plugin-proposal-class-properties', { loose: true }],
5+
'@babel/plugin-proposal-object-rest-spread',
6+
'@babel/plugin-proposal-optional-chaining',
7+
'@babel/plugin-proposal-nullish-coalescing-operator',
8+
],
9+
presets: [
10+
['@babel/preset-env', { loose: true }],
11+
['@babel/preset-typescript'],
12+
['@babel/preset-react', { "runtime": "automatic" }]
13+
],
14+
};

build/minifications.js

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
const nameCache = {};
2+
3+
export const minifyConfig = ({ beautify, inline = true }) => ({
4+
parse: {
5+
bare_returns: false,
6+
ecma: 8,
7+
html5_comments: false,
8+
shebang: true,
9+
},
10+
compress: {
11+
global_defs: {
12+
// __DEV__: false,
13+
// 'process.env.NODE_ENV': 'production',
14+
},
15+
arrows: true,
16+
arguments: true,
17+
booleans: true,
18+
booleans_as_integers: true,
19+
collapse_vars: true,
20+
comparisons: true,
21+
computed_props: true,
22+
conditionals: true,
23+
dead_code: true,
24+
directives: true,
25+
drop_console: false,
26+
drop_debugger: true,
27+
ecma: 8,
28+
evaluate: true,
29+
expression: true, // ?
30+
hoist_funs: true, // ?
31+
hoist_props: true,
32+
hoist_vars: false,
33+
if_return: true,
34+
inline,
35+
join_vars: true, // ?
36+
37+
defaults: false,
38+
keep_classnames: false,
39+
keep_fargs: false,
40+
keep_fnames: false,
41+
loops: true,
42+
module: true,
43+
properties: true,
44+
pure_getters: true,
45+
reduce_funcs: true,
46+
reduce_vars: true,
47+
sequences: true,
48+
side_effects: true,
49+
switches: true,
50+
toplevel: true,
51+
52+
typeofs: true,
53+
unused: true,
54+
passes: 3,
55+
56+
unsafe_arrows: true,
57+
unsafe_Function: true,
58+
unsafe_math: true,
59+
unsafe_proto: true,
60+
},
61+
mangle: {
62+
reserved: ['effector', 'effectorVue', 'effectorReact', 'it', 'test'],
63+
eval: true,
64+
keep_classnames: false,
65+
keep_fnames: false,
66+
module: true,
67+
toplevel: true, // ?
68+
safari10: false,
69+
// properties: {
70+
// builtins: false,
71+
// debug: false,
72+
// keep_quoted: false, //?
73+
// reserved: ['test', 'it'],
74+
// },
75+
},
76+
output: {
77+
ascii_only: false,
78+
braces: false, // ?
79+
// comments: /#/i,
80+
comments: false,
81+
ecma: 8,
82+
beautify,
83+
indent_level: 2,
84+
inline_script: false, // ?
85+
keep_quoted_props: false, // ?
86+
quote_keys: false,
87+
quote_style: 3, // ?
88+
safari10: false,
89+
semicolons: true, // ?
90+
shebang: true,
91+
webkit: false,
92+
wrap_iife: false,
93+
},
94+
// sourceMap: {
95+
// // source map options
96+
// },
97+
ecma: 8,
98+
keep_classnames: false,
99+
keep_fnames: false,
100+
ie8: false,
101+
module: true,
102+
nameCache,
103+
safari10: false,
104+
toplevel: true,
105+
warnings: true,
106+
});

0 commit comments

Comments
 (0)