Skip to content

Commit

Permalink
Merge pull request #237 from eik-lib/refactor
Browse files Browse the repository at this point in the history
Common package refactor
  • Loading branch information
benja committed Jul 26, 2022
2 parents 8d791c6 + ea1f460 commit c6f9613
Show file tree
Hide file tree
Showing 87 changed files with 642 additions and 401 deletions.
40 changes: 32 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
{
"extends": ["airbnb-base", "prettier"],
"plugins": ["prettier"],
"rules": {
"strict": [0, "global"],
"class-methods-use-this": [0],
"no-underscore-dangle": [0],
"no-restricted-syntax": [0]
}
"parser": "@babel/eslint-parser",
"extends": [
"airbnb-base",
"prettier"
],
"plugins": [
"prettier"
],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module",
"requireConfigFile": false
},
"rules": {
"import/prefer-default-export": "off",
"import/extensions": [
"error",
{
"js": "ignorePackages",
"json": "ignorePackages"
}
],
"class-methods-use-this": [
0
],
"no-underscore-dangle": [
0
],
"no-restricted-syntax": [
0
]
}
}
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [14.x, 16.x]
node-version: [16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -17,29 +17,29 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: install dependencies
run: |
npm install
npm install --workspaces
env:
CI: true
- name: lint files
run: |
npm run lint
npm run lint --workspaces
env:
CI: true
- name: style check files
run: |
npm run style:check
npm run style:check --workspaces
env:
CI: true
- name: typecheck files
run: |
npm run typecheck
npm run typecheck --workspaces
env:
CI: true
- name: check eik json schema is up to date
run: |
npm run schema:outdated
npm run schema:outdated --workspace=packages/schemas
env:
CI: true
- name: run tests
run: |
npm test
npm test --workspaces
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ tmp/**/*
*.log
coverage
.vscode
eik.json
types
.eik.json
types
4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
.nyc_output
node_modules/**/*
.nyc_output/**/*
package-lock.json
node_modules/**/*
.DS_Store
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-disable import/no-unresolved */

'use strict';

import scrollIntoView from 'scroll-into-view-if-needed';

const main = () => {
Expand Down
2 changes: 0 additions & 2 deletions test/fixtures/client.js → fixtures/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const main = () => {
const thing = 'this is a test fixture';
return thing;
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions test/fixtures/folder/client.js → fixtures/folder/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const main = () => {
const thing = 'this is a test fixture';
return thing;
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 0 additions & 25 deletions lib/helpers/index.js

This file was deleted.

17 changes: 0 additions & 17 deletions lib/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions lib/schemas/index.js

This file was deleted.

14 changes: 0 additions & 14 deletions lib/stream.js

This file was deleted.

66 changes: 0 additions & 66 deletions lib/validators/index.js

This file was deleted.

67 changes: 6 additions & 61 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,9 @@
{
"name": "@eik/common",
"version": "4.0.0-next.5",
"description": "Common utilities for Eik modules",
"main": "lib/index.js",
"types": "types/index.d.ts",
"files": [
"CHANGELOG.md",
"package.json",
"lib",
"types",
"eikjson.d.ts"
],
"scripts": {
"test": "tap --no-check-coverage",
"lint:fix": "eslint --fix .",
"lint": "eslint .",
"schema:types": "json2ts lib/schemas/eikjson.schema.json > eikjson.d.ts",
"schema:outdated": "npm run schema:types && git diff --exit-code HEAD:eikjson.d.ts eikjson.d.ts",
"style:check": "prettier -c .",
"style:format": "prettier -w .",
"typecheck": "tsc",
"prepublish": "npm run typecheck"
},
"repository": {
"type": "git",
"url": "git+https://github.com/eik-lib/common.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/eik-lib/common/issues"
},
"homepage": "https://github.com/eik-lib/common#readme",
"dependencies": {
"ajv": "^8.6.2",
"ajv-formats": "^2.1.0",
"glob": "^8.0.0",
"is-glob": "^4.0.1",
"mime-types": "^2.1.29",
"node-fetch": "^2.6.1",
"semver": "^7.0.0",
"validate-npm-package-name": "^4.0.0"
},
"devDependencies": {
"@hapi/hapi": "20.2.2",
"@semantic-release/changelog": "6.0.1",
"@semantic-release/git": "10.0.1",
"eslint": "7.32.0",
"eslint-config-airbnb-base": "14.2.1",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-prettier": "4.2.1",
"express": "4.18.1",
"fastify": "3.29.0",
"json-schema-to-typescript": "10.1.5",
"prettier": "2.7.1",
"semantic-release": "18.0.1",
"stoppable": "1.1.0",
"tap": "15.2.3",
"typescript": "4.7.4"
}
"workspaces": [
"packages/config-loader",
"packages/utils",
"packages/schemas",
"packages/validators"
]
}
17 changes: 17 additions & 0 deletions packages/config-loader/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules/**/*
.nyc_output/**/*
package-lock.json
node_modules/**/*
.DS_Store
tmp/**/*
.idea
.idea/**/*
*.iml
*.log
coverage
.vscode
eikjson.d.ts
CHANGELOG.md
dist
types
renovate.json
13 changes: 13 additions & 0 deletions packages/config-loader/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const ReadFile = require('./src/classes/read-file.js');
const EikConfig = require('./src/eik-config.js');
const getDefaults = require('./src/get-defaults.js');
const configStore = require('./src/config-store.js');
const localAssets = require('./src/local-assets');

module.exports = {
ReadFile,
EikConfig,
getDefaults,
configStore,
localAssets,
};
Loading

0 comments on commit c6f9613

Please sign in to comment.