Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed Mar 15, 2023
2 parents 32f40e7 + 3b7329e commit 16597c1
Show file tree
Hide file tree
Showing 273 changed files with 847 additions and 1,590 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x

- run: yarn install --frozen-lockfile --non-interactive

- name: Test && Report to Code Climate
uses: paambaati/codeclimate-action@v3.0.0
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: yarn test:cover
coverageLocations: "coverage/lcov.info:lcov"

- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/docs/build/
/node_modules/
/tmp/
/.deps-tmp/
*.log
*.tgz
*.pem
Expand Down
2 changes: 1 addition & 1 deletion blueprints/addon/additional-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ember-try": "^2.0.0"
},
"peerDependencies": {
"ember-source": "^3.28.0 || ^4.0.0"
"ember-source": "^4.0.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down
3 changes: 1 addition & 2 deletions blueprints/addon/files/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ jobs:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.8
- ember-release
- ember-beta
- ember-canary
- ember-classic
- embroider-safe
- embroider-optimized

Expand Down
3 changes: 1 addition & 2 deletions blueprints/addon/files/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ jobs:

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- env: EMBER_TRY_SCENARIO=ember-lts-3.28
- env: EMBER_TRY_SCENARIO=ember-lts-4.4
- env: EMBER_TRY_SCENARIO=ember-lts-4.8
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-classic
- env: EMBER_TRY_SCENARIO=embroider-safe
- env: EMBER_TRY_SCENARIO=embroider-optimized
<% if (yarn) { %>
Expand Down
4 changes: 2 additions & 2 deletions blueprints/addon/files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

## Compatibility

* Ember.js v3.28 or above
* Ember CLI v3.28 or above
* Ember.js v4.4 or above
* Ember CLI v4.4 or above
* Node.js v14 or above


Expand Down
26 changes: 4 additions & 22 deletions blueprints/addon/files/addon-config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ module.exports = async function () {
<% if (yarn) { %>useYarn: true,
<% } %>scenarios: [
{
name: 'ember-lts-3.28',
name: 'ember-lts-4.4',
npm: {
devDependencies: {
'ember-source': '~3.28.0',
'ember-source': '~4.4.0',
},
},
},
{
name: 'ember-lts-4.4',
name: 'ember-lts-4.8',
npm: {
devDependencies: {
'ember-source': '~4.4.0',
'ember-source': '~4.8.0',
},
},
},
Expand Down Expand Up @@ -47,24 +47,6 @@ module.exports = async function () {
},
},
},
{
name: 'ember-classic',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'application-template-wrapper': true,
'default-async-observers': false,
'template-only-glimmer-components': false,
}),
},
npm: {
devDependencies: {
'ember-source': '~3.28.0',
},
ember: {
edition: 'classic',
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
Expand Down
2 changes: 2 additions & 0 deletions blueprints/addon/files/npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/.gitignore
/.prettierignore
/.prettierrc.js
/.stylelintignore
/.stylelintrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand Down
7 changes: 0 additions & 7 deletions blueprints/addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ module.exports = {
},

async afterInstall(options) {
let packagePath = path.join(this.path, 'files', 'package.json');
let bowerPath = path.join(this.path, 'files', 'bower.json');

[packagePath, bowerPath].forEach((filePath) => {
fs.removeSync(filePath);
});

if (options.typescript) {
await this.addAddonToProject({
name: 'ember-cli-typescript',
Expand Down
12 changes: 8 additions & 4 deletions blueprints/app/files/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: '<%= typescript ? '@typescript-eslint/parser' : 'babel-eslint' %>',
parser: '<%= typescript ? '@typescript-eslint/parser' : '@babel/eslint-parser' %>',
parserOptions: {
ecmaVersion: 2018,<% if (!typescript) { %>
ecmaVersion: 'latest',<% if (!typescript) { %>
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},<% } %>
},
plugins: ['ember'<% if (typescript) { %>, '@typescript-eslint'<% } %>],
Expand Down Expand Up @@ -35,6 +38,7 @@ module.exports = {
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',<% if (blueprint !== 'app') { %>
'./index.js',<% } %>
Expand Down
8 changes: 8 additions & 0 deletions blueprints/app/files/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
5 changes: 5 additions & 0 deletions blueprints/app/files/.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'],
};
1 change: 1 addition & 0 deletions blueprints/app/files/app/styles/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */
13 changes: 0 additions & 13 deletions blueprints/app/files/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@ module.exports = function (defaults) {
// Add options here
});

// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

<% if (embroider) { %>const { Webpack } = require('@embroider/webpack');
return require('@embroider/compat').compatBuild(app, Webpack, {
skipBabel: [
Expand Down
25 changes: 16 additions & 9 deletions blueprints/app/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"scripts": {
"build": "ember build --environment=production",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:css": "stylelint \"**/*.css\"",
"lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
Expand All @@ -24,17 +26,18 @@
"test:ember": "ember test"
},
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"<% if (!typescript) { %>@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-decorators": "^7.21.0",
"<% } %>@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@ember/test-helpers": "^2.9.3<% if (embroider) { %>",
"@embroider/compat": "^2.1.1",
"@embroider/core": "^2.1.1",
"@embroider/webpack": "^2.1.1<% } %>",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2<% if (typescript) { %>",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0<% } else { %>",
"babel-eslint": "^10.1.0<% } %>",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1<% } %>",
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^7.6.0",
"ember-auto-import": "^2.6.1",
Expand All @@ -43,21 +46,21 @@
"ember-cli-babel": "^7.26.11",
"ember-cli-dependency-checker": "^3.3.1",
"ember-cli-htmlbars": "^6.2.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-inject-live-reload": "^2.1.0<% if (!embroider) { %>",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-cli-terser": "^4.0.2<% } %>",
"ember-data": "~4.11.3",
"ember-fetch": "^8.1.2",
"ember-load-initializers": "^2.1.2",
"ember-modifier": "^4.1.0",
"ember-page-title": "^7.0.0",
"ember-qunit": "^6.2.0",
"ember-resolver": "^10.0.0",
"ember-source": "~4.11.0",
"ember-source": "~4.12.0-beta.2",
"ember-template-lint": "^5.6.0<% if (welcome) { %>",
"ember-welcome-page": "^7.0.1<% } %>",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-ember": "^11.4.7",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-prettier": "^4.2.1",
Expand All @@ -66,6 +69,10 @@
"prettier": "^2.8.4",
"qunit": "^2.19.4",
"qunit-dom": "^2.0.0",
"stylelint": "^15.2.0",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard": "^30.0.1",
"stylelint-prettier": "^3.0.0",
"tracked-built-ins": "^3.1.1",
"webpack": "^5.75.0"
},
Expand Down
20 changes: 16 additions & 4 deletions dev/update-blueprint-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ async function latestVersion(packageName) {
}

async function updateDependencies(dependencies) {
for (let dependency in dependencies) {
if (!shouldCheckDependency(dependency)) {
for (let dependencyKey in dependencies) {
let dependencyName = removeTemplateExpression(dependencyKey);

if (!shouldCheckDependency(dependencyName)) {
continue;
}

let previousValue = dependencies[dependency];
let previousValue = dependencies[dependencyKey];

// grab the first char (~ or ^)
let prefix = previousValue[0];
Expand All @@ -122,11 +124,19 @@ async function updateDependencies(dependencies) {
let hasVersion = previousValue[1] !== '<';

if (hasVersion && isValidPrefix) {
dependencies[dependency] = `${prefix}${await latestVersion(dependency)}${templateSuffix}`;
dependencies[dependencyKey] = `${prefix}${await latestVersion(dependencyName)}${templateSuffix}`;
}
}
}

function removeTemplateExpression(dependency) {
if (dependency.includes('<') === false) {
return dependency;
}

return dependency.replace(dependency.substring(dependency.indexOf('<'), dependency.indexOf('>') + 1), '');
}

async function main() {
for (let packageFile of PACKAGE_FILES) {
let filePath = path.join(__dirname, packageFile);
Expand Down Expand Up @@ -162,3 +172,5 @@ if (module === require.main) {
return;
}
}

module.exports = { updateDependencies };

0 comments on commit 16597c1

Please sign in to comment.