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

Chore/179551806/convert to ts #11

Open
wants to merge 16 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
10 changes: 0 additions & 10 deletions .editorconfig

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.coverage/
lib/
node_modules/
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
root: true,
extends: ['plugin:goodeggs/recommended', 'plugin:goodeggs/typescript'],
env: {
node: true,
},
parserOptions: {
project: './tsconfig.json',
},
overrides: [
{
files: ['**/{*.,}test{.*,}.{js,jsx,ts,tsx}'],
extends: ['plugin:goodeggs/jest'],
env: {
mocha: true,
},
},
// Project configuration files
{
files: ['*.config{.babel,}.js', '.*rc.js'],
env: {
node: true,
},
rules: {
'import/no-commonjs': 'off',
},
},
],
};
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/
npm-debug.log
.DS_Store
*.log
.coverage/
lib/
node_modules/
.node_history
.*cache
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.gitignore
.travis.yml
test/
lib/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this, we'll publish an unusable package that doesn't include the built code, which is the only useful thing to include!

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@goodeggs/toolkit/config/prettier');
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: node_js
node_js:
- '8'
- "14"
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,49 @@ formatters for good eggs

[![Build Status](http://img.shields.io/travis/goodeggs/goodeggs-formatters.svg?style=flat-square)](https://travis-ci.org/goodeggs/goodeggs-formatters)


## Usage

```
npm install goodeggs-formatters
yarn install goodeggs-formatters
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No such thing!

Suggested change
yarn install goodeggs-formatters
yarn add goodeggs-formatters

```

```coffeescript
goodeggsFormatters = require 'goodeggs-formatters'
```


## Contributing

```
$ git clone https://github.com/goodeggs/goodeggs-formatters && cd goodeggs-formatters
$ npm install
$ npm test
```

To compile the project:

```sh
yarn run build
```

To run tests:

```sh
yarn run test
```

To build:

```sh
yarn build
```

## Releasing

To release a new version of this module, use yarn to bump the version
in `package.json` and create a git tag, then push. This will automatically
get published to the NPM registry via CI.

```sh
yarn version --new-version=<major|minor|patch|premajor|preminor|prepatch>
git push --follow-tags
Comment on lines +41 to +49
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as in goodeggs-validators here: this is false. Can you include the same language here as from that PR?

```

_Module scaffold generated by [generator-goodeggs-npm](https://github.com/goodeggs/generator-goodeggs-npm)._
13 changes: 13 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
'@babel/typescript',
],
};
56 changes: 38 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"Michael Kebbekus <[email protected]>",
"Michelle Becker <[email protected]>"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
Comment on lines +10 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this repo was also strangely public but published to our private registry. It's weird, but let's not change that now. Please undo this change!

"license": "Private",
"main": "lib/index.js",
"repository": {
Expand All @@ -21,31 +25,47 @@
"fraction.js": "^1.3.0",
"getto": "0.0.2",
"inflect": "^0.3.0",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"node-clock": "^0.1.1",
"underscore": "^1.7.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-preset-es2015": "^6.24.1",
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.8",
"@babel/node": "^7.15.8",
"@babel/plugin-transform-runtime": "^7.15.8",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.15.8",
"@babel/preset-typescript": "^7.15.0",
"@babel/register": "^7.15.3",
"@goodeggs/toolkit": "^4.0.4",
"@goodeggs/tsconfig": "^1.0.0",
"@types/accounting": "^0.4.2",
"@types/jest": "^27.0.2",
"@types/lodash": "^4.14.176",
"@types/node": "^16.10.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're testing on node 14 so maybe use 14 here?

"@types/sinon": "^10.0.4",
"@types/underscore": "^1.11.3",
"babel-jest": "^27.2.4",
"chai": "^1.10.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove? you switched to jest, so should be unused now

"jest": "^27.2.4",
"mocha": "~1.x.x",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, remove?

"sinon": "^1.12.2"
},
"babel": {
"sourceMaps": "inline",
"presets": [
"es2015"
]
"sinon": "^11.1.2",
"typescript": "^4.4.3"
},
"scripts": {
"compile": "babel -d lib/ src/",
"prepublish": "npm run compile",
"pretest": "npm run compile",
"test": "mocha"
},
"publishConfig": {
"registry": "https://npm.goodeggs.com/",
"always-auth": true
"build": "yarn run build:clean && yarn run build:es && yarn run build:types",
"build:clean": "rm -rf lib",
"build:es": "babel src --out-dir lib --copy-files --extensions=.ts,.js,.jsx,.tsx",
"build:types": "tsc --project tsconfig.declarations.json",
"lint": "yarn run lint:es",
"lint:es": "getk run lint-es",
"lint:fix": "yarn run lint:fix:es",
"lint:fix:es": "getk run fix-es",
"prepublishOnly": "yarn lint && yarn test && yarn run build",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only need to build the code before publishing. We don't usually run tests here.

Suggested change
"prepublishOnly": "yarn lint && yarn test && yarn run build",
"prepublishOnly": "yarn run build",

"test": "jest src/",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't running linting or typechecking in CI.

Suggested change
"test": "jest src/",
"test": "yarn run lint && yarn run typecheck && yarn run test:unit",
"test:unit": "jest",

"typecheck": "tsc"
}
}
Loading