Skip to content
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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try


63 changes: 33 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,55 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
sourceType: 'module',
},
plugins: [
'ember'
],
plugins: ['ember', 'prettier', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
},
rules: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: ['**/*.ts'],
extends: ['plugin:@typescript-eslint/eslint-recommended'],
rules: {
'no-unused-vars': 'off',
},
},
{
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',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
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'],
},
],
};
13 changes: 7 additions & 6 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node-version: 12.x
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test
- run: yarn test:ember

floating-dependencies:
name: "Floating Dependencies"
Expand All @@ -33,7 +33,7 @@ jobs:
with:
node-version: 14.x
- run: yarn install --no-lockfile
- run: yarn test
- run: yarn test:ember

try-scenarios:
name: "Try: ${{ matrix.ember-try-scenario }}"
Expand All @@ -43,16 +43,17 @@ jobs:
needs: test

strategy:
fail-fast: true
matrix:
ember-try-scenario:
- ember-lts-3.8
- ember-lts-3.12
- ember-lts-3.16
- ember-lts-3.20
- ember-lts-3.24
- ember-release
- ember-beta
- ember-canary
- ember-default-with-jquery
- ember-classic
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# misc
/.env*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand All @@ -22,3 +23,9 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

# typescript related output files
addon/**/*.js
addon/**/*.d.ts
package/
*.tgz
20 changes: 19 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,40 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/config/
/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
/package.json.ember-try

# typescript
#
# avoid publishing .d.ts or .ts files
# until they have become enforced "public" APIs
*.ts
# to enable d.ts consumption remove the next line
# !*.d.ts
!addon/**/*.js
server/
tsconfig.json
*.tgz
DEPRECATIONS.md
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: true,
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'recommended',
};
File renamed without changes.
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
## Installation

* `git clone <repository-url>`
* `cd my-addon`
* `npm install`
* `cd @ember/string`
* `yarn install`

## Linting

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

## Running tests

Expand All @@ -23,4 +22,4 @@
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ A set of utilities to transform strings extracted from the core of Ember.
Compatibility
------------------------------------------------------------------------------

* Ember.js v2.18 or above
* Ember CLI v2.13 or above
* Ember.js v3.20 or above
* Ember CLI v3.20 or above
* Node.js v12 or above


Installation
Expand All @@ -31,9 +32,8 @@ import {
classify,
dasherize,
decamelize,
underscore
underscore,
w,
loc,
} from '@ember/string'
```

Expand Down
6 changes: 5 additions & 1 deletion addon/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ export default class Cache<T, V> {
public misses = 0;
public hits = 0;

constructor(private limit: number, private func: (obj: T) => V, private store?: any) {
constructor(
private limit: number,
private func: (obj: T) => V,
private store?: any
) {
this.store = store || new Map();
}

Expand Down
46 changes: 0 additions & 46 deletions addon/helpers/loc.ts

This file was deleted.

Loading