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

Upgrade to Ember 4.8 #299

Merged
merged 3 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
8 changes: 7 additions & 1 deletion .ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
25 changes: 25 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
58 changes: 52 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,59 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
extends: 'eslint:recommended',
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
env: {
browser: true
browser: true,
},
rules: {
}
rules: {},
overrides: [
// 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',
'./node-tests/**/*.js',
'./broccoli-clean-css.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['n'],
extends: ['plugin:n/recommended'],
},
{
// node test files
files: ['node-tests/**/*-test.js'],
plugins: ['mocha'],
extends: ['plugin:mocha/recommended'],
rules: {
'n/no-unpublished-require': 'off',
},
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Lint
run: yarn lint
- name: Run Tests
run: yarn test
run: yarn test:node

floating:
name: "Floating Dependencies"
Expand All @@ -45,4 +45,4 @@ jobs:
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Run Tests
run: yarn test
run: yarn test:node
29 changes: 22 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.log*
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
54 changes: 39 additions & 15 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
/bower_components
# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.github/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
25 changes: 25 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache
.lint-todo/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
};
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended',
};
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How To Contribute

## Installation

* `git clone <repository-url>`
* `cd ember-cli-clean-css`
* `yarn install`

## Linting

* `yarn lint`
* `yarn lint:fix`

## Running tests

* `yarn test` – Runs the test suite on the current Ember version

## Running the dummy application

* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
25 changes: 7 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,17 @@

[![Greenkeeper badge](https://badges.greenkeeper.io/ember-cli/ember-cli-clean-css.svg)](https://greenkeeper.io/)

This README outlines the details of collaborating on this Ember addon.

## Installation

* `git clone <repository-url>` this repository
* `cd ember-cli-clean-css`
* `npm install`
* `bower install`

## Running

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
```
ember install ember-cli-clean-css
```

## Running Tests
## Contributing

* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
See the [Contributing](CONTRIBUTING.md) guide for details.

## Building

* `ember build`
## License

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
This project is licensed under the [MIT License](LICENSE.md).
4 changes: 2 additions & 2 deletions addon-config/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = {
'ie 9',
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]
'last 1 Safari versions',
],
};
21 changes: 15 additions & 6 deletions broccoli-clean-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ class CleanCSSFilter extends BroccoliPersistentFilter {
cacheKeyProcessString(string, relativePath) {
this.optionsHash = this.optionsHash || jsonStableStringify(this.options);

return `${this.optionsHash}${super.cacheKeyProcessString(string, relativePath)}`;
return `${this.optionsHash}${super.cacheKeyProcessString(
string,
relativePath
)}`;
}

setupCleanCSS() {
let inputPath = this.inputPaths[0];
let cleanCSSOptions = Object.assign({}, this.options.cleanCSS, { returnPromise: true });
let cleanCSSOptions = Object.assign({}, this.options.cleanCSS, {
returnPromise: true,
});

if (cleanCSSOptions.rebaseTo) {
cleanCSSOptions.rebaseTo = path.join(inputPath, cleanCSSOptions.rebaseTo);
Expand All @@ -35,17 +40,21 @@ class CleanCSSFilter extends BroccoliPersistentFilter {
}

build() {
if (!this.cleanCSS) { this.setupCleanCSS(); }
if (!this.cleanCSS) {
this.setupCleanCSS();
}

return super.build();
}

processString(contents, relativePath) {
let fullPath = path.resolve(this.inputPaths[0], relativePath);

return this.cleanCSS.minify({
[fullPath]: { styles: contents }
}).then(result => result.styles);
return this.cleanCSS
.minify({
[fullPath]: { styles: contents },
})
.then((result) => result.styles);
}
}

Expand Down
Empty file added config/ember-try.js
Empty file.
4 changes: 2 additions & 2 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env node */
'use strict';

module.exports = function(/* environment, appConfig */) {
return { };
module.exports = function (/* environment, appConfig */) {
return {};
};
Loading