Skip to content

Commit

Permalink
feat: 🎸 readay for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
hcfw007 committed Dec 5, 2024
1 parent fad9b8e commit becd8d2
Show file tree
Hide file tree
Showing 60 changed files with 1,464 additions and 24 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: NPM

on: [push, pull_request]

jobs:
publish:
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v'))
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 22
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: package.json

- name: Install Dependencies
run: npm install

# - name: Set up TS
# run: npm install typescript@4.7.3

- name: Generate Package JSON
run: ./scripts/generate-package-json.sh

- name: Set Publish Config
run: ./scripts/package-publish-config-tag.sh

- name: Build Dist
run: npm run dist

- name: Check Branch
id: check-branch
run: |
if [[ ${{ github.ref }} =~ ^refs/heads/(main|v[0-9]+\.[0-9]+.*)$ ]]; then
echo ::set-output name=match::true
fi # See: https://stackoverflow.com/a/58869470/1123955
- name: Is A Publish Branch
if: steps.check-branch.outputs.match == 'true'
run: |
NAME=$(npx pkg-jq -r .name)
VERSION=$(npx pkg-jq -r .version)
if npx version-exists "$NAME" "$VERSION"
then echo "$NAME@$VERSION exists on NPM, skipped."
else npm publish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.JUZI_ADMIN_SCOPE_NPM_TOKEN }}
- name: Is Not A Publish Branch
if: steps.check-branch.outputs.match != 'true'
run: echo 'Not A Publish Branch'
6 changes: 6 additions & 0 deletions dist/cjs/mod.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { PuppetRabbit, PuppetRabbitOptions } from './puppet.js';
import { log } from '@juzi/wechaty-puppet';
export { log, PuppetRabbit };
export type { PuppetRabbitOptions };
export default PuppetRabbit;
//# sourceMappingURL=mod.d.ts.map
1 change: 1 addition & 0 deletions dist/cjs/mod.d.ts.map

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

9 changes: 9 additions & 0 deletions dist/cjs/mod.js

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

1 change: 1 addition & 0 deletions dist/cjs/mod.js.map

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

42 changes: 42 additions & 0 deletions dist/cjs/model/mq.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export interface MqSendMessage {
traceId?: string;
commandType: MqCommandType;
data: string;
}
export interface MqReceiveMessage {
traceId: string;
type: MqMessageType;
eventType?: MqEventType;
data: string;
code?: number;
error?: string;
}
export declare enum MqMessageType {
command = "command",
event = "event"
}
export declare enum MqCommandType {
start = "start",
ding = "ding",
contactPayload = "contactPayload",
postSearch = "postSearch",
postPayload = "postPayload",
postPayloadSayable = "postPayloadSayable",
postPublish = "postPublish",
dirtyPayload = "dirtyPayload"
}
export declare enum MqEventType {
dong = "dong",
login = "login",
loginUrl = "loginUrl",
postComment = "postComment",
dirty = "dirty",
logout = "logout"
}
export interface MqCommandResponseWaiter {
resolver: (data: any) => void;
rejector: (e: Error) => void;
traceId: string;
timer: NodeJS.Timeout;
}
//# sourceMappingURL=mq.d.ts.map
1 change: 1 addition & 0 deletions dist/cjs/model/mq.d.ts.map

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

29 changes: 29 additions & 0 deletions dist/cjs/model/mq.js

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

1 change: 1 addition & 0 deletions dist/cjs/model/mq.js.map

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

4 changes: 4 additions & 0 deletions dist/cjs/mq/config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export declare const getTokenQueueName: (token: string) => string;
export declare const ClientExchangeName = "tiktok.message.to.client";
export declare const ServerExchangeName = "tiktok.message.to.server";
//# sourceMappingURL=config.d.ts.map
1 change: 1 addition & 0 deletions dist/cjs/mq/config.d.ts.map

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

8 changes: 8 additions & 0 deletions dist/cjs/mq/config.js

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

1 change: 1 addition & 0 deletions dist/cjs/mq/config.js.map

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

29 changes: 29 additions & 0 deletions dist/cjs/mq/mq-manager.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { MqSendMessage } from '../model/mq.js';
import EventEmitter from 'events';
export declare class MqManager extends EventEmitter {
private static _instance;
static get Instance(): MqManager;
private puppetConnection;
private puppetChannel;
private connected;
private restartingConnection;
private restartingChannel;
private token;
private static MqCommandResponsePool;
private static consumption;
init(token?: string, mqUri?: string): Promise<void>;
private initConnect;
private initChannel;
private prepareConnectListener;
private createChannelService;
private prepareChannelListener;
private reconnectMainConnect;
reconnectChannel(): Promise<void>;
startConsume(): Promise<void>;
stopConsume(): Promise<void>;
private startConsumer;
sendToServer(message: MqSendMessage): Promise<any>;
private handleEvent;
private prepareQueue;
}
//# sourceMappingURL=mq-manager.d.ts.map
1 change: 1 addition & 0 deletions dist/cjs/mq/mq-manager.d.ts.map

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

Loading

0 comments on commit becd8d2

Please sign in to comment.