@barndoor-ai/sdk 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +7 -7
  2. package/{src/auth/index.ts → dist/auth/index.d.ts} +2 -17
  3. package/dist/auth/index.d.ts.map +1 -0
  4. package/dist/auth/pkce.d.ts +92 -0
  5. package/dist/auth/pkce.d.ts.map +1 -0
  6. package/dist/auth/store.d.ts +145 -0
  7. package/dist/auth/store.d.ts.map +1 -0
  8. package/dist/client.d.ts +164 -0
  9. package/dist/client.d.ts.map +1 -0
  10. package/dist/config.d.ts +144 -0
  11. package/dist/config.d.ts.map +1 -0
  12. package/dist/exceptions/index.d.ts +119 -0
  13. package/dist/exceptions/index.d.ts.map +1 -0
  14. package/dist/http/client.d.ts +82 -0
  15. package/dist/http/client.d.ts.map +1 -0
  16. package/dist/index.d.ts +39 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.esm.js +2 -0
  19. package/dist/index.js +2 -0
  20. package/dist/logging.d.ts +48 -0
  21. package/dist/logging.d.ts.map +1 -0
  22. package/dist/models/index.d.ts +116 -0
  23. package/dist/models/index.d.ts.map +1 -0
  24. package/dist/quickstart.d.ts +91 -0
  25. package/dist/quickstart.d.ts.map +1 -0
  26. package/dist/version.d.ts +17 -0
  27. package/dist/version.d.ts.map +1 -0
  28. package/package.json +8 -2
  29. package/.eslintignore +0 -8
  30. package/.eslintrc.cjs +0 -102
  31. package/.github/CODEOWNERS +0 -4
  32. package/.github/workflows/ci.yml +0 -57
  33. package/.prettierignore +0 -6
  34. package/.prettierrc +0 -13
  35. package/RELEASE.md +0 -203
  36. package/examples/README.md +0 -92
  37. package/examples/basic-mcp-client.js +0 -134
  38. package/examples/openai-integration.js +0 -137
  39. package/jest.config.js +0 -16
  40. package/openapi.yaml +0 -681
  41. package/rollup.config.js +0 -63
  42. package/scripts/dump-core-files.js +0 -161
  43. package/scripts/dump-typescript-only.js +0 -150
  44. package/src/auth/pkce.ts +0 -346
  45. package/src/auth/store.ts +0 -809
  46. package/src/client.ts +0 -512
  47. package/src/config.ts +0 -402
  48. package/src/exceptions/index.ts +0 -205
  49. package/src/http/client.ts +0 -272
  50. package/src/index.ts +0 -92
  51. package/src/logging.ts +0 -111
  52. package/src/models/index.ts +0 -156
  53. package/src/quickstart.ts +0 -358
  54. package/src/version.ts +0 -41
  55. package/test/client.test.js +0 -381
  56. package/test/config.test.js +0 -202
  57. package/test/exceptions.test.js +0 -142
  58. package/test/integration.test.js +0 -147
  59. package/test/models.test.js +0 -177
  60. package/test/token-management.test.js +0 -81
  61. package/test/token-validation.test.js +0 -104
  62. package/tsconfig.json +0 -61
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Unified logging system for the Barndoor SDK.
3
+ *
4
+ * This module provides a centralized logging interface that can be configured
5
+ * by SDK consumers to integrate with their preferred logging systems.
6
+ */
7
+ /**
8
+ * Logger interface for SDK consumers to plug their own logger.
9
+ */
10
+ export interface Logger {
11
+ debug(message: string, ...args: unknown[]): void;
12
+ info(message: string, ...args: unknown[]): void;
13
+ warn(message: string, ...args: unknown[]): void;
14
+ error(message: string, ...args: unknown[]): void;
15
+ }
16
+ /**
17
+ * Set a custom logger for the entire SDK.
18
+ * @param logger - Custom logger implementation
19
+ */
20
+ export declare function setLogger(logger: Logger): void;
21
+ /**
22
+ * Get the current logger instance.
23
+ * @returns Current logger
24
+ */
25
+ export declare function getLogger(): Logger;
26
+ /**
27
+ * Create a scoped logger with a prefix for better organization.
28
+ * @param scope - Scope name (e.g., 'client', 'auth', 'http')
29
+ * @returns Scoped logger
30
+ */
31
+ export declare function createScopedLogger(scope: string): Logger;
32
+ /**
33
+ * Convenience function to log debug messages.
34
+ */
35
+ export declare function debug(message: string, ...args: unknown[]): void;
36
+ /**
37
+ * Convenience function to log info messages.
38
+ */
39
+ export declare function info(message: string, ...args: unknown[]): void;
40
+ /**
41
+ * Convenience function to log warning messages.
42
+ */
43
+ export declare function warn(message: string, ...args: unknown[]): void;
44
+ /**
45
+ * Convenience function to log error messages.
46
+ */
47
+ export declare function error(message: string, ...args: unknown[]): void;
48
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAClD;AA+BD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAexD;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE/D;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE9D;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE9D;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE/D"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Data models for the Barndoor SDK.
3
+ *
4
+ * This module defines the data models used for API requests and responses,
5
+ * providing type safety and validation that mirrors the Python SDK's Pydantic models.
6
+ */
7
+ /**
8
+ * Connection status for MCP servers.
9
+ */
10
+ export type ConnectionStatus = 'available' | 'pending' | 'connected';
11
+ /**
12
+ * Raw server data from API responses.
13
+ */
14
+ export interface ServerSummaryData {
15
+ /** Unique identifier (UUID) for the server */
16
+ id: string;
17
+ /** Human-readable name of the server */
18
+ name: string;
19
+ /** URL-friendly identifier used in API paths */
20
+ slug: string;
21
+ /** Third-party provider name (e.g., "github", "slack") */
22
+ provider?: string | null;
23
+ /** Current connection status */
24
+ connection_status: ConnectionStatus;
25
+ }
26
+ /**
27
+ * Summary information about an MCP server.
28
+ *
29
+ * Represents basic server information as returned by the list servers
30
+ * endpoint. This is a lightweight representation suitable for listing
31
+ * many servers at once.
32
+ */
33
+ export declare class ServerSummary {
34
+ /** Unique identifier (UUID) for the server */
35
+ readonly id: string;
36
+ /** Human-readable name of the server */
37
+ readonly name: string;
38
+ /** URL-friendly identifier used in API paths */
39
+ readonly slug: string;
40
+ /** Third-party provider name (e.g., "github", "slack") */
41
+ readonly provider: string | null;
42
+ /** Current connection status */
43
+ readonly connection_status: ConnectionStatus;
44
+ /**
45
+ * Create a new ServerSummary instance.
46
+ * @param data - Server data from API response
47
+ */
48
+ constructor(data: ServerSummaryData);
49
+ /**
50
+ * Create a ServerSummary from API response data.
51
+ * @param data - Raw API response data
52
+ * @returns ServerSummary instance
53
+ */
54
+ static fromApiResponse(data: unknown): ServerSummary;
55
+ }
56
+ /**
57
+ * Raw server detail data from API responses.
58
+ */
59
+ export interface ServerDetailData extends ServerSummaryData {
60
+ /** MCP base URL from the server directory */
61
+ url?: string | null;
62
+ }
63
+ /**
64
+ * Detailed information about an MCP server.
65
+ *
66
+ * Extends ServerSummary with additional fields returned when fetching
67
+ * a single server's details.
68
+ */
69
+ export declare class ServerDetail extends ServerSummary {
70
+ /** MCP base URL from the server directory */
71
+ readonly url: string | null;
72
+ /**
73
+ * Create a new ServerDetail instance.
74
+ * @param data - Server data from API response
75
+ */
76
+ constructor(data: ServerDetailData);
77
+ /**
78
+ * Create a ServerDetail from API response data.
79
+ * @param data - Raw API response data
80
+ * @returns ServerDetail instance
81
+ */
82
+ static fromApiResponse(data: unknown): ServerDetail;
83
+ }
84
+ /**
85
+ * Raw agent token data from API responses.
86
+ */
87
+ export interface AgentTokenData {
88
+ /** The agent access token to use for agent operations */
89
+ agent_token: string;
90
+ /** Token lifetime in seconds */
91
+ expires_in: number;
92
+ }
93
+ /**
94
+ * Response from the agent token exchange endpoint.
95
+ *
96
+ * Contains the agent access token and expiration information returned
97
+ * when exchanging client credentials.
98
+ */
99
+ export declare class AgentToken {
100
+ /** The agent access token to use for agent operations */
101
+ readonly agent_token: string;
102
+ /** Token lifetime in seconds */
103
+ readonly expires_in: number;
104
+ /**
105
+ * Create a new AgentToken instance.
106
+ * @param data - Token data from API response
107
+ */
108
+ constructor(data: AgentTokenData);
109
+ /**
110
+ * Create an AgentToken from API response data.
111
+ * @param data - Raw API response data
112
+ * @returns AgentToken instance
113
+ */
114
+ static fromApiResponse(data: unknown): AgentToken;
115
+ }
116
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D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,OAAO,GAAG,UAAU;CAGzD"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Quick-start helpers for the Barndoor SDK.
3
+ *
4
+ * This module provides convenience functions that remove boilerplate code
5
+ * commonly needed in examples and prototypes, mirroring the Python SDK's
6
+ * quickstart.py functionality.
7
+ */
8
+ import { BarndoorSDK } from './client';
9
+ import { Client as McpClient } from '@modelcontextprotocol/sdk/client/index.js';
10
+ /**
11
+ * Perform interactive login and return an initialized SDK instance.
12
+ *
13
+ * Opens the system browser for OAuth authentication, waits for the
14
+ * user to complete login, exchanges the authorization code for a JWT,
15
+ * and returns a configured BarndoorSDK instance ready for use.
16
+ *
17
+ * @param {Object} [options={}] - Login options
18
+ * @param {string} [options.authDomain] - Auth0 domain
19
+ * @param {string} [options.clientId] - OAuth client ID
20
+ * @param {string} [options.clientSecret] - OAuth client secret
21
+ * @param {string} [options.audience] - API audience identifier
22
+ * @param {string} [options.apiBaseUrl] - Base URL of the Barndoor API
23
+ * @param {number} [options.port=52765] - Local port for OAuth callback
24
+ * @returns {Promise<BarndoorSDK>} Initialized SDK instance
25
+ */
26
+ /**
27
+ * Login options interface.
28
+ */
29
+ export interface LoginInteractiveOptions {
30
+ /** Auth0 domain */
31
+ authDomain?: string;
32
+ /** OAuth client ID */
33
+ clientId?: string;
34
+ /** OAuth client secret */
35
+ clientSecret?: string;
36
+ /** API audience identifier */
37
+ audience?: string;
38
+ /** Base URL of the Barndoor API */
39
+ apiBaseUrl?: string;
40
+ /** Local port for OAuth callback */
41
+ port?: number;
42
+ }
43
+ export declare function loginInteractive(options?: LoginInteractiveOptions): Promise<BarndoorSDK>;
44
+ /**
45
+ * Ensure a server is connected, with user-friendly logging.
46
+ *
47
+ * This is a convenience wrapper around sdk.ensureServerConnected() that adds
48
+ * helpful console output for interactive use. The actual connection logic
49
+ * is handled by the SDK method to avoid code duplication.
50
+ *
51
+ * @param {BarndoorSDK} sdk - SDK instance
52
+ * @param {string} serverIdentifier - Server slug or provider name
53
+ * @param {Object} [options={}] - Options
54
+ * @param {number} [options.timeout=90] - Maximum seconds to wait
55
+ */
56
+ export declare function ensureServerConnected(sdk: BarndoorSDK, serverIdentifier: string, options?: {
57
+ timeout?: number;
58
+ }): Promise<void>;
59
+ /**
60
+ * Create MCP connection parameters for a server.
61
+ *
62
+ * Returns connection parameters that can be used with any MCP client
63
+ * framework (CrewAI, LangChain, custom implementations).
64
+ *
65
+ * @param {BarndoorSDK} sdk - SDK instance
66
+ * @param {string} serverSlug - Server slug
67
+ * @param {Object} [options={}] - Options
68
+ * @param {string} [options.proxyBaseUrl='http://proxy-ingress:8080'] - Proxy base URL
69
+ * @param {string} [options.transport='streamable-http'] - Transport type
70
+ * @returns {Promise<[Object, string]>} [params, publicUrl]
71
+ */
72
+ export declare function makeMcpConnectionParams(sdk: BarndoorSDK, serverSlug: string, options?: {
73
+ proxyBaseUrl?: string;
74
+ transport?: string;
75
+ }): Promise<[unknown, string]>;
76
+ /**
77
+ * Create and connect an MCP client for the specified server.
78
+ *
79
+ * This helper uses the official `@modelcontextprotocol/sdk` package so callers
80
+ * don’t need to hand-craft JSON-RPC envelopes or manage transports manually.
81
+ *
82
+ * @param {BarndoorSDK} sdk – An initialized Barndoor SDK instance (must contain a valid JWT in `sdk.token`).
83
+ * @param {string} serverSlug – The server slug (e.g. "salesforce", "notion").
84
+ * @param {Object} [options] – Optional overrides passed to `makeMcpConnectionParams` (proxyBaseUrl, transport).
85
+ * @returns {Promise<McpClient>} A connected MCP client ready for `listTools`, `callTool`, etc.
86
+ */
87
+ export declare function makeMcpClient(sdk: BarndoorSDK, serverSlug: string, options?: {
88
+ proxyBaseUrl?: string;
89
+ transport?: string;
90
+ }): Promise<McpClient>;
91
+ //# sourceMappingURL=quickstart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quickstart.d.ts","sourceRoot":"","sources":["../src/quickstart.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,UA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
1
+ /**
2
+ * Version management for the Barndoor SDK.
3
+ *
4
+ * This module provides a unified way to access the SDK version,
5
+ * reading directly from package.json to avoid duplication.
6
+ */
7
+ /**
8
+ * Get the SDK version from package.json.
9
+ * @returns The current SDK version
10
+ */
11
+ export declare function getVersion(): string;
12
+ /**
13
+ * SDK version constant for backward compatibility.
14
+ * This is dynamically resolved at runtime.
15
+ */
16
+ export declare const version: string;
17
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAmBnC;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,QAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barndoor-ai/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "TypeScript/JavaScript client for the Barndoor Platform API",
5
5
  "author": "Barndoor AI, Inc. (https://barndoor.ai)",
