Skip to content

Commit

Permalink
refactor: bump to Ember 4.12 (#1278)
Browse files Browse the repository at this point in the history
* refactor: bump to Ember 4.12

* ran yarn run lint:css:fix

* ignore css files we don't really control

* manually fix stylelint css

* refactor: use pnpm instead of yarn

* refactor: redo eslint config

* fix ember template lint

* prettier fix

* css lint fix

* last fixes

* update ci to use pnpm

* ci fixes

* moar ci fixes

* fix tests

* fix acceptance test action

* remove yarn cache

* fix pnpm override

* more ci fixes

* try no frozen

* change pnpm version

* fix table styling

* tweaks

* bump to node 20

* use latest checkout across the board

* ensure files are deduped

* fix tests

* ensure moving back from review and forward again all the files are found on submit
  • Loading branch information
jaredgalanis authored Jul 5, 2024
1 parent 63bc0ae commit e95566f
Show file tree
Hide file tree
Showing 83 changed files with 20,531 additions and 16,001 deletions.
1 change: 0 additions & 1 deletion .ember-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = () => {
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
liveReload: false,
yarn: true,
disableAnalytics: false,
/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
Expand Down
70 changes: 11 additions & 59 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,78 +1,35 @@
'use strict';

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }]],
},
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'plugin:prettier/recommended'],
env: {
browser: true,
},

rules: {
'import/extensions': 'off',
'import/no-unresolved': 'off',
'no-underscore-dangle': 'off',
'no-unused-vars': 'off',
'no-undef': 'off',
'func-names': 'off',
eqeqeq: 'off',
'one-var': 'off',
'prefer-rest-params': 'off',
// eventually re-enable these:
'max-len': 'off',
'prefer-destructuring': 'off',
'no-plusplus': 'off',
'no-useless-escape': 'off',
'no-prototype-builtins': 'off',
'no-restricted-properties': 'off',
'prefer-const': 'off',
'block-scoped-var': 'off',
'vars-on-top': 'off',
'no-console': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'no-var': 'off',
'no-redeclare': 'off',
'guard-for-in': 'off',
'no-restricted-syntax': 'off',
'no-param-reassign': 'off',
'import/first': 'off',
'no-mixed-operators': 'off',
'no-throw-literal': 'off',
'consistent-return': 'off',
'import/no-extraneous-dependencies': 'off',
'no-restricted-globals': 'off',
'comma-dangle': 'off',
'array-callback-return': 'off',
'no-lonely-if': 'off',
'no-useless-escape': 'off',
'class-methods-use-this': 'off',
'generator-star-spacing': 'off',
// we're not enabling this yet
// 'ember/no-jquery': 'error'
},
ignorePatterns: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js',
'dist/**/*',
],
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
Expand All @@ -88,17 +45,12 @@ module.exports = {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
// ember tests
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
rules: {
'prefer-arrow-callback': 'off',
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
},
},
],
};
15 changes: 10 additions & 5 deletions .github/actions/build-pass-ui/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,32 @@ inputs:
runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Grab pass-docker's .env file and export to environment
run: |
wget ${{ inputs.env-file }}
export $(grep -v '^[#|SIGNING|PASS_CORE_POLICY]' .env | xargs -d '\n')
shell: bash

- run: yarn install --frozen-lockfile
- run: pnpm install --frozen-lockfile
shell: bash

- name: Production build
run: yarn run build
run: pnpm run build
if: ${{ inputs.is-prod == 'true' }}
shell: bash

- name: Dev build
if: ${{ inputs.is-prod == 'false' }}
run: yarn run build:dev
run: pnpm run build:dev
shell: bash

- run: yarn run build:docker
- run: pnpm run build:docker
shell: bash

- run: yarn run build:latest
- run: pnpm run build:latest
shell: bash
41 changes: 21 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: yarn
node-version: 20.x
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install
- name: Lint
run: yarn lint
run: pnpm run lint

