Skip to content

Commit

Permalink
Merge pull request #131 from ndaidong/11.1.2
Browse files Browse the repository at this point in the history
v11.1.2
  • Loading branch information
ndaidong authored Feb 28, 2023
2 parents 187f087 + a22ace3 commit 69d42a3
Show file tree
Hide file tree
Showing 20 changed files with 233 additions and 111 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
122 changes: 122 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"env": {
"es6": true,
"node": true,
"jest": true,
"browser": true
},
"globals": {
"globalThis": true,
"URLPattern": true
},
"plugins": [],
"overrides": [],
"extends": ["eslint:recommended"],
"rules": {
"arrow-spacing": ["error", { "before": true, "after": true }],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": ["error", {
"allow": ["^UNSAFE_"],
"properties": "never",
"ignoreGlobals": true
}],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "never",
"exports": "never",
"functions": "never"
}],
"comma-spacing": ["error", { "before": false, "after": true }],
"eol-last": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"func-call-spacing": ["error", "never"],
"indent": [
"error",
2,
{
"MemberExpression": 1,
"FunctionDeclaration": {
"body": 1,
"parameters": 2
},
"SwitchCase": 1
}
],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"keyword-spacing": ["error", { "before": true, "after": true }],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"max-len": [
"error",
{
"code": 120,
"ignoreTrailingComments": true,
"ignoreComments": true,
"ignoreUrls": true
}
],
"max-lines": [
"error",
{
"max": 360,
"skipBlankLines": true,
"skipComments": false
}
],
"max-lines-per-function": [
"error",
{
"max": 250,
"skipBlankLines": true
}
],
"max-params": ["error", 4],
"no-array-constructor": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxEOF": 0
}
],
"no-restricted-syntax": [
"error",
"WithStatement",
"BinaryExpression[operator='in']"
],
"no-trailing-spaces": "error",
"no-use-before-define": [
"error",
{
"functions": true,
"classes": true,
"variables": false
}
],
"no-var": "warn",
"object-curly-spacing": ["error", "always"],
"padded-blocks": [
"error",
{
"blocks": "never",
"switches": "never",
"classes": "never"
}
],
"quotes": ["error", "single"],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"space-in-parens": ["error", "never"],
"semi": ["error", "never"]
}
}
8 changes: 4 additions & 4 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:

strategy:
matrix:
node_version: [14.x, 15.x, 16.x, 17.x, 18.x]
node_version: [14.x, 15.x, 16.x, 17.x, 18.x, 19.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: setup Node.js v${{ matrix.node_version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}

Expand All @@ -39,7 +39,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand Down
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
coverage
.github
pnpm-lock.yaml
examples
build.js
build.test.js
reset.js
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ Lightweight util for handling data type, string... in your Node.js and browser a
![CI test](https://github.com/ndaidong/bellajs/workflows/ci-test/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/ndaidong/bellajs/badge.svg)](https://coveralls.io/github/ndaidong/bellajs)
![CodeQL](https://github.com/ndaidong/bellajs/workflows/CodeQL/badge.svg)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

You may be interested in [BellaPy](https://github.com/ndaidong/bellapy) too.
[![CodeFactor](https://www.codefactor.io/repository/github/ndaidong/bellajs/badge)](https://www.codefactor.io/repository/github/ndaidong/bellajs)

# Contents

Expand Down Expand Up @@ -79,7 +77,6 @@ console.log(genid())
- `.isString(Anything val)`
- `.isUndefined(Anything val)`


### String manipulation

- `.ucfirst(String s)`
Expand Down
14 changes: 7 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ const pkg = JSON.parse(readFileSync('./package.json', { encoding: 'utf-8' }))

rmSync('dist', {
force: true,
recursive: true
recursive: true,
})
mkdirSync('dist')

const buildTime = (new Date()).toISOString()
const comment = [
`// ${pkg.name}@${pkg.version} ${pkg.repository.url}`,
`built with esbuild at ${buildTime}`
`built with esbuild at ${buildTime}`,
].join(' - ')

const baseOpt = {
Expand All @@ -28,7 +28,7 @@ const baseOpt = {
target: ['es2020', 'node14'],
minify: true,
write: true,
sourcemap: 'external'
sourcemap: 'external',
}

const esmVersion = {
Expand All @@ -37,8 +37,8 @@ const esmVersion = {
format: 'esm',
outfile: 'dist/bella.esm.js',
banner: {
js: comment
}
js: comment,
},
}
buildSync(esmVersion)

Expand All @@ -49,8 +49,8 @@ const cjsVersion = {
mainFields: ['main'],
outfile: 'dist/bella.js',
banner: {
js: comment
}
js: comment,
},
}

buildSync(cjsVersion)
2 changes: 1 addition & 1 deletion dist/bella.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 69d42a3

Please sign in to comment.