@stonyx/events 0.1.0 → 0.1.1-alpha.1

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.
@@ -7,18 +7,30 @@ on:
7
7
  - main
8
8
 
9
9
  concurrency:
10
- group: ${{ github.head_ref }}
10
+ group: ci-${{ github.head_ref || github.ref }}
11
11
  cancel-in-progress: true
12
12
 
13
13
  jobs:
14
14
  test:
15
15
  runs-on: ubuntu-latest
16
+
16
17
  steps:
17
- - uses: actions/checkout@v4
18
- - uses: pnpm/action-setup@v4
19
- - uses: actions/setup-node@v4
18
+ - name: Checkout code
19
+ uses: actions/checkout@v3
20
+
21
+ - name: Setup pnpm
22
+ uses: pnpm/action-setup@v4
23
+ with:
24
+ version: 9
25
+
26
+ - name: Set up Node.js
27
+ uses: actions/setup-node@v3
20
28
  with:
21
- node-version: '24.13.0'
29
+ node-version: 24.13.0
22
30
  cache: 'pnpm'
23
- - run: pnpm install --frozen-lockfile
24
- - run: pnpm test
31
+
32
+ - name: Install dependencies
33
+ run: pnpm install --frozen-lockfile
34
+
35
+ - name: Run tests
36
+ run: pnpm test
@@ -1,6 +1,7 @@
1
1
  name: Publish to NPM
2
2
 
3
3
  on:
4
+ # Manual trigger (kept for flexibility)
4
5
  workflow_dispatch:
5
6
  inputs:
6
7
  version-type:
@@ -17,9 +18,19 @@ on:
17
18
  required: false
18
19
  type: string
19
20
 
21
+ # Auto-publish alpha on PR
22
+ pull_request:
23
+ types: [opened, synchronize, reopened]
24
+ branches: [main, dev]
25
+
26
+ # Auto-publish stable on merge to main
27
+ push:
28
+ branches: [main]
29
+
20
30
  permissions:
21
31
  contents: write
22
32
  id-token: write # Required for npm provenance
33
+ pull-requests: write # For PR comments
23
34
 
24
35
  jobs:
25
36
  publish:
@@ -30,6 +41,8 @@ jobs:
30
41
  uses: actions/checkout@v3
31
42
  with:
32
43
  fetch-depth: 0
44
+ # For PR events, check out the PR branch
45
+ ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
33
46
 
34
47
  - name: Setup pnpm
35
48
  uses: pnpm/action-setup@v4
@@ -54,29 +67,49 @@ jobs:
54
67
  git config user.name "github-actions[bot]"
55
68
  git config user.email "github-actions[bot]@users.noreply.github.com"
56
69
 
70
+ # Determine version type based on trigger
71
+ - name: Determine version bump type
72
+ id: version-type
73
+ run: |
74
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
75
+ echo "type=alpha" >> $GITHUB_OUTPUT
76
+ elif [ "${{ github.event_name }}" = "push" ]; then
77
+ echo "type=patch" >> $GITHUB_OUTPUT
78
+ elif [ "${{ github.event.inputs.custom-version }}" != "" ]; then
79
+ echo "type=custom" >> $GITHUB_OUTPUT
80
+ else
81
+ echo "type=${{ github.event.inputs.version-type }}" >> $GITHUB_OUTPUT
82
+ fi
83
+
84
+ # Version bumping
57
85
  - name: Bump version (custom)
58
- if: ${{ github.event.inputs.custom-version != '' }}
59
- run: npm version ${{ github.event.inputs.custom-version }} --no-git-tag-version
86
+ if: steps.version-type.outputs.type == 'custom'
87
+ run: pnpm version ${{ github.event.inputs.custom-version }} --no-git-tag-version
60
88
 
61
- - name: Bump version (prerelease alpha)
62
- if: ${{ github.event.inputs.version-type == 'alpha' && github.event.inputs.custom-version == '' }}
63
- run: npm version prerelease --preid=alpha --no-git-tag-version
89
+ - name: Bump version (alpha)
90
+ if: steps.version-type.outputs.type == 'alpha'
91
+ run: pnpm version prerelease --preid=alpha --no-git-tag-version
64
92
 
65
- - name: Bump version (standard)
66
- if: ${{ github.event.inputs.version-type != 'alpha' && github.event.inputs.custom-version == '' }}
67
- run: npm version ${{ github.event.inputs.version-type }} --no-git-tag-version
93
+ - name: Bump version (patch/minor/major)
94
+ if: steps.version-type.outputs.type == 'patch' || steps.version-type.outputs.type == 'minor' || steps.version-type.outputs.type == 'major'
95
+ run: pnpm version ${{ steps.version-type.outputs.type }} --no-git-tag-version
68
96
 
69
97
  - name: Get package version
70
98
  id: package-version
71
99
  run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
72
100
 
101
+ # Publishing
73
102
  - name: Publish to NPM (alpha)
