@flatkit/compiler 0.1.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/LICENSE +21 -0
- package/bin/flatc.mjs +23 -0
- package/dist/chunk-EHQSVWOD.js +678 -0
- package/dist/chunk-EHQSVWOD.js.map +1 -0
- package/dist/cli/flatc.d.ts +3 -0
- package/dist/cli/flatc.js +7 -0
- package/dist/cli/flatc.js.map +1 -0
- package/dist/cli/render.d.ts +12 -0
- package/dist/cli/render.js +77 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/index.d.ts +117 -0
- package/dist/index.js +175 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zwyk Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/flatc.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// flatc binary entry point.
|
|
3
|
+
// DEV (workspace): tsx is installed and `@flatkit/*` resolve to TypeScript source → register tsx and
|
|
4
|
+
// run the source directly (no build needed for `pnpm flatc …`).
|
|
5
|
+
// PUBLISHED: tsx is not a dependency (and no `src/` is shipped) → fall back to the compiled
|
|
6
|
+
// `dist/cli/flatc.js`, where `@flatkit/*` resolve to their published JS.
|
|
7
|
+
import { fileURLToPath } from 'node:url'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
|
|
10
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
11
|
+
|
|
12
|
+
let run
|
|
13
|
+
try {
|
|
14
|
+
const { register } = await import('tsx/esm/api') // throws in a published install (tsx absent)
|
|
15
|
+
register()
|
|
16
|
+
;({ run } = await import(join(here, '../src/cli/flatc.ts'))) // throws if src/ was not shipped
|
|
17
|
+
} catch {
|
|
18
|
+
({ run } = await import(join(here, '../dist/cli/flatc.js')))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const code = await run(process.argv) // `--render` is async (SVG decode + raster)
|
|
22
|
+
// In --watch mode, `fs.watch` keeps the process alive: do not exit (otherwise we kill the watcher).
|
|
23
|
+
if (!process.argv.includes('--watch')) process.exit(code)
|