Skip to content

Commit

Permalink
Merge pull request #1 from Gaurav0/fix_ci
Browse files Browse the repository at this point in the history
Fix ci and make compatible with Ember 5
  • Loading branch information
Gaurav0 committed May 21, 2023
2 parents 14238e0 + 80c4115 commit dd9d235
Show file tree
Hide file tree
Showing 53 changed files with 5,075 additions and 8,175 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ jobs:
test-all-packages:
name: Ember Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
node-version: [16.x, 14.x]
os: [ubuntu-latest, windows-latest]
Expand Down Expand Up @@ -51,8 +53,10 @@ jobs:
integration-tests:
name: Integration Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
node-version: [16.x, 14.x]
os: [ubuntu-latest, windows-latest]
Expand All @@ -73,8 +77,10 @@ jobs:
test-packages:
name: Test Packages
runs-on: ${{ matrix.os }}
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
node-version: [16.x, 14.x]
os: [ubuntu-latest, windows-latest]
Expand All @@ -99,6 +105,7 @@ jobs:
test-legacy-mocha:
name: Legacy Mocha Tests - ${{ matrix.node-version }}
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
Expand All @@ -109,20 +116,23 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: volta-cli/action@v1
uses: volta-cli/action@v4
with:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: |
yarn install --ignore-engines --frozen-lockfile
- name: Precook node_modules
run: |
yarn workspace ember-cli-fastboot pretest:precook
- name: Run Mocha Tests
run: |
yarn workspace ember-cli-fastboot test:mocha
try-scenarios:
name: "ember-try for ember-cli-fastboot: ${{ matrix.ember-try-scenario }}"
name: "${{ matrix.ember-try-scenario }} Scenario for ember-cli-fastboot"
runs-on: ubuntu-latest
timeout-minutes: 7
timeout-minutes: 30

