Skip to content

Commit

Permalink
feat: modularisation (#244)
Browse files Browse the repository at this point in the history
* chore: gitignore for lib directory

* build: packageing for webpack lib build

* build: webpack config

* feat: expose App component with beeApiUrl parameter

* build: tsconfig for library build

* build: main property of package json for tsc build

* refactor: rename beeUrl option to beeApiUrl

* refactor: manange config class instead of process.env calls

* build: babelrc config

* build: babel plugins and presets for webpack build

* chore: serve.js chmod

* build(refactor): webpack build

* refactor: number notation

* chore: webpack and package config change

* build: add babel preset-env

* chore: prepare script also builds component lib

* feat: typegen

* revert: set back prepare command

* build: assets loader config

* feat: beeDebugApiUrl

* refactor: move test files to the test folder because of typegen

* feat: locked api settings

* chore: depcheck ignores

* chore: types check script

* ci: check types

* ci: publish with library

* chore: add webpack as devDep

* chore: locked semver

* chore: remove debug logging

* style: webpack config

* chore: react and react-dom as dependency

* chore: package-lock

* fix: clean package-lock init

* refactor: fix versions in package.json
  • Loading branch information
nugaon authored Dec 9, 2021
1 parent 1a3e58c commit 2a13da1
Show file tree
Hide file tree
Showing 23 changed files with 7,280 additions and 2,184 deletions.
49 changes: 49 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict'

module.exports = function (api) {
const targets = '>1% and not ie 11 and not dead'
api.cache(true)
api.cacheDirectory = true

return {
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{
targets,
modules: false,
}
],
['@babel/preset-react', {runtime: 'automatic' }]
],
plugins: [
[
"babel-plugin-tsconfig-paths",
{
"relative": true,
"extensions": [
".js",
".jsx",
".ts",
".tsx",
".es",
".es6",
".mjs"
],
"rootDir": ".",
"tsconfig": "tsconfig.lib.json",
}
],
"syntax-dynamic-import",
'@babel/plugin-proposal-class-properties',
[
'@babel/plugin-transform-runtime',
{
helpers: false,
regenerator: true
}
]
]
}
}
18 changes: 17 additions & 1 deletion .depcheckrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
{
"ignores": ["@types/jest", "@commitlint/config-conventional", "@types/react-router"]
"ignores": [
"@types/jest",
"@commitlint/config-conventional",
"@types/react-router",
"@babel/core",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime",
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript",
"babel-loader",
"babel-plugin-syntax-dynamic-import",
"babel-plugin-tsconfig-paths",
"file-loader",
"ts-node",
"webpack-cli"
]
}
3 changes: 3 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
env:
CI: true

- name: Types check
run: npm run check:types

- name: Dependency check
run: npm run depcheck

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish_npmjs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run compile:types
- run: npm build:component
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/lib

# misc
.DS_Store
Expand Down
Loading

0 comments on commit 2a13da1

Please sign in to comment.