Skip to content

Commit d012ee8

Browse files
committed
Initial project
0 parents  commit d012ee8

28 files changed

+7845
-0
lines changed

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"prettier"
11+
],
12+
"overrides": [],
13+
"parser": "@typescript-eslint/parser",
14+
"parserOptions": {
15+
"ecmaVersion": "latest",
16+
"sourceType": "module"
17+
},
18+
"plugins": ["@typescript-eslint"],
19+
"rules": {
20+
"@typescript-eslint/no-explicit-any": "warn"
21+
}
22+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check code quality.
2+
run-name: ${{ github.actor }} Check code quality.
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
- "!main"
8+
jobs:
9+
quality-check:
10+
name: Quality check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out repository code
14+
uses: actions/checkout@v4
15+
- name: Setup Nodejs
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "20.x"
19+
registry-url: "https://registry.npmjs.org"
20+
- name: Install dependencies
21+
run: npm i
22+
- name: Run eslint
23+
run: npm run lint
24+
- name: Run prettier:check
25+
run: npm run prettier:check
26+
- name: Run test
27+
run: npm run test:coverage
28+
- name: Coveralls
29+
uses: coverallsapp/github-action@v2

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to npmjs.org.
2+
run-name: ${{ github.actor }} publish ${{ github.ref_name }} to npmjs.org. 🚀🚀🚀
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- v*
8+
jobs:
9+
publish:
10+
name: Publish to npmjs.org
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out repository code
14+
uses: actions/checkout@v4
15+
- name: Setup Nodejs
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "20.x"
19+
registry-url: "https://registry.npmjs.org"
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
- name: Install dependencies
23+
run: npm i
24+
- name: Run eslint
25+
run: npm run lint
26+
- name: Run prettier:check
27+
run: npm run prettier:check
28+
- name: Run test
29+
run: npm run test:coverage
30+
- name: Coveralls
31+
uses: coverallsapp/github-action@v2
32+
with:
33+
git-branch: main
34+
- name: Build
35+
run: npm run build
36+
- name: Publish ${{ github.ref_name }} to npmjs.org 🚀🚀🚀
37+
run: npm publish

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
/node_modules
3+
4+
# Ignore test-related files
5+
/coverage.data
6+
/coverage/
7+
8+
# Build files
9+
/dist

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
npm run lint
2+
npm run prettier:check
3+
npm run test

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
coverage
3+
dist

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": "always"
6+
}
7+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Thiti Yamsung
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# icloud-photos-share
2+
3+
[![NPM version][npm-version-image]][npm-url]
4+
[![NPM downloads][npm-downloads-image]][npm-downloads-url]
5+
[![MIT License][license-image]][license-url]
6+
[![Coverage Status][coveralls-image]][coveralls-url]
7+
8+
icloud-photos-share it make for retrieve information of share album of icloud photos that use for display on your website.
9+
10+
## Using
11+
12+
Install
13+
14+
```bash
15+
npm install icloud-photos-share
16+
```
17+
18+
For CommonJS (require)
19+
20+
```javascript
21+
const { icloudPhotosShare } = require("icloud-photos-share");
22+
23+
(async () => {
24+
const album = await icloudPhotosShare("B1AG6XBub2QnCol");
25+
console.log(album);
26+
})();
27+
```
28+
29+
For ES modules (import)
30+
31+
```javascript
32+
import { icloudPhotosShare } from "icloud-photos-share";
33+
34+
(async () => {
35+
const album = await icloudPhotosShare("B1AG6XBub2QnCol");
36+
console.log(album);
37+
})();
38+
```
39+
40+
For TypeScript
41+
42+
```TypeScript
43+
import { icloudPhotosShare, type IcloudPhotosShareResponse } from 'icloud-photos-share';
44+
45+
(async () => {
46+
const album:IcloudPhotosShareResponse = await icloudPhotosShare("B1AG6XBub2QnCol");
47+
console.log(album);
48+
})()
49+
```
50+
51+
## License
52+
53+
icloud-photos-share is freely distributable under the terms of the [MIT license][license-url].
54+
55+
[npm-url]: https://www.npmjs.com/package/icloud-photos-share
56+
[npm-version-image]: https://img.shields.io/npm/v/icloud-photos-share.svg?style=flat
57+
[npm-downloads-image]: https://img.shields.io/npm/dm/icloud-photos-share.svg?style=flat
58+
[npm-downloads-url]: https://npmcharts.com/compare/icloud-photos-share?minimal=true
59+
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat
60+
[license-url]: LICENSE
61+
[coveralls-image]: https://coveralls.io/repos/mrthiti/icloud-photos-share/badge.svg?branch=main
62+
[coveralls-url]: https://coveralls.io/r/mrthiti/icloud-photos-share?branch=main

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
testEnvironment: "node",
4+
};

0 commit comments

Comments
 (0)