This repository was archived by the owner on May 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Shared: Added typescript for times helper #17
Open
promaty
wants to merge
6
commits into
development
Choose a base branch
from
typescript
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0d6c63d
Shared: added typescript for times helper
promaty 1fa4d7d
add more ignores for better caching
promaty 3341d64
tweaked dockerfile to remove lerna
promaty 1d144e2
removed redundant docker lines
promaty 103022f
fixed workspace typo
promaty 17da045
fix workspace typo2
promaty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| .git | ||
| .github | ||
| # from .gitignore | ||
| .env | ||
| lerna-debug.json | ||
| yarn-error.log | ||
| node_modules | ||
| build | ||
|
|
||
| # extra ignores to help docker caching | ||
| monitoring | ||
| .git | ||
| .github | ||
| docker-compose.yml | ||
| README.md | ||
| *.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,10 @@ | |
|
|
||
| # Logs | ||
| lerna-debug.json | ||
| yarn-error.log | ||
|
|
||
| # Dependencies | ||
| node_modules | ||
| package-lock.json | ||
|
|
||
| # builds | ||
| build | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,21 @@ | ||
| FROM node:12.14.0-alpine | ||
| FROM node:12.19.0-alpine | ||
| RUN apk add --no-cache git | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # copy root package and lerna json files | ||
| COPY ./package.json /app/package.json | ||
| COPY ./lerna.json /app/lerna.json | ||
|
|
||
| # copy app package json | ||
| RUN mkdir -p /packages/app | ||
| COPY ./packages/app/package.json /app/packages/app/package.json | ||
|
|
||
| # copy server package json | ||
| RUN mkdir -p /packages/server | ||
| COPY ./packages/server/package.json /app/packages/server/package.json | ||
|
|
||
| # copy services package json | ||
| RUN mkdir -p /packages/services | ||
| COPY ./packages/services/package.json /app/packages/services/package.json | ||
|
|
||
| # copy shared package json | ||
| RUN mkdir -p /packages/shared | ||
| COPY ./packages/shared/package.json /app/packages/shared/package.json | ||
| # copy all package json files | ||
| COPY ./package.json /app/package.json | ||
| COPY ./packages/app/package.json /app/packages/app/package.json | ||
| COPY ./packages/server/package.json /app/packages/server/package.json | ||
| COPY ./packages/services/package.json /app/packages/services/package.json | ||
| COPY ./packages/shared/package.json /app/packages/shared/package.json | ||
|
|
||
| # install dependencies | ||
| COPY ./yarn.lock /app/yarn.lock | ||
| RUN yarn install | ||
| RUN yarn lerna link | ||
| COPY ./yarn.lock /app/yarn.lock | ||
| RUN yarn install --frozen-lockfile | ||
|
|
||
| # try building the app | ||
| COPY . . | ||
| RUN yarn build | ||
|
|
||
| CMD echo specify one of the package.json scripts in command line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/services/src/models/notification-scanners/NotificationScannerBaseModel.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "root": true, | ||
| "plugins": ["@typescript-eslint"], | ||
| "parser": "@typescript-eslint/parser", | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended" | ||
| ], | ||
| "rules": { | ||
| // allow using any and non null assertion for Objection models | ||
| "@typescript-eslint/explicit-module-boundary-types": "off", | ||
| "@typescript-eslint/no-explicit-any": "off", | ||
| "@typescript-eslint/no-non-null-assertion": "off" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "presets": [ | ||
| "@babel/preset-typescript", | ||
| [ | ||
| "@babel/preset-env", | ||
| { | ||
| "targets": { | ||
| "node": "current" | ||
| }, | ||
| "useBuiltIns": "usage", | ||
| "corejs": 3 | ||
| } | ||
| ] | ||
| ], | ||
| "plugins": [ | ||
| "@babel/plugin-proposal-export-namespace-from" | ||
| ] | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| const SECONDS = 1000 | ||
| const MINUTES = 60 * SECONDS | ||
| const HOURS = 60 * MINUTES | ||
| const DAYS = 24 * HOURS | ||
|
|
||
| export { SECONDS, MINUTES, HOURS, DAYS } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "include": [ | ||
| "src/**/*" | ||
| ], | ||
| "compilerOptions": { | ||
| "strict": true, | ||
| "outDir": "./build", | ||
| "declaration": true, | ||
| "emitDeclarationOnly": true, | ||
| "moduleResolution": "Node", | ||
| // allow advanced js features, proper targeting is done using Babel | ||
| "target": "ESNext", | ||
| // allow non-ES modules with 'export =' syntax as default imports | ||
| "esModuleInterop": true, | ||
| // allow json import | ||
| "resolveJsonModule": true | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be a dumb question, but when we update these other helpers to be in TS, would we be able to import the source files?
It seems a bit weird to have to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to do it would be to define
mainandtypesinpackage.jsonlike I did in ipfs pinner and then have all imports in a singleindex.tsfile:https://github.com/aragonone/ipfs-pinner/blob/development/packages/shared/src/index.ts
In this case we could import the same thing like this:
I find this more verbose however and you also have to think about multiple imports/exports not just the source file directly.