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

WIP - Modernized but working externally in 3.24 #366

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
57 changes: 26 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,47 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
},
rules: {
'ember/no-jquery': 'error'
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'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'
sourceType: 'script',
},
env: {
browser: false,
node: true
node: true,
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
}
]
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand All @@ -23,6 +26,7 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

Expand Down
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
/package.json.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: false,
};
3 changes: 1 addition & 2 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";

module.exports = {
// extends: 'octane'
extends: "recommended"
extends: 'recommended',
};
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 16.13.1
21 changes: 13 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "10"
- "12"

dist: trusty
dist: xenial

addons:
chrome: stable
Expand Down Expand Up @@ -35,26 +35,31 @@ jobs:
- stage: "Tests"
name: "Tests"
script:
- npm run lint:hbs
- npm run lint:js
- npm test
- yarn lint
- yarn test:ember

- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- npm install --no-package-lock
script:
- npm test
- yarn test:ember

# 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.12
- env: EMBER_TRY_SCENARIO=ember-lts-3.16
- env: EMBER_TRY_SCENARIO=ember-lts-3.24
- env: EMBER_TRY_SCENARIO=ember-lts-3.28
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
- env: EMBER_TRY_SCENARIO=ember-classic
- env: EMBER_TRY_SCENARIO=embroider-safe
- env: EMBER_TRY_SCENARIO=embroider-optimized

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`
* `yarn lint`
* `yarn lint:fix`

## Running tests

Expand Down
14 changes: 14 additions & 0 deletions MODULE_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Module Report
### Unknown Global

**Global**: `Ember.testing`

**Location**: `addon/components/printable-pages.js` at line 117

```js

reportStartTask: task(function*(currentPage) {
if (Ember.testing && !this._isRendering) {
this._isRendering = true;
registerWaiter(() => !this._isRendering);
```
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ from your existing components. This makes the documents easy to build, test, cus
Compatibility
------------------------------------------------------------------------------

* Ember.js v3.8 or above (excluding Ember 3.13, 3.14, 3.15)
* Ember CLI v2.13 or above
* Node.js v10 or above
* Ember.js v3.24 or above
* Ember CLI v3.24 or above
* Node.js v12 or above


Installation
Expand Down
49 changes: 49 additions & 0 deletions addon/components/printable-pages.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<div
{{!-- {{did-insert this.onInsert this}} --}}
{{did-update
this.onUpdate
@margins
@dimensions
@orientation
@units
@pageLayout
}}
class="PrintablePages"
id={{this.elementId}}
...attributes
>
{{#unless this.rerendering}}
{{yield
(hash
title-page=(component
"printable-pages/title-page"
pageLayout=this.pageLayout
pageCount=this.reportObject.lastPage
)
chapter=(component
"printable-pages/chapter"
chapters=this.chapters
lastReportPage=this.reportObject.lastPage
pageLayout=this.pageLayout
register=this.registerChapter
registerChapter=this.registerChapter
registerSection=(fn this.registerSection this.elementId)
addPage=this.addPage
checkIfComplete=(perform this.reportIfCompleteTask)
triggerRerender=(perform this.rerenderTask)
)
table-of-contents=(component
"printable-pages/table-of-contents"
chapters=this.chapters
lastReportPage=this.reportObject.lastPage
pageLayout=this.pageLayout
register=this.registerChapter
registerSection=(fn this.registerSection this.elementId)
addPage=this.addPage
checkIfComplete=(perform this.reportIfCompleteTask)
triggerRerender=(perform this.rerenderTask)
)
)
}}
{{/unless}}
</div>
Loading