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
32 changes: 24 additions & 8 deletions .github/workflows/private-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
required: false
default: false
type: boolean
tag:
description: "NPM tag for release (e.g., beta, alpha, rc)"
required: false
default: "beta"
type: string

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand All @@ -26,6 +31,19 @@ jobs:
with:
ref: ${{ inputs.branch }}

- name: Check for changes to release
id: check-changes
run: |
CHANGESET_COUNT=$(find .changeset -type f -name '*.md' ! -name 'README.md' | wc -l)
if [ "$CHANGESET_COUNT" -eq 0 ]; then
echo "No changesets found. Nothing to release."
echo "has-changes=false" >> $GITHUB_OUTPUT
exit 1
else
echo "Found $CHANGESET_COUNT changeset(s) to release."
echo "has-changes=true" >> $GITHUB_OUTPUT
fi

- name: Create beta branch
id: create-branch
run: |
Expand All @@ -43,8 +61,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Create beta version
run: npm run version:private
- name: Create snapshot version
if: ${{ steps.check-changes.has-changes == true }}
run: npm run version:private -- ${{ inputs.tag }}

- name: Run tests
if: ${{ inputs.skip_tests == false }}
Expand All @@ -53,12 +72,9 @@ jobs:
- name: build
run: npm run build

- name: Publish
uses: changesets/action@v1
with:
version: npm run version:private
publish: npm run release:private
createGithubReleases: false
- name: Publish to npm
if: ${{ steps.check-changes.has-changes == true }}
run: npm run publish:private -- ${{ inputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 7 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"changeset": "changeset",
"version": "changeset version",
"version:private": "changeset version --snapshot beta",
"version:private": "changeset version --snapshot",
"release": "changeset publish",
"release:private": "changeset publish --tag beta"
"release:private": "changeset publish --tag"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/captcha-nodejs/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ type CaptchaPluginErrorType = "CAPTCHA_VERIFICATION_ERROR" | "PLUGIN_CONFIG_ERRO

export class CaptchaPluginError extends Error {
constructor(public type: CaptchaPluginErrorType, message: string) {
super(message)
super(message);
}
}
13 changes: 5 additions & 8 deletions packages/opentelemetry-nodejs/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { HttpRequest, SuperTokensPlugin, UserContext } from "supertokens-node/types";
import { SuperTokensPlugin } from "supertokens-node/types";
import { PLUGIN_ID, PLUGIN_SDK_VERSION, validatePluginConfig } from "./config";
import { OpenTelemetryLoggerPluginConfig } from "./types";
import { Tracer } from "@opentelemetry/api";
import { createPluginInitFunction } from "@shared/js";
import { PluginImpl } from "./pluginImpl";

// import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';
// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);

export const init = createPluginInitFunction<
SuperTokensPlugin,
OpenTelemetryLoggerPluginConfig,
Expand Down Expand Up @@ -243,7 +240,7 @@ export const init = createPluginInitFunction<
};
},
(config) => new PluginImpl(config),
(config: OpenTelemetryLoggerPluginConfig | undefined) => config ?? {},
(config: OpenTelemetryLoggerPluginConfig | undefined) => config ?? {}
);

function overrideWithLogger<T extends Record<string, undefined |((...args: any[]) => any)>>(logConfig: {
Expand Down Expand Up @@ -278,7 +275,7 @@ function fnWithLoggerAsync<T extends(...args: any[]) => Promise<any>>(
pluginConfig: OpenTelemetryLoggerPluginConfig;
tracer: Tracer;
pluginImpl: PluginImpl;
},
}
): T {
return function (...args: Parameters<T>): Promise<ReturnType<T>> {
return logConfig.pluginImpl.startActiveSpan(
Expand All @@ -300,14 +297,14 @@ function fnWithLoggerAsync<T extends(...args: any[]) => Promise<any>>(
const resultAttributes = logConfig.pluginImpl.transformResultToAttributes(result);
span.setAttributes(resultAttributes);
return result;
} catch (error: any) {
} catch (error) {
const errorAttributes = logConfig.pluginImpl.transformErrorToAttributes(error);
span.setAttributes(errorAttributes);
throw error;
} finally {
span.end();
}
},
}
);
} as T;
}
Loading