-
Notifications
You must be signed in to change notification settings - Fork 1
BI-9132: set engine and npm restrictions; update packages; fix versio… #98
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
base: master
Are you sure you want to change the base?
Conversation
SteveHicksCH
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments which are probably more for my education than anything else
88e8a8a to
c4b2aec
Compare
c4b2aec to
f00cdff
Compare
mouhajer-ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please make sure that the description and Jira link are set correctly.
.eslintrc
Outdated
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "standard" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has to be agreed across other services. I use these recommended
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
and please we do not need trailing commas (RIP IE8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ], | ||
| "object-curly-newline": [ | ||
| "error" | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Played a bit with it. This is one possible config
{
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {}
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"chai-friendly"
],
"overrides": [
{
"files": ["config.ts"],
"rules": {
"no-process-env": "off"
}
}, {
"files": ["*.test.ts", "*.spec.ts"],
"rules": {
"no-process-env": "off",
"no-unused-expressions": "off",
"chai-friendly/no-unused-expressions": 2,
"no-magic-numbers": "off"
}
}
],
"rules": {
"no-console": "warn",
"no-eval": "error",
"eol-last": ["error", "always"],
"object-curly-spacing": [
"error",
"always"
],
"indent": ["error", 4],
"padded-blocks": "off",
"quotes": ["error", "double"],
"semi": ["error", "always"],
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never"
}
],
"operator-linebreak": ["error", "after"],
"no-undef": "off",
"no-extra-semi": 2,
"no-process-env": 2,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-magic-numbers": "off"
},
"env": {
"node": true,
"commonjs": true,
"mocha": true,
"es6": true
}
}
| @@ -1,10 +1,11 @@ | |||
| FROM 169942020521.dkr.ecr.eu-west-1.amazonaws.com/base/node:14-alpine-builder | |||
| FROM 169942020521.dkr.ecr.eu-west-1.amazonaws.com/base/node:14-alpine-runtime | |||
| FROM 169942020521.dkr.ecr.eu-west-1.amazonaws.com/base/node:16-alpine-builder | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, finally we can move to the 16
| @@ -1,3 +1,3 @@ | |||
| $govuk-assets-path: "/restricted-word/public/"; | |||
| $govuk-assets-path: "/admin/restricted-word/public/"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove sass files from the service. Compile it once and add it on our CDN. I have done it in other service, will improve maintainability, performance and reduces dependencies issue (gulp, gulp-sass, node-sass ...). Check here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sass files compiled to css
this change required because by this path browser is looking font files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gulp can be completele removed from project.
all what doing gulp can be done in npm commends
"build:sass": "node-sass --importer node_modules/node-sass-package-importer/dist/cli.js -o dist/stylesheets ./scss/application.scss",
"build:views": "cp -r views dist/",
"build:govuk": "cp -v -r node_modules/govuk-frontend/govuk/assets/**/* ./dist",
"build": "npm run tsc && npm run build:views && npm run build:sass && npm run build:govuk",
"build:prod": "npm run build && webpack --mode production",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^^ Good points, but separate PR? Could we debate this outside of this PR, agree, and raise a ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change required to give ability to browser find font and images
gulp changes should be in other story
src/app.ts
Outdated
| app.use(sessionMiddleware); | ||
| app.use(helmet()); | ||
| app.use(helmet({ | ||
| contentSecurityPolicy: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
tsconfig.json
Outdated
| "experimentalDecorators": true, | ||
| "strictNullChecks": true, | ||
| "sourceMap": true, | ||
| "noImplicitAny": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one, "noImplicitAny": false should be set in all other project.
Could you please make sure lint is called by our sonar, it does not seem called, don't you think? we have got many config example in other repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will add Sonar in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't noImplicitAny be true instead? Setting it to false turns off the feature and might mask errors in type declarations
webpack.config.js
Outdated
| const path = require("path"); | ||
|
|
||
| module.exports = { | ||
| mode: "development", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand what client/fancyFramework.js is used for. Is it for production? can be moved to our CDN and reduce our dependency on web pack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand also
|
Sonar does not seem correctly configured in this service, we need to check the quality of our PRs including this one. |
|
done changes please review |
SteveHicksCH
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine by me
We will add Sonar in a separate PR |
This is needed to specify the version of Node used when run.
npm version 8 is not yet supported in the build system.
JIRA link
https://companieshouse.atlassian.net/browse/BI-9132
Change description