Skip to content
Merged
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
19 changes: 19 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
"dev:core": "turbo run @aura-stack/auth#dev",
"dev:docs": "turbo run docs#dev",
"build": "turbo run build --filter=./configs/* --filter=./packages/* --filter=./apps/*",
"build:prod": "turbo run build --filter=./configs/* --filter=./packages/* --continue=dependencies-successful",
"build:prod": "turbo run build --filter=./configs/* --filter=./packages/* --filter=!./packages/integration --continue=dependencies-successful",
"test": "turbo run test --parallel",
"format": "turbo run format format:root --parallel",
"format:root": "oxfmt \"!packages\" \"!apps\" \"!configs\"",
"format:check": "oxfmt --check",
"lint": "oxlint",
"lint:fix": "oxlint --fix",
"type-check": "turbo run type-check --parallel"
"type-check": "turbo run type-check --parallel",
"create:integration": "node packages/shared/scripts/integration.js"
},
"repository": {
"type": "git",
Expand Down
13 changes: 13 additions & 0 deletions packages/integration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog - `@aura-stack/integration`

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [Unreleased]

### Added

### Changed
35 changes: 35 additions & 0 deletions packages/integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<div align="center">

<h1><b>@aura-stack/integration</b></h1>

**Integration authentication library for the Aura Stack ecosystem**

[![npm version](https://img.shields.io/npm/v/@aura-stack/integration.svg)](https://www.npmjs.com/package/@aura-stack/integration)
[![JSR version](https://jsr.io/badges/@aura-stack/integration)](https://jsr.io/@aura-stack/integration)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

[Official Docs](https://aura-stack-auth.vercel.app/docs) · [Core Package Docs](https://aura-stack-auth.vercel.app/docs/packages/core)

</div>

## Features

## Installation

```bash
pnpm add @aura-stack/integration
```

## Documentation

Visit the [**official documentation website**](https://aura-stack-auth.vercel.app).

## License

Licensed under the [MIT License](../../LICENSE). © [Aura Stack](https://github.com/aura-stack-ts)

---

<p align="center">
Made with ❤️ by <a href="https://github.com/aura-stack-ts">Aura Stack team</a>
</p>
19 changes: 19 additions & 0 deletions packages/integration/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@aura-stack/integration",
"version": "0.0.0",
"license": "MIT",
"tasks": {
"dev": "deno run --watch src/index.ts"
},
"imports": {
"@/": "./src/",
"./oauth": "./src/oauth/index.ts",
"./identity": "./src/_core/identity.ts",
"./crypto": "./src/_core/crypto.ts",
"./shared": "./src/_core/shared.ts"
},
"publish": {
"include": ["src/**/*.ts", "src/**/*.tsx", "README.md", "CHANGELOG.md"]
},
"exclude": ["dist", "node_modules"]
}
79 changes: 79 additions & 0 deletions packages/integration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "@aura-stack/integration",
"version": "0.0.0",
"private": true,
"type": "module",
"description": "Integration for Aura Stack authentication library",
"scripts": {
"dev": "tsdown --watch",
"build": "pnpm sync:modules && tsdown",
"lint": "oxlint",
"lint:fix": "oxlint --fix",
"test": "vitest --run",
"test:watch": "vitest",
"test:coverage": "vitest --run --coverage",
"format": "oxfmt",
"format:check": "oxfmt --check",
"type-check": "tsc --noEmit",
"clean": "rm -rf dist src/_core src/oauth",
Comment thread
halvaradop marked this conversation as resolved.
"clean:cts": "if [ -d dist ]; then find dist -type f -name \"*.cts\" -delete; fi",
"prepublishOnly": "pnpm clean:cts && pnpm build && pnpm clean:cts",
"sync:modules": "node ../shared/scripts/modules.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/aura-stack-ts/auth"
},
"sideEffects": false,
"files": [
"dist"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./oauth": {
"types": "./dist/oauth/index.d.ts",
"import": "./dist/oauth/index.js",
"require": "./dist/oauth/index.cjs"
},
"./oauth/*": {
"types": "./dist/oauth/*.d.ts",
"import": "./dist/oauth/*.js",
"require": "./dist/oauth/*.cjs"
},
"./identity": {
"types": "./dist/_core/identity.d.ts",
"import": "./dist/_core/identity.js",
"require": "./dist/_core/identity.cjs"
},
"./crypto": {
"types": "./dist/_core/crypto.d.ts",
"import": "./dist/_core/crypto.js",
"require": "./dist/_core/crypto.cjs"
},
"./shared": {
"types": "./dist/_core/shared.d.ts",
"import": "./dist/_core/shared.js",
"require": "./dist/_core/shared.cjs"
}
},
Comment thread
halvaradop marked this conversation as resolved.
"keywords": [],
"author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
"homepage": "https://aura-stack-auth.vercel.app",
"bugs": {
"url": "https://github.com/aura-stack-ts/auth/issues"
},
"license": "MIT",
"dependencies": {
"@aura-stack/auth": "workspace:*"
},
"devDependencies": {
"@aura-stack/tsconfig": "workspace:*",
"@aura-stack/tsdown-config": "workspace:*"
},
"peerDependencies": {},
"packageManager": "pnpm@10.15.0"
}
7 changes: 7 additions & 0 deletions packages/integration/src/createAuth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { AuthConfig, createAuth as createAuthInstance } from "@aura-stack/auth"
import type { EditableShape, UserShape } from "@aura-stack/auth/identity"

export const createAuth = <Identity extends EditableShape<UserShape>>(config: AuthConfig<Identity>) => {
const auth = createAuthInstance<Identity>(config)
return auth
}
1 change: 1 addition & 0 deletions packages/integration/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { createAuth } from "@/createAuth.ts"
12 changes: 12 additions & 0 deletions packages/integration/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "@aura-stack/tsconfig/tsconfig.base.json",
"compilerOptions": {
"noEmit": true,
"allowImportingTsExtensions": true,
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"],
"exclude": ["dist", "node_modules"]
}
14 changes: 14 additions & 0 deletions packages/integration/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from "tsdown"
import { tsdownConfig } from "@aura-stack/tsdown-config"

export default defineConfig({
...tsdownConfig,
entry: [
"src/index.ts",
"src/oauth/index.ts",
"src/oauth/*.ts",
"src/_core/identity.ts",
"src/_core/crypto.ts",
"src/_core/shared.ts",
],
Comment thread
halvaradop marked this conversation as resolved.
})
54 changes: 54 additions & 0 deletions packages/shared/scripts/integration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { existsSync } from "node:fs"
import { parseArgs } from "node:util"
import { cp } from "node:fs/promises"
import { basename, resolve } from "node:path"

const args = parseArgs({
args: process.argv.slice(2),
strict: true,
options: {
name: {
type: "string",
},
},
})

const { name } = args.values

if (!name) {
console.error("\x1b[31m[error]: Integration name is required\x1b[0m")
process.exit(1)
}
if (!/^[a-z0-9][a-z0-9-]*$/.test(name)) {
console.error("\x1b[31m[error]: Integration name must be lowercase alphanumeric with dashes\x1b[0m")
process.exit(1)
}

if (existsSync(resolve(process.cwd(), "packages", name))) {
console.error("\x1b[31m[error]: Integration with the same name already exists\x1b[0m")
process.exit(1)
}
Comment thread
halvaradop marked this conversation as resolved.

try {
const outDir = resolve(process.cwd(), "packages", name)
const templateDir = resolve(process.cwd(), "packages", "integration")

if (!existsSync(templateDir)) {
console.error("\x1b[31m[error]: Integration template folder not found at packages/integration\x1b[0m")
process.exit(1)
}

console.log(`\x1b[34m[info]: Creating integration "${name}"...\x1b[0m`)
await cp(templateDir, outDir, {
recursive: true,
filter: (src) => {
const name = basename(src)
return name !== "node_modules" && name !== "dist"
},
})

console.log("\x1b[32m[success]: Integration created successfully\x1b[0m")
} catch (error) {
console.error("\x1b[31m[error]: Failed to create integration:\x1b[0m", error)
process.exit(1)
}
4 changes: 2 additions & 2 deletions packages/shared/scripts/modules.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { glob, mkdir, readFile, writeFile } from "node:fs/promises"
import { join, parse, resolve } from "node:path"
import { parseArgs } from "node:util"
import { join, parse, resolve } from "node:path"
import { glob, mkdir, readFile, writeFile } from "node:fs/promises"

const coreModules = ["crypto", "identity", "shared"]
const jsonExports = [
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading