com.wallstop-studios.unity-helpers 2.0.0-rc81.9 → 2.0.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/.editorconfig +1 -1
- package/.gitattributes +1 -1
- package/.githooks/pre-commit +31 -5
- package/.githooks/pre-push +50 -0
- package/.github/dependabot.yml +24 -2
- package/.github/scripts/check-markdown-links.ps1 +77 -0
- package/.github/scripts/check_markdown_links.py +89 -0
- package/.github/scripts/check_markdown_url_encoding.py +74 -0
- package/.github/scripts/validate_markdown_links.py +194 -0
- package/.github/workflows/csharpier-autofix.yml +152 -0
- package/.github/workflows/format-on-demand.yml +305 -0
- package/.github/workflows/lint-doc-links.yml +8 -5
- package/.github/workflows/markdown-json.yml +6 -2
- package/.github/workflows/prettier-autofix.yml +195 -0
- package/.github/workflows/update-dotnet-tools.yml +80 -0
- package/.github/workflows/yaml-format-lint.yml +41 -0
- package/.lychee.toml +4 -4
- package/.markdownlint.jsonc +21 -0
- package/.pre-commit-config.yaml +11 -3
- package/.yamllint.yaml +31 -0
- package/AGENTS.md +5 -1
- package/CHANGELOG.md +11 -0
- package/CONTRIBUTING.md +49 -0
- package/CONTRIBUTING.md.meta +7 -0
- package/EDITOR_TOOLS_GUIDE.md +4 -0
- package/Editor/AnimationEventEditor.cs +337 -160
- package/Editor/Core/Helper/AnimationEventHelpers.cs +178 -152
- package/Editor/CustomEditors/PersistentDirectoryGUI.cs +20 -11
- package/Editor/CustomEditors/TexturePlatformOverrideEntryDrawer.cs +11 -2
- package/Editor/FitTextureSizeWindow.cs +43 -19
- package/Editor/PersistentDirectorySettings.cs +64 -12
- package/Editor/PrefabChecker.cs +72 -5
- package/Editor/Sprites/AnimationCopier.cs +132 -56
- package/Editor/Sprites/AnimationCreator.cs +63 -22
- package/Editor/Sprites/AnimationViewerWindow.cs +42 -6
- package/Editor/Sprites/TexturePlatformNameHelper.cs +50 -39
- package/Editor/Sprites/TextureResizerWizard.cs +23 -1
- package/Editor/Sprites/TextureSettingsApplierWindow.cs +148 -85
- package/Editor/Tools/ImageBlurTool.cs +81 -10
- package/Editor/Utils/EditorUi.cs +1 -1
- package/Editor/Utils/ScriptableObjectSingletonCreator.cs +1 -1
- package/GETTING_STARTED.md +40 -56
- package/RANDOM_PERFORMANCE.md +12 -12
- package/README.md +395 -2407
- package/RELATIONAL_COMPONENTS.md +92 -83
- package/Runtime/AssemblyInfo.cs +2 -0
- package/Runtime/Core/Attributes/NotNullAttribute.cs +1 -3
- package/Runtime/Core/Attributes/RelationalComponentAssigner.cs +50 -5
- package/Runtime/Core/DataStructure/CyclicBuffer.cs +0 -1
- package/Runtime/Core/Extension/RandomExtensions.cs +68 -0
- package/Runtime/Core/Extension/WallstopStudiosLogger.cs +16 -0
- package/Runtime/Core/Helper/Partials/ObjectHelpers.cs +4 -1
- package/Runtime/Core/Helper/ReflectionHelpers.cs +21 -10
- package/Runtime/Core/Helper/SpriteHelpers.cs +3 -1
- package/Runtime/Core/Helper/UnityMainThreadDispatcher.cs +45 -1
- package/Runtime/Core/Serialization/JsonConverters/GameObjectConverter.cs +13 -5
- package/Runtime/Core/Serialization/JsonConverters/ResolutionConverter.cs +1 -1
- package/Runtime/Core/Serialization/JsonConverters/TypeConverter.cs +1 -1
- package/Runtime/Core/Serialization/Serializer.cs +101 -0
- package/Runtime/Integrations/VContainer/AssemblyInfo.cs +9 -0
- package/Runtime/Integrations/VContainer/AssemblyInfo.cs.meta +3 -0
- package/Runtime/Integrations/VContainer/ObjectResolverRelationalExtensions.cs +96 -0
- package/Runtime/Integrations/VContainer/RelationalComponentEntryPoint.cs +90 -10
- package/Runtime/Integrations/VContainer/RelationalComponentsBuilderExtensions.cs +13 -1
- package/Runtime/Integrations/VContainer/RelationalObjectPools.cs +114 -0
- package/Runtime/Integrations/VContainer/RelationalObjectPools.cs.meta +11 -0
- package/Runtime/Integrations/VContainer/RelationalSceneAssignmentOptions.cs +16 -4
- package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs +241 -0
- package/Runtime/Integrations/VContainer/RelationalSceneLoadListener.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/AssemblyInfo.cs +9 -0
- package/Runtime/Integrations/Zenject/AssemblyInfo.cs.meta +3 -0
- package/Runtime/Integrations/Zenject/DiContainerRelationalExtensions.cs +69 -2
- package/Runtime/Integrations/Zenject/RelationalComponentSceneInitializer.cs +89 -12
- package/Runtime/Integrations/Zenject/RelationalComponentsInstaller.cs +23 -1
- package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs +44 -0
- package/Runtime/Integrations/Zenject/RelationalMemoryPools.cs.meta +11 -0
- package/Runtime/Integrations/Zenject/RelationalSceneAssignmentOptions.cs +16 -10
- package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs +243 -0
- package/Runtime/Integrations/Zenject/RelationalSceneLoadListener.cs.meta +11 -0
- package/Runtime/Tags/AttributeMetadataCache.cs +1 -4
- package/Runtime/Utils/Buffers.cs +4 -4
- package/Runtime/Utils/ScriptableObjectSingleton.cs +0 -1
- package/Runtime/Utils/SetTextureImportData.cs +3 -1
- package/Runtime/Utils/TextureScale.cs +10 -2
- package/Runtime/Visuals/UGUI/EnhancedImage.cs +6 -0
- package/Runtime/Visuals/UIToolkit/LayeredImage.cs +4 -1
- package/SERIALIZATION.md +15 -0
- package/SPATIAL_TREE_2D_PERFORMANCE.md +85 -82
- package/SPATIAL_TREE_3D_PERFORMANCE.md +94 -91
- package/Samples~/DI - VContainer/README.md +232 -51
- package/Samples~/DI - VContainer/Scripts/GameLifetimeScope.cs +22 -4
- package/Samples~/DI - VContainer/Scripts/RelationalConsumer.cs +5 -2
- package/Samples~/DI - VContainer/Scripts/Spawner.cs +113 -4
- package/Samples~/DI - Zenject/README.md +217 -53
- package/Samples~/DI - Zenject/Scripts/RelationalConsumer.cs +3 -0
- package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs +37 -0
- package/Samples~/DI - Zenject/Scripts/RelationalConsumerPool.cs.meta +12 -0
- package/Samples~/DI - Zenject/Scripts/SpawnerZenject.cs +74 -3
- package/Samples~/Random - PRNG/README.md +2 -1
- package/Samples~/Relational Components - Basic/README.md +3 -1
- package/Samples~/Serialization - JSON/README.md +2 -1
- package/Samples~/Spatial Structures - 2D and 3D/README.md +2 -1
- package/Samples~/UGUI - EnhancedImage/README.md +2 -1
- package/Samples~/UI Toolkit - MultiFile Selector (Editor)/README.md +2 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/Tests/Editor/Attributes/AnimationEventHelpersTests.cs +16 -0
- package/Tests/Editor/Core/Attributes/RelationalComponentAssignerTests.cs +3 -3
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalEntryPointTests.cs +6 -2
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs +170 -0
- package/Tests/Editor/Integrations/VContainer/VContainerRelationalHelpersTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/VContainer/WallstopStudios.UnityHelpers.Tests.Editor.VContainer.asmdef +2 -1
- package/Tests/Editor/Integrations/Zenject/WallstopStudios.UnityHelpers.Tests.Editor.Zenject.asmdef +3 -2
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs +131 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalHelpersTests.cs.meta +11 -0
- package/Tests/Editor/Integrations/Zenject/ZenjectRelationalInitializerTests.cs +6 -2
- package/Tests/Editor/PersistentDirectorySettingsTests.cs +59 -0
- package/Tests/Editor/PersistentDirectorySettingsTests.cs.meta +11 -0
- package/Tests/Editor/PrefabCheckerReportTests.cs +32 -0
- package/Tests/Editor/PrefabCheckerReportTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs +64 -0
- package/Tests/Editor/Sprites/AnimationCopierFilterTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/AnimationCopierWindowTests.cs +1 -1
- package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs +38 -0
- package/Tests/Editor/Sprites/AnimationViewerWindowTests.cs.meta +11 -0
- package/Tests/Editor/Sprites/ScriptableSpriteAtlasEditorTests.cs +1 -1
- package/Tests/Editor/Sprites/SpriteCropperAdditionalTests.cs +12 -12
- package/Tests/Editor/Sprites/SpriteCropperTests.cs +9 -9
- package/Tests/Editor/Sprites/SpritePivotAdjusterTests.cs +3 -3
- package/Tests/Editor/Sprites/TexturePlatformNameHelperTests.cs +18 -0
- package/Tests/Editor/Sprites/TextureResizerWizardTests.cs +5 -5
- package/Tests/Editor/Sprites/TextureSettingsApplierAPITests.cs +3 -3
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardAdditionalTests.cs +4 -4
- package/Tests/Editor/Sprites/TextureSettingsApplierWizardTests.cs +4 -4
- package/Tests/Editor/Tools/ImageBlurToolTests.cs +22 -110
- package/Tests/Editor/Utils/CommonTestBase.cs +43 -1
- package/Tests/Editor/Utils/ScriptableObjectSingletonCreatorTests.cs +5 -5
- package/Tests/Editor/Windows/FitTextureSizeWindowTests.cs +66 -74
- package/Tests/Runtime/Attributes/RelationalComponentInitializerTests.cs +4 -15
- package/Tests/Runtime/DataStructures/SpatialTree3DBoundsConsistencyTests.cs +29 -29
- package/Tests/Runtime/Integrations/VContainer/RelationalComponentsVContainerTests.cs +259 -218
- package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs +86 -0
- package/Tests/Runtime/Integrations/VContainer/RelationalObjectPoolsVContainerTests.cs.meta +11 -0
- package/Tests/Runtime/Integrations/Zenject/RelationalComponentsZenjectTests.cs +255 -227
- package/Tests/Runtime/Performance/SpatialTree2DPerformanceTests.cs +5 -0
- package/Tests/Runtime/Performance/SpatialTree3DPerformanceTests.cs +3 -0
- package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs +30 -0
- package/Tests/Runtime/Serialization/JsonConverterAdditionalTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/JsonConverterTests.cs +8 -12
- package/Tests/Runtime/Serialization/JsonSerializationTest.cs +16 -5
- package/Tests/Runtime/Serialization/SerializerAdditionalTests.cs +12 -0
- package/Tests/Runtime/Serialization/SerializerFileIoTests.cs +105 -0
- package/Tests/Runtime/Serialization/SerializerFileIoTests.cs.meta +11 -0
- package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs +247 -0
- package/Tests/Runtime/Serialization/UnityEngineObjectJsonTests.cs.meta +11 -0
- package/Tests/Runtime/TestUtils/CommonTestBase.cs +88 -0
- package/Tests/Runtime/Utils/CoroutineHandlerTests.cs +1 -1
- package/Tests/Runtime/Utils/LZMAComprehensiveTests.cs +1 -1
- package/Tests/Runtime/Utils/LZMATests.cs +1 -1
- package/Tests/Runtime/Utils/MatchColliderToSpriteTests.cs +1 -1
- package/Tests/Runtime/Visuals/EnhancedImageTests.cs +25 -56
- package/Tests/Runtime/Visuals/VisualsTestHelpers.cs +1 -8
- package/package-lock.json.meta +7 -0
- package/package.json +8 -4
- package/scripts/check-eol.ps1 +4 -5
- package/scripts/lint-tests.ps1 +156 -0
- package/scripts/lint-tests.ps1.meta +7 -0
- package/scripts/normalize-eol.ps1 +6 -9
- package/.github/workflows/csharpier.yml +0 -135
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
name: Prettier Auto Fix
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
pull_request_target:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
autofix:
|
|
14
|
+
name: Format and propose changes
|
|
15
|
+
if: ${{ github.event_name != 'pull_request_target' }}
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v5
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@v5
|
|
25
|
+
with:
|
|
26
|
+
node-version: '20'
|
|
27
|
+
cache: 'npm'
|
|
28
|
+
cache-dependency-path: package.json
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
if [ -f package-lock.json ]; then
|
|
33
|
+
npm ci
|
|
34
|
+
else
|
|
35
|
+
npm i --no-audit --no-fund
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
- name: Run Prettier (write fixes)
|
|
39
|
+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
|
|
40
|
+
run: |
|
|
41
|
+
npm run format:md
|
|
42
|
+
npm run format:json
|
|
43
|
+
npm run format:yaml
|
|
44
|
+
|
|
45
|
+
- name: Markdownlint (auto-fix)
|
|
46
|
+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
|
|
47
|
+
run: npx markdownlint "**/*.md" "**/*.markdown" --config .markdownlint.json --ignore-path .markdownlintignore --fix
|
|
48
|
+
|
|
49
|
+
- name: Commit formatting changes to PR branch (Dependabot only)
|
|
50
|
+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login == 'dependabot[bot]' }}
|
|
51
|
+
uses: stefanzweifel/git-auto-commit-action@v7
|
|
52
|
+
with:
|
|
53
|
+
commit_message: "chore(format): apply Prettier/markdownlint fixes"
|
|
54
|
+
branch: ${{ github.head_ref }}
|
|
55
|
+
file_pattern: |
|
|
56
|
+
**/*.md
|
|
57
|
+
**/*.markdown
|
|
58
|
+
**/*.json
|
|
59
|
+
**/*.asmdef
|
|
60
|
+
**/*.asmref
|
|
61
|
+
**/*.yml
|
|
62
|
+
**/*.yaml
|
|
63
|
+
|
|
64
|
+
- name: Prettier check (Markdown)
|
|
65
|
+
run: npm run format:md:check
|
|
66
|
+
|
|
67
|
+
- name: Prettier check (JSON / asmdef / asmref)
|
|
68
|
+
run: npm run format:json:check
|
|
69
|
+
|
|
70
|
+
- name: Prettier check (YAML)
|
|
71
|
+
run: npm run format:yaml:check
|
|
72
|
+
|
|
73
|
+
- name: Markdown lint (CI gate)
|
|
74
|
+
run: npm run lint:markdown
|
|
75
|
+
|
|
76
|
+
- name: Enforce EOL (CRLF) and No BOM
|
|
77
|
+
shell: pwsh
|
|
78
|
+
run: ./scripts/check-eol.ps1 -VerboseOutput
|
|
79
|
+
|
|
80
|
+
autofix_fork:
|
|
81
|
+
name: Fork PR bot formatting PR (Dependabot only)
|
|
82
|
+
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && github.event.pull_request.user.login == 'dependabot[bot]' }}
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
steps:
|
|
85
|
+
- name: Checkout fork PR HEAD
|
|
86
|
+
uses: actions/checkout@v5
|
|
87
|
+
with:
|
|
88
|
+
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
89
|
+
ref: ${{ github.event.pull_request.head.ref }}
|
|
90
|
+
persist-credentials: false
|
|
91
|
+
fetch-depth: 0
|
|
92
|
+
|
|
93
|
+
- name: Setup Node.js
|
|
94
|
+
uses: actions/setup-node@v5
|
|
95
|
+
with:
|
|
96
|
+
node-version: '20'
|
|
97
|
+
cache: 'npm'
|
|
98
|
+
cache-dependency-path: package.json
|
|
99
|
+
|
|
100
|
+
- name: Install dependencies
|
|
101
|
+
run: |
|
|
102
|
+
if [ -f package-lock.json ]; then
|
|
103
|
+
npm ci
|
|
104
|
+
else
|
|
105
|
+
npm i --no-audit --no-fund
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
- name: Run Prettier (write fixes)
|
|
109
|
+
run: |
|
|
110
|
+
npm run format:md
|
|
111
|
+
npm run format:json
|
|
112
|
+
npm run format:yaml
|
|
113
|
+
|
|
114
|
+
- name: Markdownlint (auto-fix)
|
|
115
|
+
run: npx markdownlint "**/*.md" "**/*.markdown" --config .markdownlint.json --ignore-path .markdownlintignore --fix
|
|
116
|
+
|
|
117
|
+
- name: Detect changes
|
|
118
|
+
id: changes
|
|
119
|
+
shell: bash
|
|
120
|
+
run: |
|
|
121
|
+
if git diff --quiet; then
|
|
122
|
+
echo "has_changes=false" >> $GITHUB_OUTPUT
|
|
123
|
+
else
|
|
124
|
+
echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
- name: Create bot branch and push to base repo
|
|
128
|
+
if: steps.changes.outputs.has_changes == 'true'
|
|
129
|
+
shell: bash
|
|
130
|
+
env:
|
|
131
|
+
GH_REPO: ${{ github.repository }}
|
|
132
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
+
run: |
|
|
134
|
+
set -euo pipefail
|
|
135
|
+
BRANCH="bot/prettier/pr-${{ github.event.pull_request.number }}"
|
|
136
|
+
git config user.name "github-actions[bot]"
|
|
137
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
138
|
+
git checkout -B "$BRANCH"
|
|
139
|
+
# Stage only files we format; avoid workflows to prevent permission issues
|
|
140
|
+
git add '**/*.md' '**/*.markdown' '**/*.json' '**/*.asmdef' '**/*.asmref' '**/*.yml' '**/*.yaml'
|
|
141
|
+
git commit -m "chore(format): apply Prettier/markdownlint fixes for PR #${{ github.event.pull_request.number }}"
|
|
142
|
+
git remote add upstream "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
|
|
143
|
+
git fetch upstream
|
|
144
|
+
git push upstream "$BRANCH" --force
|
|
145
|
+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
|
|
146
|
+
|
|
147
|
+
- name: Open or update formatting PR in base repo
|
|
148
|
+
if: steps.changes.outputs.has_changes == 'true'
|
|
149
|
+
uses: actions/github-script@v7
|
|
150
|
+
with:
|
|
151
|
+
script: |
|
|
152
|
+
const prNumber = context.payload.pull_request.number;
|
|
153
|
+
const baseRef = context.payload.pull_request.base.ref;
|
|
154
|
+
const headBranch = `bot/prettier/pr-${prNumber}`;
|
|
155
|
+
const {owner, repo} = context.repo;
|
|
156
|
+
const title = `chore(format): Apply Prettier/markdownlint to PR #${prNumber}`;
|
|
157
|
+
const body = [
|
|
158
|
+
`This automated PR applies Prettier and markdownlint fixes to the changes from PR #${prNumber}.`,
|
|
159
|
+
'',
|
|
160
|
+
`- Source PR (fork): #${prNumber}`,
|
|
161
|
+
`- Target branch: ${baseRef}`,
|
|
162
|
+
'',
|
|
163
|
+
'If this PR is merged, it will include the contributor\'s changes plus required formatting.',
|
|
164
|
+
'You can then close the original PR or ask the author to rebase.',
|
|
165
|
+
].join('\n');
|
|
166
|
+
|
|
167
|
+
const existing = await github.rest.pulls.list({ owner, repo, state: 'open', head: `${owner}:${headBranch}` });
|
|
168
|
+
if (existing.data.length === 0) {
|
|
169
|
+
await github.rest.pulls.create({ owner, repo, head: headBranch, base: baseRef, title, body });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
- name: Comment link on original PR
|
|
173
|
+
if: steps.changes.outputs.has_changes == 'true'
|
|
174
|
+
uses: actions/github-script@v7
|
|
175
|
+
with:
|
|
176
|
+
script: |
|
|
177
|
+
const prNumber = context.payload.pull_request.number;
|
|
178
|
+
const {owner, repo} = context.repo;
|
|
179
|
+
const headBranch = `bot/prettier/pr-${prNumber}`;
|
|
180
|
+
const resp = await github.rest.pulls.list({ owner, repo, state: 'open', head: `${owner}:${headBranch}` });
|
|
181
|
+
if (resp.data.length > 0) {
|
|
182
|
+
const fmtPr = resp.data[0];
|
|
183
|
+
const body = `A formatting PR has been opened: #${fmtPr.number} (applies Prettier/markdownlint fixes to this PR).`;
|
|
184
|
+
const comments = await github.rest.issues.listComments({ owner, repo, issue_number: prNumber, per_page: 50 });
|
|
185
|
+
const already = comments.data.some(
|
|
186
|
+
(c) =>
|
|
187
|
+
c.body &&
|
|
188
|
+
c.body.includes(`#${fmtPr.number}`) &&
|
|
189
|
+
c.user &&
|
|
190
|
+
c.user.login === 'github-actions[bot]'
|
|
191
|
+
);
|
|
192
|
+
if (!already) {
|
|
193
|
+
await github.rest.issues.createComment({ owner, repo, issue_number: prNumber, body });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Update .NET Tools
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '25 5 * * *'
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
update-tools:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v5
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- name: Setup .NET SDK
|
|
22
|
+
uses: actions/setup-dotnet@v5
|
|
23
|
+
with:
|
|
24
|
+
dotnet-version: '8.0.x'
|
|
25
|
+
|
|
26
|
+
- name: Restore dotnet tools
|
|
27
|
+
run: dotnet tool restore
|
|
28
|
+
|
|
29
|
+
- name: Update local dotnet tools
|
|
30
|
+
shell: pwsh
|
|
31
|
+
run: |
|
|
32
|
+
$manifest = Join-Path $PWD ".config/dotnet-tools.json"
|
|
33
|
+
if (!(Test-Path $manifest)) {
|
|
34
|
+
Write-Host "No dotnet tool manifest found. Skipping."
|
|
35
|
+
exit 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
$json = Get-Content $manifest -Raw | ConvertFrom-Json
|
|
39
|
+
$toolIds = @()
|
|
40
|
+
if ($json.tools) {
|
|
41
|
+
$toolIds = $json.tools.PSObject.Properties.Name
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if ($toolIds.Count -eq 0) {
|
|
45
|
+
Write-Host "No tools defined in manifest."
|
|
46
|
+
exit 0
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
foreach ($id in $toolIds) {
|
|
50
|
+
Write-Host "Updating $id..."
|
|
51
|
+
dotnet tool update $id --local
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
- name: Detect manifest changes
|
|
55
|
+
id: git_changes
|
|
56
|
+
run: |
|
|
57
|
+
if git diff --quiet; then
|
|
58
|
+
echo "changed=false" >> "$GITHUB_OUTPUT"
|
|
59
|
+
else
|
|
60
|
+
echo "changed=true" >> "$GITHUB_OUTPUT"
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
- name: Create Pull Request
|
|
64
|
+
if: steps.git_changes.outputs.changed == 'true'
|
|
65
|
+
uses: peter-evans/create-pull-request@v7
|
|
66
|
+
with:
|
|
67
|
+
branch: chore/update-dotnet-tools
|
|
68
|
+
title: "chore: update .NET local tools"
|
|
69
|
+
commit-message: "chore(dotnet-tools): update .config/dotnet-tools.json"
|
|
70
|
+
body: |
|
|
71
|
+
Automated update of local .NET tools defined in `.config/dotnet-tools.json`.
|
|
72
|
+
labels: dependencies
|
|
73
|
+
assignees: wallstop
|
|
74
|
+
reviewers: wallstop
|
|
75
|
+
|
|
76
|
+
- name: No changes summary
|
|
77
|
+
if: steps.git_changes.outputs.changed != 'true'
|
|
78
|
+
run: |
|
|
79
|
+
echo "## .NET tools are up to date" >> $GITHUB_STEP_SUMMARY
|
|
80
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: YAML Format + Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
yaml-checks:
|
|
12
|
+
name: Prettier and yamllint
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v5
|
|
17
|
+
|
|
18
|
+
- name: Setup Node
|
|
19
|
+
uses: actions/setup-node@v5
|
|
20
|
+
with:
|
|
21
|
+
node-version: "20"
|
|
22
|
+
cache: 'npm'
|
|
23
|
+
cache-dependency-path: package.json
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
if [ -f package-lock.json ]; then
|
|
28
|
+
npm ci
|
|
29
|
+
else
|
|
30
|
+
npm i --no-audit --no-fund
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
- name: Prettier check (YAML)
|
|
34
|
+
run: npm run format:yaml:check
|
|
35
|
+
|
|
36
|
+
- name: yamllint
|
|
37
|
+
uses: ibiqlik/action-yamllint@v3.1.1
|
|
38
|
+
with:
|
|
39
|
+
file_or_dir: .
|
|
40
|
+
config_file: .yamllint.yaml
|
|
41
|
+
strict: true
|
package/.lychee.toml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
verbosity = "info"
|
|
2
2
|
no_progress = true
|
|
3
3
|
max_concurrency = 4
|
|
4
4
|
exclude_mail = true
|
|
@@ -10,8 +10,9 @@ retry_wait_time = 2 # seconds between retries
|
|
|
10
10
|
max_redirects = 10
|
|
11
11
|
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36"
|
|
12
12
|
|
|
13
|
-
# Treat rate-limiting as
|
|
14
|
-
|
|
13
|
+
# Treat successes and rate-limiting as acceptable in CI
|
|
14
|
+
# Accept all 2xx as valid plus 429 (rate limited)
|
|
15
|
+
accept = ["200..=299", 429]
|
|
15
16
|
|
|
16
17
|
# Only check web links
|
|
17
18
|
scheme = ["https", "http"]
|
|
@@ -23,4 +24,3 @@ exclude = [
|
|
|
23
24
|
"^https?://0\\.0\\.0\\.0",
|
|
24
25
|
"^file://"
|
|
25
26
|
]
|
|
26
|
-
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"default": true,
|
|
3
|
+
// Allow long lines; Prettier handles wrapping policy
|
|
4
|
+
"MD013": false,
|
|
5
|
+
// Allow inline HTML when needed
|
|
6
|
+
"MD033": false,
|
|
7
|
+
// First line need not be a top-level heading (many docs start with badges)
|
|
8
|
+
"MD041": false,
|
|
9
|
+
// Use fenced code blocks consistently (matches Prettier)
|
|
10
|
+
"MD046": { "style": "fenced" },
|
|
11
|
+
// Duplicate headings only matter among siblings
|
|
12
|
+
"MD024": { "siblings_only": true },
|
|
13
|
+
// Accept ascending ordered list numbers (matches Prettier behavior)
|
|
14
|
+
"MD029": { "style": "ordered" },
|
|
15
|
+
// Permit bare URLs; Prettier won’t auto-wrap, and link checks are handled separately
|
|
16
|
+
"MD034": false,
|
|
17
|
+
// Allow exactly one blank line between blocks (Prettier’s behavior)
|
|
18
|
+
"MD012": { "maximum": 1 },
|
|
19
|
+
// Don’t flag the two trailing spaces used for hard line breaks in Markdown
|
|
20
|
+
"MD009": { "strict": false }
|
|
21
|
+
}
|
package/.pre-commit-config.yaml
CHANGED
|
@@ -15,7 +15,7 @@ repos:
|
|
|
15
15
|
description: Install the .NET tools listed at .config/dotnet-tools.json.
|
|
16
16
|
- id: csharpier
|
|
17
17
|
name: Run CSharpier on C# files
|
|
18
|
-
entry: dotnet tool run
|
|
18
|
+
entry: dotnet tool run csharpier format
|
|
19
19
|
language: system
|
|
20
20
|
types:
|
|
21
21
|
- c#
|
|
@@ -24,10 +24,10 @@ repos:
|
|
|
24
24
|
- repo: local
|
|
25
25
|
hooks:
|
|
26
26
|
- id: prettier
|
|
27
|
-
name: Prettier (Markdown, JSON, asmdef, asmref)
|
|
27
|
+
name: Prettier (Markdown, JSON, asmdef, asmref, YAML)
|
|
28
28
|
entry: npx --yes prettier --write
|
|
29
29
|
language: system
|
|
30
|
-
files: '(?i)\.(md|markdown|json|asmdef|asmref)$'
|
|
30
|
+
files: '(?i)\.(md|markdown|json|asmdef|asmref|ya?ml)$'
|
|
31
31
|
description: Use the repo's Prettier version from package.json.
|
|
32
32
|
|
|
33
33
|
- repo: local
|
|
@@ -37,3 +37,11 @@ repos:
|
|
|
37
37
|
entry: npx --yes markdownlint --config .markdownlint.json --ignore-path .markdownlintignore
|
|
38
38
|
language: system
|
|
39
39
|
files: '(?i)\.(md|markdown)$'
|
|
40
|
+
|
|
41
|
+
- repo: local
|
|
42
|
+
hooks:
|
|
43
|
+
- id: yamllint
|
|
44
|
+
name: yamllint (if available)
|
|
45
|
+
entry: bash -c 'if command -v yamllint >/dev/null 2>&1; then yamllint -c .yamllint.yaml "$@"; else echo "yamllint not installed; skipping"; fi' --
|
|
46
|
+
language: system
|
|
47
|
+
files: '(?i)\.(ya?ml)$'
|
package/.yamllint.yaml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
extends: default
|
|
2
|
+
|
|
3
|
+
ignore: |
|
|
4
|
+
node_modules/
|
|
5
|
+
.git/
|
|
6
|
+
Library/
|
|
7
|
+
obj/
|
|
8
|
+
Temp/
|
|
9
|
+
Samples~/
|
|
10
|
+
|
|
11
|
+
rules:
|
|
12
|
+
line-length:
|
|
13
|
+
max: 200
|
|
14
|
+
allow-non-breakable-words: true
|
|
15
|
+
allow-non-breakable-inline-mappings: true
|
|
16
|
+
truthy: disable
|
|
17
|
+
document-start: disable
|
|
18
|
+
comments-indentation: disable
|
|
19
|
+
comments:
|
|
20
|
+
min-spaces-from-content: 1
|
|
21
|
+
indentation:
|
|
22
|
+
spaces: 2
|
|
23
|
+
indent-sequences: consistent
|
|
24
|
+
new-lines:
|
|
25
|
+
type: dos
|
|
26
|
+
new-line-at-end-of-file: enable
|
|
27
|
+
trailing-spaces: enable
|
|
28
|
+
empty-lines:
|
|
29
|
+
max: 1
|
|
30
|
+
max-start: 0
|
|
31
|
+
max-end: 1
|
package/AGENTS.md
CHANGED
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
## Coding Style & Naming Conventions
|
|
21
21
|
|
|
22
22
|
- Indentation: 4 spaces for `*.cs`; 2 spaces for JSON/YAML/`*.asmdef`.
|
|
23
|
-
- Line endings: CRLF; UTF-8 BOM per `.editorconfig`.
|
|
23
|
+
- Line endings: CRLF; UTF-8 (no BOM) per `.editorconfig`.
|
|
24
24
|
- C#: explicit types over `var`; braces required; `using` inside namespace.
|
|
25
25
|
- Naming: PascalCase for types/public members; camelCase for fields/locals; interfaces prefixed `I` (e.g., `IResolver`); type params prefixed `T`; events start with `On...`.
|
|
26
26
|
- Do not use underscores in function names, especially test function names.
|
|
27
27
|
- Do not use regions, anywhere, ever.
|
|
28
|
+
- Avoid `var` wherever possible, use expressive types.
|
|
28
29
|
|
|
29
30
|
## Testing Guidelines
|
|
30
31
|
|
|
@@ -34,6 +35,9 @@
|
|
|
34
35
|
- Do not use regions.
|
|
35
36
|
- Try to use minimal comments and instead rely on expressive naming conventions and assertions.
|
|
36
37
|
- Do not use Description annotations for tests.
|
|
38
|
+
- Do not create `async Task` test methods - the Unity test runner does not support this. Make do with `IEnumerator` based UnityTestMethods.
|
|
39
|
+
- Do not use `Assert.ThrowsAsync`, it does not exist.
|
|
40
|
+
- When asserting that UnityEngine.Objects are null or not null, please check for null directly (thing != null, thing == null), to properly adhere to Unity Object existence checks.
|
|
37
41
|
|
|
38
42
|
## Commit & Pull Request Guidelines
|
|
39
43
|
|
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
- Deprecate BinaryFormatter with `[Obsolete]`, keep functional for trusted/legacy scenarios.
|
|
6
|
+
- Make GameObject JSON converter output structured JSON with `name`, `type`, and `instanceId`.
|
|
7
|
+
- Fix stray `UnityEditor` imports in Runtime to ensure clean player builds.
|
|
8
|
+
|
|
9
|
+
## 1.x
|
|
10
|
+
|
|
11
|
+
- See commit history for incremental features (random engines, spatial trees, serialization converters, editor tools).
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping make Unity Helpers better! This project uses a few automated checks and formatters to keep the codebase consistent and easy to review.
|
|
4
|
+
|
|
5
|
+
## Formatting and Linting
|
|
6
|
+
|
|
7
|
+
- C# formatting: CSharpier (via dotnet tools)
|
|
8
|
+
- Markdown/JSON/YAML formatting: Prettier
|
|
9
|
+
- Markdown linting: markdownlint
|
|
10
|
+
- Link checks: lychee and custom script
|
|
11
|
+
- YAML linting: yamllint
|
|
12
|
+
|
|
13
|
+
### Dependabot PRs
|
|
14
|
+
|
|
15
|
+
Dependabot PRs are auto-formatted by CI. The bot pushes commits (same‑repo PRs) or opens a formatting PR (forked PRs) so they pass formatting gates.
|
|
16
|
+
|
|
17
|
+
### Opt‑In Formatting for Contributor PRs
|
|
18
|
+
|
|
19
|
+
If you want the bot to apply formatting to your PR:
|
|
20
|
+
|
|
21
|
+
- Comment on your PR with `/format` (aliases: `/autofix`, `/lint-fix`).
|
|
22
|
+
- If your branch is in this repo, the bot pushes a commit with fixes.
|
|
23
|
+
- If your PR is from a fork, the bot opens a formatting PR targeting the base branch.
|
|
24
|
+
- The commenter must be the PR author or a maintainer/collaborator.
|
|
25
|
+
- Or run manually from the Actions tab: select "Opt‑in Formatting", click "Run workflow", and enter the PR number.
|
|
26
|
+
|
|
27
|
+
What gets auto‑fixed:
|
|
28
|
+
|
|
29
|
+
- C# via CSharpier
|
|
30
|
+
- Markdown/JSON/YAML via Prettier
|
|
31
|
+
- Markdown lint via markdownlint with `--fix`
|
|
32
|
+
|
|
33
|
+
What does not auto‑fix:
|
|
34
|
+
|
|
35
|
+
- Broken links (lychee)
|
|
36
|
+
- YAML issues that require manual edits
|
|
37
|
+
|
|
38
|
+
## Run Checks Locally
|
|
39
|
+
|
|
40
|
+
- Install tools once:
|
|
41
|
+
- `npm ci` (or `npm i --no-audit --no-fund`)
|
|
42
|
+
- `dotnet tool restore`
|
|
43
|
+
- Format C#: `dotnet tool run CSharpier format`
|
|
44
|
+
- Check docs/JSON/YAML: `npm run validate:content`
|
|
45
|
+
- Enforce EOL/encoding: `npm run eol:check`
|
|
46
|
+
|
|
47
|
+
## Style and Naming
|
|
48
|
+
|
|
49
|
+
Please follow the conventions outlined in `.editorconfig` and the repository guidelines (PascalCase types, camelCase fields, explicit types, braces required, no regions).
|
package/EDITOR_TOOLS_GUIDE.md
CHANGED
|
@@ -1974,3 +1974,7 @@ All tools are designed to work together seamlessly and follow consistent design
|
|
|
1974
1974
|
For questions, issues, or feature requests, please contact the Wallstop Studios team.
|
|
1975
1975
|
|
|
1976
1976
|
- Integration note: The cache powers editor dropdowns and reflection shortcuts for the Effects system’s `AttributeModification.attribute` field. See [Effects System](EFFECTS_SYSTEM.md) for how attributes, effects, and tags fit together.
|
|
1977
|
+
|
|
1978
|
+
### MultiFile Selector (UI Toolkit)
|
|
1979
|
+
|
|
1980
|
+
- The `MultiFileSelectorElement` is primarily intended for Editor tooling. It can also be used in player builds, where it enumerates files under the application’s data root. In the Editor it integrates with `EditorPrefs` and Reveal-in-Finder; at runtime it falls back to `PlayerPrefs` and omits Editor-only affordances.
|