test:
name: "Test"
Expand All @@ -30,38 +33,36 @@ jobs:

strategy:
matrix:
node-version: [ 18 ]
node-version: [ 20 ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install
- name: Run Tests
run: yarn test
run: pnpm run test:no-serve

acceptance-test:
name: "Acceptance test"
runs-on: ubuntu-latest
timeout-minutes: 10

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

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
shell: bash
node-version: 20

- name: Build local image
uses: ./.github/actions/build-pass-ui
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,22 @@ jobs:
DOCKER_IMAGE_NAME: ghcr.io/eclipse-pass/pass-ui

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

- name: Config git user
run: |
git config user.name ${{ github.actor }}
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Setup Node & Yarn
uses: actions/setup-node@v3
- name: Setup Node & pnpm
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version: 20

- name: Update project version
run: |
yarn install --frozen-lockfile
yarn version --new-version ${{ inputs.releaseversion }}
pnpm install --frozen-lockfile
pnpm version --new-version ${{ inputs.releaseversion }}
- name: Tag release
run: git tag ${{ inputs.releaseversion }}
Expand All @@ -60,7 +59,7 @@ jobs:
docker push $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }}
- name: Update project version
run: yarn version --new-version ${{ inputs.nextversion }}
run: pnpm version --new-version ${{ inputs.nextversion }}

- name: Build next dev version
uses: ./.github/actions/build-pass-ui
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/update-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ jobs:
ENV_FILE: https://raw.githubusercontent.com/eclipse-pass/pass-docker/main/.env

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

- name: Use Node.js 18
uses: actions/setup-node@v2
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Get current project version
id: project-version
run: echo "VERSION=`npx -c 'echo $npm_package_version'`" >> $GITHUB_OUTPUT

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Build pass-ui
uses: ./.github/actions/build-pass-ui
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ module.exports = {
singleQuote: false,
},
},
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};
12 changes: 12 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/

# files which we didn't create/build
public/coreUI.css
app/styles/font-awesome-5-0-13.css
5 changes: 5 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};
4 changes: 4 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
module.exports = {
plugins: ['ember-template-lint-plugin-prettier'],
extends: ['recommended', 'ember-template-lint-plugin-prettier:recommended'],
rules: {
'no-at-ember-render-modifiers': 'off',
'no-builtin-form-components': 'off',
},
};
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 18.15.0
nodejs 21.7.3
2 changes: 1 addition & 1 deletion app/components/choice-repositories-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class ChoiceRepositoriesCard extends Component {
@action
toggleRepository(repository, selected) {
const checkboxes = Array.from(
document.querySelectorAll('.choice-repository-card-list > li > input[type="checkbox"]')
document.querySelectorAll('.choice-repository-card-list > li > input[type="checkbox"]'),
).filter((input) => input.checked);
if (!selected && checkboxes.length === 0) {
event.target.checked = true;
Expand Down
2 changes: 1 addition & 1 deletion app/components/submission-action-cell/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class SubmissionActionCell extends Component {
await this.submissionHandler.deleteSubmission(submission);
} catch (e) {
this.flashMessages.danger(
'We encountered an error deleting this draft submission. Please try again later or contact your administrator'
'We encountered an error deleting this draft submission. Please try again later or contact your administrator',
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions app/components/workflow-basics-user-search/index.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.close-button {
position: absolute;
right:15px;
top:15px;
border:none;
right: 15px;
top: 15px;
border: none;
}

.pagination {
justify-content: center;
}

.user-search-container {
min-height:300px;
min-height: 300px;
}
2 changes: 1 addition & 1 deletion app/components/workflow-basics-user-search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class WorkflowBasicsUserSearch extends Component {
userFilter(input) {
const match = `=ini="*${input}*"`;
return [`firstName${match}`, `middleName${match}`, `lastName${match}`, `email${match}`, `displayName${match}`].join(
','
',',
);
}

Expand Down
Loading

0 comments on commit e95566f

Please sign in to comment.