diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..928da0d --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +1738772fec746bca5575c5e7d8b0fbd3acad505a diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index acb5216..96296ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,53 +3,53 @@ name: Audit on: [push] jobs: - audit: - name: Audit Project - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '24' - - - name: Lib - Install - run: npm i - working-directory: ./keeperapi - env: - NPM_TOKEN: "" - - - name: Lib - Build - run: npm run build - working-directory: ./keeperapi - env: - NPM_TOKEN: "" - - - name: Lib - Check Types - run: npm run types:ci - working-directory: ./keeperapi - env: - NPM_TOKEN: "" - - - name: Lib - Run Unit Tests - run: npm run test - working-directory: ./keeperapi - - - name: Examples (node) - Installation - run: npm run link-local - working-directory: ./examples/print-vault-node - - - name: Examples (node) - Check Types - run: npm run types:ci - working-directory: ./examples/print-vault-node - - - name: Examples (browser) - Installation - run: npm run link-local - working-directory: ./examples/print-vault-browser - - - name: Examples (browser) - Check Types - run: npm run types:ci - working-directory: ./examples/print-vault-browser + audit: + name: Audit Project + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '24' + + - name: Lib - Install + run: npm i + working-directory: ./keeperapi + env: + NPM_TOKEN: '' + + - name: Lib - Build + run: npm run build + working-directory: ./keeperapi + env: + NPM_TOKEN: '' + + - name: Lib - Check Types + run: npm run types:ci + working-directory: ./keeperapi + env: + NPM_TOKEN: '' + + - name: Lib - Run Unit Tests + run: npm run test + working-directory: ./keeperapi + + - name: Examples (node) - Installation + run: npm run link-local + working-directory: ./examples/print-vault-node + + - name: Examples (node) - Check Types + run: npm run types:ci + working-directory: ./examples/print-vault-node + + - name: Examples (browser) - Installation + run: npm run link-local + working-directory: ./examples/print-vault-browser + + - name: Examples (browser) - Check Types + run: npm run types:ci + working-directory: ./examples/print-vault-browser diff --git a/.github/workflows/publish.npm.yml b/.github/workflows/publish.npm.yml index 9fc66b2..d6de0e7 100644 --- a/.github/workflows/publish.npm.yml +++ b/.github/workflows/publish.npm.yml @@ -1,32 +1,32 @@ name: Publish to NPM on: - workflow_dispatch: + workflow_dispatch: permissions: - contents: read - id-token: write + contents: read + id-token: write jobs: - publish-npm: - environment: prod - runs-on: ubuntu-latest + publish-npm: + environment: prod + runs-on: ubuntu-latest - defaults: - run: - working-directory: ./keeperapi + defaults: + run: + working-directory: ./keeperapi - steps: - - name: Get the source code - uses: actions/checkout@v4 + steps: + - name: Get the source code + uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '24' - registry-url: 'https://registry.npmjs.org' + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: npm install + - name: Install dependencies + run: npm install - - name: Publish package - run: npm publish + - name: Publish package + run: npm publish diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..4f06c22 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "singleQuote": true, + "semi": true, + "tabWidth": 4, + "printWidth": 120, + "trailingComma": "es5" +} diff --git a/README.md b/README.md index c424d7a..be5351b 100644 --- a/README.md +++ b/README.md @@ -15,27 +15,28 @@ npm install keeperapi ``` ```typescript - try { - let auth = new Auth({ - host: KeeperEnvironment.DEV - }); - await auth.login(username, password); - console.log("login successful"); - let vault = new Vault(auth); - await vault.syncDown(); - vault.records.forEach(x => console.log(JSON.stringify(x))); - } catch (e) { - console.log(e); - } +try { + let auth = new Auth({ + host: KeeperEnvironment.DEV, + }); + await auth.login(username, password); + console.log('login successful'); + let vault = new Vault(auth); + await vault.syncDown(); + vault.records.forEach((x) => console.log(JSON.stringify(x))); +} catch (e) { + console.log(e); +} ``` -For local development, +For local development, ```bash npm run build ``` - from "keeperapi" folder, then - + +from "keeperapi" folder, then + ```bash npm link ../../keeperapi ``` diff --git a/examples/print-vault-browser/README.md b/examples/print-vault-browser/README.md index 7d67074..ceb59ac 100644 --- a/examples/print-vault-browser/README.md +++ b/examples/print-vault-browser/README.md @@ -1,8 +1,10 @@ # print-vault-browser ### INSTRUCTIONS + - `npm install` - `npm start` ### NOTES -- By default, the `preinstall` script links the installed version of `keeperapi` to the local version in this repo \ No newline at end of file + +- By default, the `preinstall` script links the installed version of `keeperapi` to the local version in this repo diff --git a/examples/print-vault-browser/package.json b/examples/print-vault-browser/package.json index 0b08ecb..adc74a8 100644 --- a/examples/print-vault-browser/package.json +++ b/examples/print-vault-browser/package.json @@ -1,39 +1,39 @@ { - "name": "print-vault-browser", - "version": "0.1.0", - "private": true, - "scripts": { - "start": "react-scripts start", - "link-local": "npm link ../../keeperapi", - "types": "tsc --watch", - "types:ci": "tsc" - }, - "dependencies": { - "keeperapi": "0.2.0", - "react": "^16.8.6", - "react-dom": "^16.8.6" - }, - "devDependencies": { - "@types/jest": "24.0.15", - "@types/node": "12.0.8", - "@types/react": "16.8.21", - "@types/react-dom": "16.8.4", - "react-scripts": "3.0.1", - "typescript": "^4.0.1" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } + "name": "print-vault-browser", + "version": "0.1.0", + "private": true, + "scripts": { + "start": "react-scripts start", + "link-local": "npm link ../../keeperapi", + "types": "tsc --watch", + "types:ci": "tsc" + }, + "dependencies": { + "keeperapi": "0.2.0", + "react": "^16.8.6", + "react-dom": "^16.8.6" + }, + "devDependencies": { + "@types/jest": "24.0.15", + "@types/node": "12.0.8", + "@types/react": "16.8.21", + "@types/react-dom": "16.8.4", + "react-scripts": "3.0.1", + "typescript": "^4.0.1" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } } diff --git a/examples/print-vault-browser/public/index.html b/examples/print-vault-browser/public/index.html index c84141d..15a5604 100644 --- a/examples/print-vault-browser/public/index.html +++ b/examples/print-vault-browser/public/index.html @@ -1,16 +1,16 @@ - + -
- - - - - - - -