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

Improvements to the Module System #148

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4c2c8ca
Moved to using gulp for task automation
leeyi45 Aug 5, 2022
a264f81
Updated error messages
leeyi45 Aug 6, 2022
eb9a817
Removed unnecessary packages
leeyi45 Aug 6, 2022
3dd6b1b
Added documentations
leeyi45 Aug 6, 2022
25768e0
Update .gitignore
leeyi45 Aug 6, 2022
887aba9
Delete database.json
leeyi45 Aug 6, 2022
7699474
Update package.json
leeyi45 Aug 6, 2022
0ffce26
Update index.js
leeyi45 Aug 6, 2022
83d5e6d
Build scripts run if build folders are empty or missing
leeyi45 Aug 6, 2022
b8fe8b9
Combined eslintrcs
leeyi45 Aug 9, 2022
9f7fe02
Adding tests to the build scripts
leeyi45 Aug 9, 2022
df8daf5
Adding eslint jest plugin
leeyi45 Aug 9, 2022
148b15e
Updated babel and jest to work with js files
leeyi45 Aug 9, 2022
5ebcbd0
Updated tests
leeyi45 Aug 10, 2022
2b47b1e
Changed to using the fsPromises lib
leeyi45 Aug 10, 2022
53cb26d
Readded templates
leeyi45 Aug 10, 2022
a5bc843
Update .eslintrc.js
leeyi45 Aug 10, 2022
35b03cf
Fixed some template scripts
leeyi45 Aug 11, 2022
cfb9203
Separate docs and jsons in the database
leeyi45 Aug 11, 2022
d819665
eslint config that actually works
leeyi45 Aug 12, 2022
bc72202
Bumped scripts to typescript
leeyi45 Aug 12, 2022
d986879
Bumped lowdb version
leeyi45 Aug 12, 2022
78bf13a
Made build scripts more efficient
leeyi45 Aug 12, 2022
77704ab
Added result.close calls
leeyi45 Aug 13, 2022
743c79f
Readded constants
leeyi45 Aug 14, 2022
aa9cd5f
Trying to fix eslint
leeyi45 Aug 14, 2022
cb4b9fc
Updated templates to use constants
leeyi45 Aug 14, 2022
ca79cb5
Continued to move toward constants
leeyi45 Aug 15, 2022
0119604
Update tabs.ts
leeyi45 Aug 15, 2022
5696de8
Updated scripts code
leeyi45 Aug 15, 2022
ccf1009
Moved jest config out of package.json
leeyi45 Aug 15, 2022
31fc311
Removed build:tabs command
leeyi45 Aug 16, 2022
3fea1bf
Use commander to parse CLI arguments
leeyi45 Aug 16, 2022
2350229
Update index.ts
leeyi45 Aug 17, 2022
4d04c23
Added verbose option
leeyi45 Aug 17, 2022
fbc6b67
Updated linting
leeyi45 Aug 17, 2022
eaaa0a0
Merge branch 'master' into editor_documentation
leeyi45 Aug 17, 2022
76c7c93
Moved typedoc theme to scripts folder
leeyi45 Aug 17, 2022
8a62681
Bumped typedoc version
leeyi45 Aug 17, 2022
255c5e1
Finishing merge from master
leeyi45 Aug 17, 2022
b4c0e8e
Revert "Moved typedoc theme to scripts folder"
leeyi45 Aug 17, 2022
ca721ca
Updated rollup to work with Csg tab
leeyi45 Aug 17, 2022
4027e0f
Finally made eslint work
leeyi45 Aug 22, 2022
bdb4f62
Updated code to work with new version of typedoc
leeyi45 Aug 22, 2022
dcf0271
Fixed inconsistent tab transpilation
leeyi45 Aug 22, 2022
69a9c05
Updated .eslintignore
leeyi45 Aug 22, 2022
43de551
Bumping blueprintjs versions
leeyi45 Aug 23, 2022
c5bb531
Update package.json
leeyi45 Aug 23, 2022
53277bc
Fixed wrong warning messages
leeyi45 Aug 23, 2022
cf0ee34
Update index.ts
leeyi45 Aug 25, 2022
f1bde9d
Update index.ts
leeyi45 Aug 27, 2022
1580597
Update index.ts
leeyi45 Aug 27, 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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.github/
.husky/
build/

