Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common package refactor #237

Merged
merged 30 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cbc56eb
wip refactor
benja Jul 14, 2022
19c86d2
wip
benja Jul 15, 2022
d8b9414
some more wip stuff
benja Jul 15, 2022
cc65c9f
wip
benja Jul 18, 2022
dcdfc59
refactor: add lint and fix most lint issues
benja Jul 18, 2022
69b006d
Fix tests
Jul 18, 2022
edc595f
fix: lint
benja Jul 19, 2022
cb104a3
refactor: add deps and scripts
benja Jul 19, 2022
3c62416
chore: run prettier
benja Jul 19, 2022
1ecb3d4
ci: run ci commands in each workspace
Jul 19, 2022
fc1924b
ci: test on node 16 and 18 only
Jul 19, 2022
b5a6710
ci: fix dependencies
Jul 19, 2022
f5dba21
ci: fix script commands
Jul 19, 2022
1c0bdd1
ci: check schema only in schema workspace
Jul 19, 2022
d1ff9f2
ci: workspace argument need reference to package
Jul 19, 2022
7d1e5cb
ci: add missing dependency
Jul 19, 2022
f82745b
ci: fix path to json file in command
Jul 19, 2022
e352827
ci: fix style checking
Jul 19, 2022
663c570
ci: remove redundant dependencies and script commands
Jul 19, 2022
a44c06e
docs: change package descriptions
benja Jul 20, 2022
cee6482
refactor: move private files from classes into internal
benja Jul 21, 2022
7c502a8
refactor: helpers to utils
benja Jul 25, 2022
c4a2013
refactor: can't forget to rename imports too
benja Jul 25, 2022
f92ac1c
refactor: move classes to config-loader
benja Jul 25, 2022
0147b36
docs: change pkg description
benja Jul 25, 2022
a40c491
tests: trying to fix tests
benja Jul 25, 2022
b2ce6ce
style: add missing types to schemas
benja Jul 25, 2022
9964520
test: add missing eikfile to git
benja Jul 25, 2022
b3e233f
refactor: move local-assets into root of config-loader and publicly e…
benja Jul 26, 2022
ea1f460
Merge branch 'next' into refactor
benja Jul 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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