74
- if: ${{ github.event.inputs.version-type == 'alpha' || contains(steps.package-version.outputs.version, 'alpha') }}
75
- run: npm publish --tag alpha --access public
103
+ if: contains(steps.package-version.outputs.version, 'alpha')
104
+ run: pnpm publish --tag alpha --access public --no-git-checks
105
+
76
106
  - name: Publish to NPM (stable)
77
- if: ${{ github.event.inputs.version-type != 'alpha' && !contains(steps.package-version.outputs.version, 'alpha') }}
78
- run: npm publish --access public
79
- - name: Commit version bump
107
+ if: "!contains(steps.package-version.outputs.version, 'alpha')"
108
+ run: pnpm publish --access public
109
+
110
+ # Only commit and tag for stable releases (push to main or manual stable)
111
+ - name: Commit version bump and create tag
112
+ if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !contains(steps.package-version.outputs.version, 'alpha'))
80
113
  run: |
81
114
  git add package.json
82
115
  git commit -m "chore: release v${{ steps.package-version.outputs.version }}"
@@ -84,6 +117,7 @@ jobs:
84
117
  git push origin main --tags
85
118
 
86
119
  - name: Create GitHub Release
120
+ if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !contains(steps.package-version.outputs.version, 'alpha'))
87
121
  uses: actions/create-release@v1
88
122
  env:
89
123
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -91,4 +125,19 @@ jobs:
91
125
  tag_name: v${{ steps.package-version.outputs.version }}
92
126
  release_name: v${{ steps.package-version.outputs.version }}
93
127
  draft: false
94
- prerelease: ${{ contains(steps.package-version.outputs.version, 'alpha') }}
128
+ prerelease: false
129
+
130
+ # Add PR comment with alpha version info
131
+ - name: Comment on PR with alpha version
132
+ if: github.event_name == 'pull_request'
133
+ uses: actions/github-script@v6
134
+ with:
135
+ script: |
136
+ const version = '${{ steps.package-version.outputs.version }}';
137
+ const packageName = require('./package.json').name;
138
+ github.rest.issues.createComment({
139
+ issue_number: context.issue.number,
140
+ owner: context.repo.owner,
141
+ repo: context.repo.repo,
142
+ body: `## 🚀 Alpha Version Published\n\n**Version:** \`${version}\`\n\n**Install:**\n\`\`\`bash\npnpm add ${packageName}@${version}\n# or\npnpm add ${packageName}@alpha # latest alpha\n\`\`\`\n\nThis alpha version is now available for testing!`
143
+ });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "keywords": [
4
4
  "stonyx-module"
5
5
  ],
6
- "version": "0.1.0",
6
+ "version": "0.1.1-alpha.1",
7
7
  "description": "Lightweight pub/sub event system for the Stonyx framework",
8
8
  "main": "src/main.js",
9
9
  "type": "module",
@@ -14,7 +14,8 @@
14
14
  ".": "./src/main.js"
15
15
  },
16
16
  "publishConfig": {
17
- "access": "public"
17
+ "access": "public",
18
+ "provenance": true
18
19
  },
19
20
  "repository": {
20
21
  "type": "git",
@@ -30,14 +31,12 @@
30
31
  },
31
32
  "homepage": "https://github.com/abofs/stonyx-events#readme",
32
33
  "devDependencies": {
33
- "@stonyx/utils": "file:../stonyx-utils",
34
+ "@stonyx/utils": "^0.2.2",
34
35
  "qunit": "^2.24.1",
35
36
  "sinon": "^21.0.0"
36
37
  },
37
- "dependencies": {
38
- "stonyx": "file:../stonyx"
39
- },
38
+ "dependencies": {},
40
39
  "scripts": {
41
- "test": "qunit --require ./stonyx-bootstrap.cjs"
40
+ "test": "qunit"
42
41
  }
43
42
  }