**/.eslintrc*.js
scripts/templates/templates
3 changes: 1 addition & 2 deletions .eslintrc.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ module.exports = {
'no-lonely-if': 1,
'no-loop-func': 1,
// "no-magic-numbers": 0,
'no-mixed-operators': 1,
'no-mixed-operators': 0,
'no-multi-assign': 1,
'no-multi-str': 1,
// "no-negated-condition": 0,
Expand Down Expand Up @@ -318,7 +318,6 @@ module.exports = {
'require-await': 1,
'require-unicode-regexp': 1,
'require-yield': 1, // Was 2
// 'sort-imports': 0,
// "sort-keys": 0,
// "sort-vars": 0,
'spaced-comment': [
Expand Down
145 changes: 0 additions & 145 deletions .eslintrc.js

This file was deleted.

4 changes: 4 additions & 0 deletions .eslintrc.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["plugin:jest/recommended"],
"plugins": ["jest"]
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build/*
/package-lock.json
coverage/

scripts/rollup/database.json
scripts/build/database.json

# Compiled source #
###################
Expand Down
7 changes: 0 additions & 7 deletions .prettierrc.json

This file was deleted.

9 changes: 8 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
const defaultConfig = {
/**
* - **script** - Parse the file using the ECMAScript Script grammar. No import/export statements allowed, and files are not in strict mode.
* - **module** - Parse the file using the ECMAScript Module grammar. Files are automatically strict, and import/export statements are allowed.
Expand Down Expand Up @@ -89,3 +89,10 @@ module.exports = {
],
],
};

module.exports = api => api.env('test') ? {
...defaultConfig,
plugins: [
["babel-plugin-transform-import-meta", { module: "ES6" }]
],
} : defaultConfig;
19 changes: 19 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default {
roots: [
"<rootDir>/src/bundles",
"<rootDir>/src/tabs",
"<rootDir>/scripts"
],
modulePaths:[
'<rootDir>',
],
// Module Name settings required to make chalk work with jest
moduleNameMapper: {
"#(.*)": "<rootDir>/node_modules/$1",
"lowdb": "<rootDir>/node_modules/lowdb/lib",
"steno": "<rootDir>/node_modules/steno/lib",
},
transformIgnorePatterns: [
'node_modules/(?!=chalk)/'
],
}
55 changes: 26 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
"license": "Apache-2.0",
"scripts-info": {
"//NOTE": "Run `npm i npm-scripts-info -g` to install once globally, then run `npm-scripts-info` as needed to list these descriptions",
"module": "Interactively initialise a new bundle or tab from their templates",
"create": "Interactively initialise a new bundle or tab from their templates",
"lint": "Check code for eslint warnings and errors",
"lint:fix": "Lint code and fix automatically fixable problems",
"lint:src": "Lint bundle and tab code",
"lint:scripts": "Lint build script code",
"build": "Lint code, then build modules and documentation",
"build:rollup": "Transpile modules into the `build/` folder and copy over `modules.json`",
"build:docs": "Generate TypeDocs in the `build/documentation/` folder",
"rebuild": "Build only modules whose files have been modified since the last build/rebuild",
"serve": "Start the HTTP server to serve all files in `build/`, with the same directory structure",
"scripts": "Run a script within the scripts directory using ts-node",
"dev": "Rebuild modules, then serve",
"prepare": "Enable git hooks",
"test": "Run unit tests",
"test:watch": "Watch files for changes and rerun tests related to changed files"
},
"scripts": {
"module": "node ./scripts/templates/app.js",
"lint": "./node_modules/.bin/eslint --ext \".ts, .tsx\" src/",
"lint:fix": "./node_modules/.bin/eslint --ext \".ts, .tsx\" src/ --fix",
"build": "yarn lint && yarn build:rollup && yarn build:docs",
"build:rollup": "./node_modules/.bin/tsc && rollup -c scripts/rollup/rollup.config.js",
"build:docs": "node ./scripts/docs/index.js",
"rebuild": "./node_modules/.bin/tsc && rollup -c scripts/rollup/rollup.config.js --quick",
"create": "yarn scripts create",
"lint": " yarn lint:src && yarn lint:scripts",
"lint:src": "./node_modules/.bin/eslint -c src/.eslintrc.js --ext \".ts, .tsx\" src/",
"lint:scripts": "./node_modules/.bin/eslint -c scripts/.eslintrc.js --ext \".ts, .tsx\" scripts/",
"build": "yarn lint && yarn scripts build",
"build:docs": "yarn scripts build docs",
"serve": "http-server --cors=* -c-1 -p 8022 ./build",
"dev": "yarn rebuild && yarn serve",
"dev": "yarn build && yarn serve",
"scripts": "cross-env TS_NODE_PROJECT=scripts/tsconfig.json ts-node scripts/index.ts",
"prepare": "husky install",
"test": "jest --verbose",
"test:watch": "jest --watch"
Expand All @@ -44,42 +44,46 @@
"@rollup/plugin-typescript": "^8.2.0",
"@types/dom-mediacapture-record": "^1.0.11",
"@types/jest": "^27.4.1",
"@types/lowdb": "^1.0.11",
"@types/node": "^17.0.23",
"@types/react": "^17.0.43",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"babel-jest": "^26.6.3",
"chalk": "^4.1.2",
"eslint": "^8.12.0",
"babel-plugin-transform-import-meta": "^2.2.0",
"chalk": "^5.0.1",
"commander": "^9.4.0",
"cross-env": "^7.0.3",
"eslint": "^8.21.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.8.1",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"generate-template-files": "^3.0.0",
"http-server": "^0.12.3",
"husky": "5",
"jest": "^26.6.3",
"lowdb": "1.0.0",
"prettier": "^2.2.1",
"lowdb": "^3.0.0",
"rollup": "^2.41.2",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-filesize": "^9.1.1",
"rollup-plugin-inject-process-env": "^1.3.1",
"ts-jest": "^26.5.4",
"typedoc": "^0.20.33",
"ts-node": "^10.9.1",
"typedoc": "^0.23.10",
"typescript": "^4.2.3",
"yarnhook": "^0.5.1"
},
"dependencies": {
"@blueprintjs/core": "^3.54.0",
"@blueprintjs/icons": "^3.33.0",
"@blueprintjs/popover2": "^0.14.0",
"@blueprintjs/core": "^4.6.1",
"@blueprintjs/icons": "^4.4.0",
"@blueprintjs/popover2": "^1.4.3",
"@jscad/modeling": "^2.9.5",
"@jscad/regl-renderer": "^2.6.1",
"classnames": "^2.3.1",
Expand All @@ -93,12 +97,5 @@
"regl": "^2.1.0",
"tslib": "^2.3.1",
"typedoc-default-themes": "^0.12.10"
},
"jest": {
"roots": [
"<rootDir>/src/bundles",
"<rootDir>/src/tabs",
"<rootDir>/scripts"
]
}
}
2 changes: 2 additions & 0 deletions scripts/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.eslintrc.js
templates/templates
27 changes: 27 additions & 0 deletions scripts/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Leaving everything double quoted so it's easier to switch between JS and JSON
// Since JSON has automatic schema validation

module.exports = {
// Need react here because otherwise we get undefined rule errors
"plugins": ["import", "react", "@typescript-eslint"],
"extends": ["../.eslintrc.base.js", "airbnb-typescript"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"project": "./tsconfig.json",
"tsconfigRootDir": __dirname,
},
"rules": {
"func-style": 0,
"import/no-extraneous-dependencies": 0,
"no-console": 0,
"no-continue": 0,
"no-param-reassign": 0,
"no-restricted-syntax": 0,
"prefer-const": 0
},
"overrides": [{
"extends": "../.eslintrc.test.json",
"files": ["./**/__tests__/**.test.ts"],
}]
}
Loading