Skip to content

Commit fee5cb7

Browse files
committed
Fix theme of tree, and the scipt for building assets
1 parent 7460013 commit fee5cb7

10 files changed

+2162
-4715
lines changed

.gitattributes

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/.idea export-ignore
9+
/.prettierrc export-ignore
10+
/.package-lock.json export-ignore
11+
/.editorconfig export-ignore
12+
/.php_cs.dist.php export-ignore
13+
/.vscode export-ignore
14+
/art export-ignore
15+
/docs export-ignore
16+
/images export-ignore
17+
/tests export-ignore
18+
/package.json export-ignore
19+
/phpstan-baseline.neon export-ignore
20+
/phpstan.neon.dist export-ignore
21+
/postcss.config.js export-ignore
22+
/phpunit.xml.dist export-ignore
23+
/pint.json export-ignore
24+
/psalm.xml export-ignore
25+
/psalm.xml.dist export-ignore
26+
/tailwind.config.js export-ignore
27+
/testbench.yaml export-ignore
28+
/UPGRADING.md export-ignore

.gitignore

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
.DS_Store
12
.idea
23
.phpunit.result.cache
4+
.vscode
35
build
46
composer.lock
57
coverage
8+
docs
9+
node_modules
610
phpunit.xml
711
phpstan.neon
812
testbench.yaml
9-
vendor
10-
node_modules
11-
/build/
13+
vendor

bin/build.js

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import esbuild from 'esbuild'
2+
3+
const isDev = process.argv.includes('--dev')
4+
5+
async function compile(options) {
6+
const context = await esbuild.context(options)
7+
8+
if (isDev) {
9+
await context.watch()
10+
} else {
11+
await context.rebuild()
12+
await context.dispose()
13+
}
14+
}
15+
16+
const defaultOptions = {
17+
define: {
18+
'process.env.NODE_ENV': isDev ? `'development'` : `'production'`,
19+
},
20+
bundle: true,
21+
mainFields: ['module', 'main'],
22+
platform: 'neutral',
23+
sourcemap: isDev ? 'inline' : false,
24+
sourcesContent: isDev,
25+
treeShaking: true,
26+
target: ['es2020'],
27+
minify: !isDev,
28+
plugins: [{
29+
name: 'watchPlugin',
30+
setup: function (build) {
31+
build.onStart(() => {
32+
console.log(`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
33+
})
34+
35+
build.onEnd((result) => {
36+
if (result.errors.length > 0) {
37+
console.log(`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`, result.errors)
38+
} else {
39+
console.log(`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
40+
}
41+
})
42+
}
43+
}],
44+
}
45+
46+
compile({
47+
...defaultOptions,
48+
entryPoints: ['./resources/js/plugin.js'],
49+
outfile: './resources/dist/filament-tree.js',
50+
})

0 commit comments

Comments
 (0)