Skip to content

Commit

Permalink
Merge pull request #27 from savannabits/2.x-dev
Browse files Browse the repository at this point in the history
## 2.x dev - Full Re-Write of the package, with bug fixes:

### Improvements and Fixes:
1. Dark mode is now enabled on the fly for the FilamentPHP admin panel.
2. The package can now be used in standalone forms outside the filament admin panel. Fixes #1, #2, #6, #23
3. Almost all of Flatpickr's native configuration is now supported out of the box through a fluent interface. Fixes #10, #11, #24
3. Alpine.js component is now loading lazily using async-alpine
  • Loading branch information
coolsam726 committed Jul 27, 2023
2 parents 8a9ad28 + 7929d13 commit f680fbe
Show file tree
Hide file tree
Showing 276 changed files with 1,358 additions and 23,529 deletions.
50 changes: 50 additions & 0 deletions bin/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import * as esbuild from 'esbuild'

const isDev = process.argv.includes('--dev')

async function compile(options) {
const context = await esbuild.context(options)

if (isDev) {
await context.watch()
} else {
await context.rebuild()
await context.dispose()
}
}

const defaultOptions = {
define: {
'process.env.NODE_ENV': isDev ? `'development'` : `'production'`,
},
bundle: true,
mainFields: ['module', 'main'],
platform: 'neutral',
sourcemap: isDev ? 'inline' : false,
sourcesContent: isDev,
treeShaking: true,
target: ['es2020'],
minify: !isDev,
plugins: [{
name: 'watchPlugin',
setup: function (build) {
build.onStart(() => {
console.log(`Build started at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
})

build.onEnd((result) => {
if (result.errors.length > 0) {
console.log(`Build failed at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`, result.errors)
} else {
console.log(`Build finished at ${new Date(Date.now()).toLocaleTimeString()}: ${build.initialOptions.outfile}`)
}
})
}
}],
}

compile({
...defaultOptions,
entryPoints: ['./resources/js/components/datepicker.js'],
outfile: './resources/dist/js/components/datepicker.js',
})
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"filament/filament": "^2.15",
"illuminate/contracts": ">=8.0",
"spatie/laravel-package-tools": "^1.9.2"
Expand Down
Loading

0 comments on commit f680fbe

Please sign in to comment.