Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Hello fellow developer 👋
//
// I feel sad to be a shameful plug of an extra config.
//
// I'm essential for your development environment and IDE to recognize that
// eslint exists and start picking up the only rules that you only
// ever need. Feel free to override them standard eslint ways!
module.exports = {
root: true,
extends: ['./node_modules/@repka-kit/ts/configs/eslint/eslint-root.cjs'],
};
12 changes: 0 additions & 12 deletions .eslintrc.js

This file was deleted.

35 changes: 27 additions & 8 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,40 @@ jobs:

strategy:
matrix:
node: ["10"]
node: ['18']

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Get Node Version
run: |
echo "NODE_VERSION=$(jq -r .engines.node package.json)" >> $GITHUB_ENV

- name: Setup Node
uses: actions/setup-node@v1.1.0
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v2
name: Install pnpm

- name: Get pnpm store directory
id: pnpm-store
run: |
echo "PNPM_STORE_DIR=$(pnpm store path)" >> $GITHUB_ENV

- uses: actions/cache@v3
name: Setup pnpm cache
with:
node-version: ${{ matrix.node }}
path: ${{ env.PNPM_STORE_DIR }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install
run: |-
npm install && npm install chromedriver@$(node -p '/\d+/.exec(process.argv.slice(1).join(" "))[0]' $(google-chrome --version)) --no-save
- name: Install Dependencies
run: pnpm install

- name: Check
env:
Expand All @@ -36,4 +55,4 @@ jobs:
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
run: node ./op-update-watcher/checkVersionAndPush.js
run: tsx ./op-update-watcher/checkVersionAndPush.ts
43 changes: 23 additions & 20 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,43 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: ['10']

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Get Node Version
run: |
echo "NODE_VERSION=$(jq -r .engines.node package.json)" >> $GITHUB_ENV

- name: Setup Node
uses: actions/setup-node@v1.1.0
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: ${{ env.NODE_VERSION }}

- name: Install Yarn
run: npm install -g yarn
- uses: pnpm/action-setup@v2
name: Install pnpm

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get pnpm store directory
id: pnpm-store
run: |
echo "PNPM_STORE_DIR=$(pnpm store path)" >> "$GITHUB_ENV"
echo "PNPM_STORE_DIR=$(pnpm store path)" >> "$Env:GITHUB_ENV"

- uses: actions/cache@v1
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
path: ${{ steps.pnpm-store.outputs.name }}"
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install
run: yarn install --frozen-lockfile
${{ runner.os }}-pnpm-store-

- name: Checks
run: yarn run check
- name: Install Dependencies
run: pnpm install

- name: Unit Tests
run: yarn run test
run: pnpm jest

- name: Integration Tests
run: yarn run integration
run: pnpm jest --integration
18 changes: 16 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ lib
node_modules
cert.pem
zaripych-node-op*
node-op*
.log
.DS_Store

coverage
coverage-*
.jest-cache
Expand All @@ -19,3 +17,19 @@ log.txt
dist
out
.local-semantic-release
.idea/
.vscode/
node_modules/
*.tgz
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.npm/
.turbo
.tsc-out
.temporary
dist-prev
bin/op
bin/op.cmd
bin/op.exe
bin/package.pkg
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

9 changes: 9 additions & 0 deletions .quokka
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"stdEsm": false,
"nativeEsm": true,
"env": {
"params": {
"runner": "--experimental-specifier-resolution=node"
}
}
}
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ $> which op

## CLI Installation Process

During `npm install` a script is executed which downloads and unpacks [pinned](https://github.com/zaripych/node-op/blob/master/package.json#L119) version of `op` into your `node_modules/node-op/lib/binaries` folder.
During `npm install` a script is executed which downloads and unpacks [pinned](https://github.com/zaripych/node-op/blob/master/package.json#L119) version of `op` into your `node_modules/node-op/bin` folder.

The `op` executable becomes available to be used through `npm run` or `yarn run`.

Expand Down
10 changes: 0 additions & 10 deletions babel.config.js

This file was deleted.

15 changes: 0 additions & 15 deletions babel.config.rollup.js

This file was deleted.

62 changes: 62 additions & 0 deletions bin/node-op.gen.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env node
// NOTE: This file is bundled up from './src/bin/*' and needs to be committed
import { spawn } from 'node:child_process';
import { stat } from 'node:fs/promises';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';

const isFile = async (file) => {
return await stat(file)
.then((result) => result.isFile())
.catch(() => false);
};

async function findBin(startWith, binScriptPath) {
let current = startWith;
while (current !== '/' && current !== '~/') {
const candidate = join(current, 'node_modules', binScriptPath);
if (await isFile(candidate)) {
return candidate;
}
current = dirname(current);
}
}

const binPath = async (binName, binScriptPath) => {
const root = fileURLToPath(new URL('../', import.meta.url));
const bestGuess = join(root, 'node_modules', '.bin', binName);
if (await isFile(bestGuess)) {
return bestGuess;
}
const result = await findBin(root, binScriptPath);
if (result) {
return result;
}
throw new Error(`Cannot find bin ${binName}`);
};


const onError = (err) => {
console.error(err);
process.exitCode = 1;
};

binPath('tsx', 'tsx/dist/cli.js').then((result) => {
const cp = spawn(
result,
[
fileURLToPath(new URL('../src/bin/node-op.ts', import.meta.url)),
...process.argv.slice(2),
],
{ stdio: 'inherit' }
);
cp.on('error', onError);
cp.on('close', (code, signal) => {
if (typeof code === 'number') {
process.exitCode = code;
} else if (typeof signal === 'string') {
console.error('Failed to start', 'node-op', signal);
}
});
}, onError);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS1vcC5nZW4ubWpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
62 changes: 62 additions & 0 deletions bin/vault-checkin.gen.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env node
// NOTE: This file is bundled up from './src/bin/*' and needs to be committed
import { spawn } from 'node:child_process';
import { stat } from 'node:fs/promises';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';

const isFile = async (file) => {
return await stat(file)
.then((result) => result.isFile())
.catch(() => false);
};

async function findBin(startWith, binScriptPath) {
let current = startWith;
while (current !== '/' && current !== '~/') {
const candidate = join(current, 'node_modules', binScriptPath);
if (await isFile(candidate)) {
return candidate;
}
current = dirname(current);
}
}

const binPath = async (binName, binScriptPath) => {
const root = fileURLToPath(new URL('../', import.meta.url));
const bestGuess = join(root, 'node_modules', '.bin', binName);
if (await isFile(bestGuess)) {
return bestGuess;
}
const result = await findBin(root, binScriptPath);
if (result) {
return result;
}
throw new Error(`Cannot find bin ${binName}`);
};


const onError = (err) => {
console.error(err);
process.exitCode = 1;
};

binPath('tsx', 'tsx/dist/cli.js').then((result) => {
const cp = spawn(
result,
[
fileURLToPath(new URL('../src/bin/vault-checkin.ts', import.meta.url)),
...process.argv.slice(2),
],
{ stdio: 'inherit' }
);
cp.on('error', onError);
cp.on('close', (code, signal) => {
if (typeof code === 'number') {
process.exitCode = code;
} else if (typeof signal === 'string') {
console.error('Failed to start', 'vault-checkin', signal);
}
});
}, onError);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmF1bHQtY2hlY2tpbi5nZW4ubWpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
Loading