6
6
  "homepage": "https://barndoor.ai",
@@ -29,6 +29,11 @@
29
29
  "types": "./dist/index.d.ts"
30
30
  }
31
31
  },
32
+ "files": [
33
+ "dist/**/*",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
32
37
  "scripts": {
33
38
  "build": "npm run build:types && rollup -c",
34
39
  "build:types": "node node_modules/typescript/lib/tsc.js --emitDeclarationOnly",
@@ -43,7 +48,8 @@
43
48
  "type-check": "node node_modules/typescript/lib/tsc.js --noEmit",
44
49
  "type-coverage": "type-coverage --at-least 60 --strict",
45
50
  "dump-all": "node scripts/dump-core-files.js",
46
- "dump-typescript": "node scripts/dump-typescript-only.js"
51
+ "dump-typescript": "node scripts/dump-typescript-only.js",
52
+ "prepublishOnly": "npm run build"
47
53
  },
48
54
  "dependencies": {
49
55
  "@modelcontextprotocol/sdk": "^1.17.0",
package/.eslintignore DELETED
@@ -1,8 +0,0 @@
1
- node_modules/
2
- dist/
3
- coverage/
4
-
5
- # Skip JS test and example files from TypeScript-typed linting for now
6
- test/**
7
- examples/**
8
-
package/.eslintrc.cjs DELETED
@@ -1,102 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parser: '@typescript-eslint/parser',
4
- plugins: [
5
- '@typescript-eslint',
6
- 'prettier'
7
- ],
8
- extends: [
9
- 'eslint:recommended',
10
- 'plugin:@typescript-eslint/recommended',
11
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
12
- 'prettier'
13
- ],
14
- parserOptions: {
15
- ecmaVersion: 2020,
16
- sourceType: 'module',
17
- project: './tsconfig.json',
18
- tsconfigRootDir: __dirname,
19
- },
20
- env: {
21
- node: true,
22
- es2020: true,
23
- jest: true
24
- },
25
- rules: {
26
- // Prettier integration
27
- 'prettier/prettier': 'error',
28
-
29
- // TypeScript specific rules (relaxed to reduce CI friction)
30
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
31
- '@typescript-eslint/explicit-function-return-type': 'off',
32
- '@typescript-eslint/explicit-module-boundary-types': 'off',
33
- '@typescript-eslint/no-explicit-any': 'warn',
34
- '@typescript-eslint/no-non-null-assertion': 'warn',
35
- '@typescript-eslint/prefer-nullish-coalescing': 'off',
36
- '@typescript-eslint/prefer-optional-chain': 'off',
37
- '@typescript-eslint/strict-boolean-expressions': 'off',
38
- '@typescript-eslint/no-floating-promises': 'warn',
39
- '@typescript-eslint/await-thenable': 'warn',
40
- '@typescript-eslint/no-misused-promises': 'warn',
41
- '@typescript-eslint/require-await': 'off',
42
- '@typescript-eslint/no-unsafe-assignment': 'off',
43
- '@typescript-eslint/no-unsafe-member-access': 'off',
44
- '@typescript-eslint/no-unsafe-return': 'off',
45
- '@typescript-eslint/no-unsafe-argument': 'off',
46
- '@typescript-eslint/no-unsafe-call': 'off',
47
- '@typescript-eslint/no-unnecessary-type-assertion': 'off',
48
- '@typescript-eslint/restrict-template-expressions': 'off',
49
-
50
- // General rules
51
- 'no-console': 'warn',
52
- 'prefer-const': 'error',
53
- 'no-var': 'error',
54
- 'object-shorthand': 'error',
55
- 'prefer-template': 'warn'
56
- },
57
- overrides: [
58
- {
59
- files: ['**/*.test.ts', '**/*.spec.ts'],
60
- rules: {
61
- '@typescript-eslint/no-explicit-any': 'off',
62
- 'no-console': 'off'
63
- }
64
- },
65
- {
66
- files: ['test/**/*.js', 'examples/**/*.js'],
67
- parser: 'espree',
68
- parserOptions: {
69
- ecmaVersion: 2020,
70
- sourceType: 'module'
71
- },
72
- env: {
73
- node: true,
74
- jest: true,
75
- es2020: true
76
- },
77
- rules: {
78
- // JS files should not use TS type-aware rules
79
- '@typescript-eslint/await-thenable': 'off',
80
- '@typescript-eslint/no-floating-promises': 'off',
81
- '@typescript-eslint/no-misused-promises': 'off',
82
- '@typescript-eslint/require-await': 'off',
83
- '@typescript-eslint/strict-boolean-expressions': 'off',
84
- '@typescript-eslint/no-unsafe-assignment': 'off',
85
- '@typescript-eslint/no-unsafe-member-access': 'off',
86
- '@typescript-eslint/no-unsafe-return': 'off',
87
- '@typescript-eslint/no-unsafe-argument': 'off',
88
- '@typescript-eslint/restrict-template-expressions': 'off',
89
- '@typescript-eslint/explicit-function-return-type': 'off',
90
- '@typescript-eslint/explicit-module-boundary-types': 'off',
91
- '@typescript-eslint/no-explicit-any': 'off'
92
- }
93
- },
94
- {
95
- files: ['examples/**/*.ts'],
96
- rules: {
97
- 'no-console': 'off'
98
- }
99
- }
100
- ]
101
- };
102
-
@@ -1,4 +0,0 @@
1
- # Barndoor Typescript SDK owners
2
-
3
- # Default owners
4
- * @barndoor-ai/barndoor-engineering
@@ -1,57 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- release:
9
- types: [published]
10
-
11
- concurrency:
12
- group: ${{ github.workflow }}-${{ github.ref }}
13
- cancel-in-progress: true
14
-
15
- jobs:
16
- build:
17
- name: Build and test
18
- runs-on: ubuntu-latest
19
-
20
- steps:
21
- - uses: actions/checkout@v4
22
- - uses: actions/setup-node@v4
23
- with:
24
- node-version: 22
25
- cache: npm
26
-
27
- - run: npm ci
28
- - run: npm run build
29
- - run: npm test
30
- - run: npm run lint
31
- - run: npm run type-check
32
-
33
- publish:
34
- name: Publish
35
- runs-on: ubuntu-latest
36
- if: github.event_name == 'release'
37
- environment: release
38
- needs: build
39
-
40
- permissions:
41
- contents: read
42
- id-token: write
43
-
44
- steps:
45
- - uses: actions/checkout@v4
46
- - uses: actions/setup-node@v4
47
- with:
48
- node-version: 22
49
- cache: npm
50
- registry-url: 'https://registry.npmjs.org'
51
-
52
- - run: npm ci
53
-
54
- - run: npm publish --provenance --access public
55
- env:
56
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57
-
package/.prettierignore DELETED
@@ -1,6 +0,0 @@
1
- node_modules
2
- dist
3
- coverage
4
- *.md
5
- package-lock.json
6
- .eslintrc.js
package/.prettierrc DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "semi": true,
3
- "trailingComma": "es5",
4
- "singleQuote": true,
5
- "printWidth": 100,
6
- "tabWidth": 2,
7
- "useTabs": false,
8
- "bracketSpacing": true,
9
- "bracketSameLine": false,
10
- "arrowParens": "avoid",
11
- "endOfLine": "lf",
12
- "quoteProps": "as-needed"
13
- }