Skip to content

Commit 7bc7dca

Browse files
committed
refactor: Use resources directory as a build output directly
1 parent e8155e3 commit 7bc7dca

7 files changed

Lines changed: 17 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ jobs:
4949
- name: Build module
5050
run: npm run build
5151

52-
5352
- name: Generate zip file
5453
run: |
5554
outputName=evang-argonlight-$(cat version.txt)
5655
echo "outputName=$outputName" >> $GITHUB_ENV
57-
mv dist evang-argonlight
58-
zip -r "$outputName.zip" evang-argonlight
56+
git add .
57+
git archive -o "$outputName.zip" $(git stash create 2>/dev/null || git rev-parse HEAD)
5958
6059
- name: Upload build artifact
6160
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist/
55
node_modules/
66
package-lock.json
77
.idea/
8+
*.zip

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ This module is brought to you by [Evan Galli](https://github.com/06Games) under
2424
2. Unzip the file.
2525
3. Move the folder into your `webtrees/modules_v4` directory.
2626

27-
### Nightly version
27+
### Development version
2828

29-
1. Find the latest build from the [Actions tab](https://github.com/06Games/Webtrees-ArgonLight/actions/workflows/build.yml?query=is%3Asuccess).
30-
2. Download the artifact linked in the build summary.
31-
3. Unzip the file.
29+
1. Download the repository as [a zip file](https://github.com/06Games/Webtrees-ArgonLight/archive/refs/heads/main.zip).
30+
2. Unzip the file.
31+
3. Rename the resulting folder to `evang-argonlight`.
3232
4. Move the folder into your `webtrees/modules_v4` directory.
3333

3434
## Development
@@ -44,4 +44,4 @@ This module is brought to you by [Evan Galli](https://github.com/06Games) under
4444
npm run dev # For development
4545
npm run build # For production
4646
```
47-
4. The built module will be located in the `dist` directory. You can copy this folder to your `webtrees/modules_v4` directory to test it out.
47+
4. You can now copy the repo folder to your `webtrees/modules_v4` directory to test it out.

resources/css/fonts.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/css/imports.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/css/theme.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vite.config.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default defineConfig(({ command, mode }) => {
2323
},
2424

2525
build: {
26-
outDir: 'dist',
27-
emptyOutDir: true,
26+
outDir: 'resources',
27+
emptyOutDir: false,
2828
sourcemap: 'inline',
2929
minify: isProd,
3030
esbuild: {
@@ -37,23 +37,11 @@ export default defineConfig(({ command, mode }) => {
3737
'imports': path.resolve(__dirname, 'src/css/imports.css'),
3838
},
3939
output: {
40-
entryFileNames: `resources/js/[name].js`,
41-
chunkFileNames: `resources/js/[name].js`,
42-
assetFileNames: 'resources/[ext]/[name].[ext]'
40+
entryFileNames: `js/[name].js`,
41+
chunkFileNames: `js/[name].js`,
42+
assetFileNames: '[ext]/[name].[ext]'
4343
}
4444
}
45-
},
46-
47-
plugins: [
48-
viteStaticCopy({
49-
targets: [
50-
{ src: '*.php', dest: '.' },
51-
{ src: 'resources', dest: '.', overwrite: false },
52-
{ src: "README.md", dest: '.' },
53-
{ src: "LICENSE.md", dest: '.' },
54-
{ src: "composer.json", dest: '.' }
55-
]
56-
})
57-
].filter(Boolean)
45+
}
5846
};
5947
});

0 commit comments

Comments
 (0)