strategy:
fail-fast: false
Expand All @@ -133,6 +143,8 @@ jobs:
- ember-lts-3.24
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.8
- ember-lts-4.12
- ember-release
- ember-beta
- ember-canary
Expand Down
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
"type": "git",
"url": "git@github.com:ember-fastboot/ember-cli-fastboot.git"
},
"workspaces": [
"packages/*",
"test-packages/*"
],
"workspaces": {
"packages": [
"packages/*",
"test-packages/*"
],
"nohoist": [
"**/ember-cli-addon-tests"
]
},
"scripts": {
"test": "npm-run-all test:*",
"test:ember-cli-fastboot": "yarn workspace ember-cli-fastboot test:ember",
Expand All @@ -24,6 +29,9 @@
"release-it-lerna-changelog": "^3.1.0",
"release-it-yarn-workspaces": "^2.0.0"
},
"resolutions": {
"fastboot": "4.1.1"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
Expand Down
1 change: 1 addition & 0 deletions packages/ember-cli-fastboot/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
Expand Down
31 changes: 14 additions & 17 deletions packages/ember-cli-fastboot/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,15 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js',
'lib/**/*.js'
],
excludedFiles: [
'app/**',
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**',
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script',
Expand All @@ -56,5 +48,10 @@ module.exports = {
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
1 change: 1 addition & 0 deletions packages/ember-cli-fastboot/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/testem.js
/test/
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

Expand Down
2 changes: 1 addition & 1 deletion packages/ember-cli-fastboot/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'octane',
extends: 'recommended',
};
25 changes: 25 additions & 0 deletions packages/ember-cli-fastboot/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ module.exports = async function () {
},
},
},
{
name: 'ember-lts-4.8',
npm: {
devDependencies: {
'ember-source': '~4.8.0',
},
},
},
{
name: 'ember-lts-4.12',
npm: {
devDependencies: {
'ember-source': '~4.12.0',
},
},
},
{
name: 'ember-release',
npm: {
Expand Down Expand Up @@ -116,6 +132,15 @@ module.exports = async function () {
},
},
},
{
name: 'ember-4.12-no-deprecations',
npm: {
devDependencies: {
'ember-source': '~4.12.0',
'ember-deprecation-error': '*',
},
},
},
{
name: 'ember-release-no-deprecations',
npm: {
Expand Down
8 changes: 7 additions & 1 deletion packages/ember-cli-fastboot/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ module.exports = function (defaults) {
*/

const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
return maybeEmbroider(app, {
skipBabel: [
{
package: 'qunit',
},
],
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function initialize(instance) {
let { request } = instance.lookup('service:fastboot');
if (fetch) {
fetch.__fastbootRequest = request;
}
}

export default {
initialize,
};
10 changes: 10 additions & 0 deletions packages/ember-cli-fastboot/fix-node-modules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));

const packagesDir = path.resolve(__dirname, '../../packages');
const nodeModulesDir = path.resolve(__dirname, 'node_modules');
const precookedDir = path.resolve(__dirname, 'tmp', 'precooked_node_modules');

// eslint-disable-next-line no-undef
const shouldRestore = process.argv[2];
Expand All @@ -29,18 +30,27 @@ Options:
function run(shouldRestore) {
['fastboot', 'fastboot-express-middleware'].forEach((packageName) => {
const nodeModulesPackageDir = path.join(nodeModulesDir, packageName);
const precookedPackageDir = path.join(precookedDir, packageName);
const workspacesPackageDir = path.resolve(packagesDir, packageName);
if (fs.existsSync(nodeModulesPackageDir)) {
console.log(chalk.blue(`remove ${nodeModulesPackageDir}`));
fs.removeSync(nodeModulesPackageDir);
}
if (fs.existsSync(precookedPackageDir)) {
console.log(chalk.blue(`remove ${precookedPackageDir}`));
fs.removeSync(precookedPackageDir);
}
if (!shouldRestore) {
console.log(
chalk.green(
`symlink ${nodeModulesPackageDir} -> ${workspacesPackageDir}`
)
);
fs.symlinkSync(workspacesPackageDir, nodeModulesPackageDir, 'dir');
console.log(
chalk.green(`symlink ${precookedPackageDir} -> ${workspacesPackageDir}`)
);
fs.symlinkSync(workspacesPackageDir, precookedPackageDir, 'dir');
}
});
}
51 changes: 28 additions & 23 deletions packages/ember-cli-fastboot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"release": "release-it",
"lint:js:fix": "eslint . --fix",
"start": "ember serve",
"test": "npm-run-all lint test:*",
"test:mocha": "node fix-node-modules.mjs && mocha && node fix-node-modules.mjs -r",
"pretest:precook": "node node_modules/ember-cli-addon-tests/scripts/precook-node-modules.js",
"test": "npm-run-all -s lint pretest:* test:*",
"test:mocha": "node fix-node-modules.mjs && mocha",
"test:ember": "ember test",
"test:precook": "node node_modules/ember-cli-addon-tests/scripts/precook-node-modules.js",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
Expand All @@ -35,7 +35,7 @@
"broccoli-merge-trees": "^4.2.0",
"broccoli-plugin": "^4.0.7",
"chalk": "^4.1.2",
"ember-cli-babel": "^7.26.6",
"ember-cli-babel": "^7.26.10",
"ember-cli-lodash-subset": "^2.0.1",
"ember-cli-preprocess-registry": "^3.3.0",
"ember-cli-version-checker": "^5.1.2",
Expand All @@ -45,54 +45,59 @@
"fs-extra": "^10.0.0",
"json-stable-stringify": "^1.0.1",
"md5-hex": "^3.0.1",
"node-fetch": "^2.6.7",
"recast": "^0.19.1",
"silent-error": "^1.1.1"
},
"fastbootDependencies": [
"node-fetch"
],
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.0",
"@ember/test-helpers": "^2.6.0",
"@embroider/test-setup": "^0.37.0",
"@glimmer/component": "^1.0.4",
"@embroider/test-setup": "^0.48.1",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.0.4",
"babel-eslint": "^10.1.0",
"body-parser": "^1.18.3",
"broccoli-asset-rev": "^3.0.0",
"broccoli-test-helper": "^1.5.0",
"co": "4.6.0",
"chai": "^4.3.4",
"chai-fs": "^2.0.0",
"chai-string": "^1.4.0",
"co": "4.6.0",
"ember-auto-import": "^2.2.1",
"ember-cli": "~4.1.0",
"ember-cli-addon-tests": "^0.11.1",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-htmlbars": "^5.7.1",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-htmlbars": "^5.7.2",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.1",
"ember-cli-terser": "^4.0.2",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator-for-testing": "^1.0.0",
"ember-maybe-import-regenerator": "^1.0.0",
"ember-page-title": "^7.0.0",
"ember-qunit": "^5.1.5",
"ember-resolver": "^8.0.2",
"ember-sinon": "^2.2.0",
"ember-source": "~3.26.1",
"ember-resolver": "^10.0.0",
"ember-sinon": "^5.0.0",
"ember-source": "~3.28.11",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^3.2.0",
"ember-template-lint": "^3.15.0",
"ember-try": "^1.4.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-ember": "^10.3.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.8",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-qunit": "^6.2.0",
"glob": "^7.1.3",
"loader.js": "^4.7.0",
"mocha": "^9.1.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"qunit": "^2.14.1",
"prettier": "^2.5.1",
"qunit": "^2.17.2",
"qunit-dom": "^1.6.0",
"release-it": "^14.2.2",
"release-it-lerna-changelog": "^3.1.0",
Expand Down
Loading

0 comments on commit dd9d235

Please sign in to comment.