Skip to content

Commit

Permalink
Initial project
Browse files Browse the repository at this point in the history
  • Loading branch information
mrthiti committed Apr 1, 2024
0 parents commit 4f82205
Show file tree
Hide file tree
Showing 28 changed files with 7,845 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-explicit-any": "warn"
}
}
29 changes: 29 additions & 0 deletions .github/workflows/check-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check code quality.
run-name: ${{ github.actor }} Check code quality.
on:
push:
branches:
- "**"
- "!main"
jobs:
quality-check:
name: Quality check
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm i
- name: Run eslint
run: npm run lint
- name: Run prettier:check
run: npm run prettier:check
- name: Run test
run: npm run test:coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to npmjs.org.
run-name: ${{ github.actor }} publish ${{ github.ref_name }} to npmjs.org. 🚀🚀🚀
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
publish:
name: Publish to npmjs.org
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: npm i
- name: Run eslint
run: npm run lint
- name: Run prettier:check
run: npm run prettier:check
- name: Run test
run: npm run test:coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
git-branch: main
- name: Build
run: npm run build
- name: Publish ${{ github.ref_name }} to npmjs.org 🚀🚀🚀
run: npm publish
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
/node_modules

# Ignore test-related files
/coverage.data
/coverage/

# Build files
/dist
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npm run lint
npm run prettier:check
npm run test
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
coverage
dist
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Thiti Yamsung

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# icloud-photos-share

[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-downloads-url]
[![MIT License][license-image]][license-url]
[![Coverage Status][coveralls-image]][coveralls-url]

icloud-photos-share it make for retrieve information of share album of icloud photos that use for display on your website.

## Using

Install

```bash
npm install icloud-photos-share
```

For CommonJS (require)

```javascript
const { icloudPhotosShare } = require("icloud-photos-share");

(async () => {
const album = await icloudPhotosShare("B1AG6XBub2QnCol");
console.log(album);
})();
```

For ES modules (import)

```javascript
import { icloudPhotosShare } from "icloud-photos-share";

(async () => {
const album = await icloudPhotosShare("B1AG6XBub2QnCol");
console.log(album);
})();
```

For TypeScript

```TypeScript
import { icloudPhotosShare, type IcloudPhotosShareResponse } from 'icloud-photos-share';

(async () => {
const album:IcloudPhotosShareResponse = await icloudPhotosShare("B1AG6XBub2QnCol");
console.log(album);
})()
```

## License

icloud-photos-share is freely distributable under the terms of the [MIT license][license-url].

[npm-url]: https://www.npmjs.com/package/icloud-photos-share
[npm-version-image]: https://img.shields.io/npm/v/icloud-photos-share.svg?style=flat
[npm-downloads-image]: https://img.shields.io/npm/dm/icloud-photos-share.svg?style=flat
[npm-downloads-url]: https://npmcharts.com/compare/icloud-photos-share?minimal=true
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: LICENSE
[coveralls-image]: https://coveralls.io/repos/mrthiti/icloud-photos-share/badge.svg?branch=main
[coveralls-url]: https://coveralls.io/r/mrthiti/icloud-photos-share?branch=main
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
Loading

0 comments on commit 4f82205

Please sign in to comment.