package/pnpm-lock.yaml ADDED
@@ -0,0 +1,134 @@
1
+ lockfileVersion: '9.0'
2
+
3
+ settings:
4
+ autoInstallPeers: true
5
+ excludeLinksFromLockfile: false
6
+
7
+ importers:
8
+
9
+ .:
10
+ devDependencies:
11
+ '@stonyx/utils':
12
+ specifier: ^0.2.2
13
+ version: 0.2.2
14
+ qunit:
15
+ specifier: ^2.24.1
16
+ version: 2.25.0
17
+ sinon:
18
+ specifier: ^21.0.0
19
+ version: 21.0.1
20
+
21
+ packages:
22
+
23
+ '@sinonjs/commons@3.0.1':
24
+ resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==}
25
+
26
+ '@sinonjs/fake-timers@15.1.0':
27
+ resolution: {integrity: sha512-cqfapCxwTGsrR80FEgOoPsTonoefMBY7dnUEbQ+GRcved0jvkJLzvX6F4WtN+HBqbPX/SiFsIRUp+IrCW/2I2w==}
28
+
29
+ '@sinonjs/samsam@8.0.3':
30
+ resolution: {integrity: sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==}
31
+
32
+ '@stonyx/utils@0.2.2':
33
+ resolution: {integrity: sha512-z/pDbX3QPeVJ3kFpU1rQURj3+BLwvGkLHVJiSckmjaBZ/vQIZzaerkf6BTZnHbSmQuUwO0lFzJRwlKOTIaXp0g==}
34
+
35
+ commander@7.2.0:
36
+ resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==}
37
+ engines: {node: '>= 10'}
38
+
39
+ diff@8.0.3:
40
+ resolution: {integrity: sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==}
41
+ engines: {node: '>=0.3.1'}
42
+
43
+ globalyzer@0.1.0:
44
+ resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==}
45
+
46
+ globrex@0.1.2:
47
+ resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
48
+
49
+ has-flag@4.0.0:
50
+ resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
51
+ engines: {node: '>=8'}
52
+
53
+ node-watch@0.7.3:
54
+ resolution: {integrity: sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==}
55
+ engines: {node: '>=6'}
56
+
57
+ qunit@2.25.0:
58
+ resolution: {integrity: sha512-MONPKgjavgTqArCwZOEz8nEMbA19zNXIp5ZOW9rPYj5cbgQp0fiI36c9dPTSzTRRzx+KcfB5eggYB/ENqxi0+w==}
59
+ engines: {node: '>=10'}
60
+ hasBin: true
61
+
62
+ sinon@21.0.1:
63
+ resolution: {integrity: sha512-Z0NVCW45W8Mg5oC/27/+fCqIHFnW8kpkFOq0j9XJIev4Ld0mKmERaZv5DMLAb9fGCevjKwaEeIQz5+MBXfZcDw==}
64
+
65
+ supports-color@7.2.0:
66
+ resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
67
+ engines: {node: '>=8'}
68
+
69
+ tiny-glob@0.2.9:
70
+ resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==}
71
+
72
+ type-detect@4.0.8:
73
+ resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
74
+ engines: {node: '>=4'}
75
+
76
+ type-detect@4.1.0:
77
+ resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==}
78
+ engines: {node: '>=4'}
79
+
80
+ snapshots:
81
+
82
+ '@sinonjs/commons@3.0.1':
83
+ dependencies:
84
+ type-detect: 4.0.8
85
+
86
+ '@sinonjs/fake-timers@15.1.0':
87
+ dependencies:
88
+ '@sinonjs/commons': 3.0.1
89
+
90
+ '@sinonjs/samsam@8.0.3':
91
+ dependencies:
92
+ '@sinonjs/commons': 3.0.1
93
+ type-detect: 4.1.0
94
+
95
+ '@stonyx/utils@0.2.2': {}
96
+
97
+ commander@7.2.0: {}
98
+
99
+ diff@8.0.3: {}
100
+
101
+ globalyzer@0.1.0: {}
102
+
103
+ globrex@0.1.2: {}
104
+
105
+ has-flag@4.0.0: {}
106
+
107
+ node-watch@0.7.3: {}
108
+
109
+ qunit@2.25.0:
110
+ dependencies:
111
+ commander: 7.2.0
112
+ node-watch: 0.7.3
113
+ tiny-glob: 0.2.9
114
+
115
+ sinon@21.0.1:
116
+ dependencies:
117
+ '@sinonjs/commons': 3.0.1
118
+ '@sinonjs/fake-timers': 15.1.0
119
+ '@sinonjs/samsam': 8.0.3
120
+ diff: 8.0.3
121
+ supports-color: 7.2.0
122
+
123
+ supports-color@7.2.0:
124
+ dependencies:
125
+ has-flag: 4.0.0
126
+
127
+ tiny-glob@0.2.9:
128
+ dependencies:
129
+ globalyzer: 0.1.0
130
+ globrex: 0.1.2
131
+
132
+ type-detect@4.0.8: {}
133
+
134
+ type-detect@4.1.0: {}
@@ -1,15 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(node --version:*)",
5
- "Bash(source ~/.nvm/nvm.sh)",
6
- "Bash(nvm use)",
7
- "Bash(pnpm install:*)",
8
- "Bash(pnpm store:*)",
9
- "Bash(npm view:*)",
10
- "Bash(npm publish:*)",
11
- "Bash(npm version:*)",
12
- "Bash(curl:*)"
13
- ]
14
- }
15
- }
package/.git/config DELETED
@@ -1,15 +0,0 @@
1
- [core]
2
- repositoryformatversion = 0
3
- filemode = true
4
- bare = false
5
- logallrefupdates = true
6
- ignorecase = true
7
- precomposeunicode = true
8
- [remote "origin"]
9
- url = git@github.com:abofs/stonyx-events.git
10
- fetch = +refs/heads/*:refs/remotes/origin/*
11
- [branch "stone/initial"]
12
- remote = origin
13
- merge = refs/heads/stone/initial
14
- gk-last-accessed = 2026-02-01T19:49:07.208Z
15
- gk-last-modified = 2026-02-01T19:49:07.208Z
@@ -1,6 +0,0 @@
1
- const { EVENTS_LOG } = process;
2
-
3
- export default {
4
- log: EVENTS_LOG ?? false,
5
- logColor: '#888',
6
- }