-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update workflow to support ts (#1119)
- Loading branch information
Showing
35 changed files
with
3,546 additions
and
7,378 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
# copy this file as .env for testing env | ||
|
||
SERVER_ENDPOINT="" | ||
ACCESS_KEY="" | ||
SECRET_KEY="" |
This file contains 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 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 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 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 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 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,4 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run type-check | ||
npm run lint-staged |
This file contains 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,7 @@ | ||
module.exports = { | ||
spec: 'tests/**/*.js', | ||
exit: true, | ||
reporter: 'spec', | ||
ui: 'bdd', | ||
require: ['dotenv/config', 'source-map-support/register', './babel-register.js'], | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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 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,5 +1,5 @@ | ||
# For maintainers only | ||
MinIO JS SDK uses [npm4+](https://www.npmjs.org/) build system. | ||
Development of MinIO JS SDK require nodejs14+ and [npm7+](https://www.npmjs.org/). | ||
|
||
## Responsibilities | ||
Go through [Maintainer Responsibility Guide](https://gist.github.com/abperiasamy/f4d9b31d3186bbd26522). | ||
|
@@ -11,12 +11,16 @@ $ git clone [email protected]:minio/minio-js | |
$ cd minio-js | ||
``` | ||
|
||
### Build and verify | ||
Run `install` gulp task to build and verify the SDK. | ||
```sh | ||
### Install deps | ||
```shell | ||
$ npm install | ||
``` | ||
|
||
### Testing | ||
```shell | ||
$ npm test | ||
``` | ||
|
||
## Publishing new release | ||
Edit `package.json` version and all other files to the latest version as shown below. | ||
```sh | ||
|
@@ -34,6 +38,11 @@ $ npm login | |
Logged in as minio on https://registry.npmjs.org/. | ||
``` | ||
|
||
Build for release | ||
```sh | ||
$ npm run build | ||
``` | ||
|
||
Publish the new release to npm repository. | ||
``` | ||
$ npm publish | ||
|
This file contains 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,28 @@ | ||
// fix babel register doesn't transform TypeScript | ||
// | ||
// https://github.com/babel/babel/issues/8962#issuecomment-443135379 | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs | ||
const register = require('@babel/register') | ||
|
||
register({ | ||
extensions: ['.ts', '.js'], | ||
assumptions: { | ||
constantSuper: true, | ||
noIncompleteNsImportDetection: true, | ||
constantReexports: true, | ||
}, | ||
plugins: [ | ||
[ | ||
'@babel/plugin-transform-modules-commonjs', | ||
{ | ||
importInterop: 'node', | ||
}, | ||
], | ||
'@upleveled/remove-node-prefix', // lower version of node (<14) doesn't support require('node:fs') | ||
], | ||
presets: [ | ||
['@babel/preset-typescript', { allExtensions: true }], | ||
['@babel/preset-env', { targets: { node: 'current' }, modules: 'cjs' }], | ||
], | ||
}) |
Oops, something went wrong.