docs: completed v1 docs (#36)

This commit is contained in:
Morten Olsen
2024-01-15 15:10:19 +01:00
committed by GitHub
parent 161a098c9f
commit 1c3b993ab2
27 changed files with 226 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env node
import 'source-map-support/register.js';
import '../dist/esm/src/index.js';
import '../dist/esm/index.js';

View File

@@ -1,8 +1,8 @@
{
"name": "@morten-olsen/mini-loader-cli",
"version": "1.0.0",
"main": "./dist/esm/src/index.js",
"types": "./dist/esm/src/index.d.ts",
"main": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"license": "GPL-3.0",
"bin": {
"mini-loader": "./bin/index.mjs"
@@ -14,9 +14,12 @@
"files": [
"./dist"
],
"imports": {
"#pkg": "./package.json"
},
"exports": {
".": {
"import": "./dist/esm/src/index.js"
"import": "./dist/esm/index.js"
}
},
"dependencies": {

View File

@@ -1,10 +1,14 @@
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
import superjson from 'superjson';
import { createRequire } from 'module';
import type { Runtime } from '@morten-olsen/mini-loader-server';
import type { RootRouter } from '@morten-olsen/mini-loader-server';
import pkg from '../../package.json';
import { Context } from '../context/context.js';
import { readFile } from 'fs/promises';
const require = createRequire(import.meta.url);
const pkg = JSON.parse(await readFile(require.resolve('#pkg'), 'utf-8'));
const createClient = (context: Context) => {
if (!context.host || !context.token) {
throw new Error('Not signed in');

View File

@@ -6,7 +6,7 @@ import { join } from 'path';
const ENV_PREFIX = 'ML_S_';
const readSecrets = async () => {
let secretLocation = join(process.cwd(), '.secret');
let secretLocation = join(process.cwd(), '.secrets');
let secrets: Record<string, string> = {};

View File

@@ -1,5 +1,5 @@
import { Command, program } from 'commander';
import pkg from '../package.json';
import { createRequire } from 'module';
import { loads } from './commands/loads/loads.js';
import { runs } from './commands/runs/runs.js';
import { logs } from './commands/logs/logs.js';
@@ -9,6 +9,11 @@ import { local } from './commands/local/local.js';
import { auth } from './commands/auth/auth.js';
import { contexts } from './commands/contexts/contexts.js';
import { schedules } from './commands/schedules/schedules.js';
import { readFile } from 'fs/promises';
const require = createRequire(import.meta.url);
const pkg = JSON.parse(await readFile(require.resolve('#pkg'), 'utf-8'));
program.addCommand(loads);
program.addCommand(runs);

View File

@@ -2,6 +2,7 @@
"extends": "@morten-olsen/mini-loader-configs/tsconfig.esm.json",
"compilerOptions": {
"outDir": "dist/esm",
"rootDir": "src"
},
"include": [
"./src/**/*.ts"