@pixpilot/scaffoldfy-configs 0.42.0 → 0.44.0
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.
- package/CHANGELOG.md +12 -0
- package/README.md +10 -0
- package/github-action-release-app-token/release.yml +50 -0
- package/github-action-release-app-token/scaffoldfy.json +31 -0
- package/package.json +4 -4
- package/test/workspace-package-generator.test.ts +14 -0
- package/workspace-package-generator/templates/tsdown.config.ts.hbs +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @pixpilot/scaffoldfy-configs
|
|
2
2
|
|
|
3
|
+
## 0.44.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- add test for React package unbundling in tsdown.config.ts.hbs
|
|
8
|
+
|
|
9
|
+
## 0.43.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- add GitHub App token release workflow
|
|
14
|
+
|
|
3
15
|
## 0.42.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -24,6 +24,16 @@ Usage:
|
|
|
24
24
|
npx @pixpilot/scaffoldfy@latest --config https://unpkg.com/@pixpilot/scaffoldfy-configs@latest/codeql-private-repo/scaffoldfy.json
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
### github-action-release-app-token
|
|
28
|
+
|
|
29
|
+
Replaces the release workflow of a github-action-template clone with the GitHub App token variant (RELEASER_ID / RELEASER_PRIVATE_KEY) for pixpilot and ccpu repositories
|
|
30
|
+
|
|
31
|
+
Usage:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npx @pixpilot/scaffoldfy@latest --config https://unpkg.com/@pixpilot/scaffoldfy-configs@latest/github-action-release-app-token/scaffoldfy.json
|
|
35
|
+
```
|
|
36
|
+
|
|
27
37
|
### license-file
|
|
28
38
|
|
|
29
39
|
Generate a LICENSE file with common open-source licenses
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: [CI]
|
|
6
|
+
types:
|
|
7
|
+
- completed
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
release:
|
|
16
|
+
if: >-
|
|
17
|
+
${{
|
|
18
|
+
github.event.workflow_run.conclusion == 'success' &&
|
|
19
|
+
github.event.workflow_run.event == 'push' &&
|
|
20
|
+
github.event.workflow_run.head_branch == 'main' &&
|
|
21
|
+
!contains(github.event.workflow_run.head_commit.message || '', '[skip ci]') &&
|
|
22
|
+
!contains(github.event.workflow_run.head_commit.message || '', '[ci skip]')
|
|
23
|
+
}}
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- name: Generate token
|
|
27
|
+
id: generate-token
|
|
28
|
+
uses: actions/create-github-app-token@v3
|
|
29
|
+
with:
|
|
30
|
+
client-id: ${{ secrets.RELEASER_ID }}
|
|
31
|
+
private-key: ${{ secrets.RELEASER_PRIVATE_KEY }}
|
|
32
|
+
|
|
33
|
+
- name: Checkout
|
|
34
|
+
uses: actions/checkout@v4
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
persist-credentials: false
|
|
38
|
+
ref: ${{ github.event.workflow_run.head_sha }}
|
|
39
|
+
token: ${{ steps.generate-token.outputs.token }}
|
|
40
|
+
|
|
41
|
+
- name: Setup Project
|
|
42
|
+
uses: pixpilot/github-actions/setup-pnpm-project@v1
|
|
43
|
+
|
|
44
|
+
- name: Build dist
|
|
45
|
+
run: npm run bundle
|
|
46
|
+
|
|
47
|
+
- name: Semantic Release
|
|
48
|
+
uses: cycjimmy/semantic-release-action@v4
|
|
49
|
+
env:
|
|
50
|
+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../node_modules/@pixpilot/scaffoldfy/schema/scaffoldfy.schema.json",
|
|
3
|
+
"name": "github-action-release-app-token",
|
|
4
|
+
"description": "Replaces the release workflow of a github-action-template clone with the GitHub App token variant (RELEASER_ID / RELEASER_PRIVATE_KEY) for pixpilot and ccpu repositories",
|
|
5
|
+
"dependencies": ["pixpilot-info"],
|
|
6
|
+
"variables": [
|
|
7
|
+
{
|
|
8
|
+
"id": "isGithubActionTemplate",
|
|
9
|
+
"value": {
|
|
10
|
+
"type": "exec",
|
|
11
|
+
"value": "node -e \"try{process.stdout.write(String(require(require('path').resolve('package.json')).name==='github-action-template'))}catch{process.stdout.write('false')}\""
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"tasks": [
|
|
16
|
+
{
|
|
17
|
+
"id": "github-action-release-app-token-workflow",
|
|
18
|
+
"name": "Use GitHub App token in release workflow",
|
|
19
|
+
"description": "Overwrites the release workflow to authenticate semantic-release with a GitHub App token",
|
|
20
|
+
"enabled": {
|
|
21
|
+
"type": "condition",
|
|
22
|
+
"value": "isGithubActionTemplate === true && pixpilot_project === true"
|
|
23
|
+
},
|
|
24
|
+
"type": "write",
|
|
25
|
+
"config": {
|
|
26
|
+
"templateFile": "release.yml",
|
|
27
|
+
"file": ".github/workflows/release.yml"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/scaffoldfy-configs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.44.0",
|
|
5
5
|
"author": "PixPilot <m.doaie@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^22.18.11",
|
|
31
31
|
"eslint": "^9.38.0",
|
|
32
|
-
"@internal/tsdown-config": "0.1.0",
|
|
33
32
|
"@internal/eslint-config": "0.3.0",
|
|
34
|
-
"@internal/vitest-config": "0.1.0",
|
|
35
33
|
"@internal/prettier-config": "0.0.1",
|
|
36
|
-
"@pixpilot/scaffoldfy": "0.56.0"
|
|
34
|
+
"@pixpilot/scaffoldfy": "0.56.0",
|
|
35
|
+
"@internal/tsdown-config": "0.1.0",
|
|
36
|
+
"@internal/vitest-config": "0.1.0"
|
|
37
37
|
},
|
|
38
38
|
"prettier": "@internal/prettier-config",
|
|
39
39
|
"publishConfig": {
|
|
@@ -376,6 +376,20 @@ describe('workspace-package-generator – package.json.hbs rendering', () => {
|
|
|
376
376
|
describe('workspace-package-generator – tsdown.config.ts.hbs rendering', () => {
|
|
377
377
|
const tplPath = path.join(TEMPLATES_DIR, 'tsdown.config.ts.hbs');
|
|
378
378
|
|
|
379
|
+
it('should unbundle React packages only', () => {
|
|
380
|
+
const reactConfig = renderHbs(tplPath, {
|
|
381
|
+
tsdownConfigPackage: '@pixpilot/tsdown-config',
|
|
382
|
+
isReactPackage: true,
|
|
383
|
+
});
|
|
384
|
+
const vanillaConfig = renderHbs(tplPath, {
|
|
385
|
+
tsdownConfigPackage: '@pixpilot/tsdown-config',
|
|
386
|
+
isReactPackage: false,
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
expect(reactConfig).toContain('unbundle: true,');
|
|
390
|
+
expect(vanillaConfig).not.toContain('unbundle:');
|
|
391
|
+
});
|
|
392
|
+
|
|
379
393
|
it('should render without bundle size when bundleSizeLimit is falsy', () => {
|
|
380
394
|
const ctx = {
|
|
381
395
|
tsdownConfigPackage: '@pixpilot/tsdown-config',
|