Skip to content

Commit 26b104a

Browse files
committed
chore: wip
chore: wip chore: wip
1 parent ac4c555 commit 26b104a

File tree

12 files changed

+204
-4
lines changed

12 files changed

+204
-4
lines changed

bunfig.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# preload these modules before running bun
2-
preload = [ "./resources/preloader/main.ts" ]
2+
preload = [ "./resources/plugins/main.ts" ]
33

44
[test]
55
preload = [ "./tests/setup.ts" ]

config/stacks.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { Registry } from '@stacksjs/registry'
2+
3+
/**
4+
* **Stacks**
5+
*
6+
* This configuration defines all of your "stacks." Because the framework is fully-typed, you
7+
* may hover any of the options below and the definitions will be provided. In case you
8+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
9+
*/
10+
export default [
11+
{
12+
name: 'my-stack',
13+
url: 'stacksjs.org',
14+
github: 'stacksjs/my-stack',
15+
},
16+
// 'stacksjs' // works as well
17+
] satisfies Registry
File renamed without changes.

resources/plugins/vite.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { VitePlugin } from '@stacksjs/plugins'
2+
3+
/**
4+
* In case you need flexibility, Stacks plugins can provide you with a
5+
* granular configugration. For example, watchers, transformers, and
6+
* hooks are available to you to customize your build process.
7+
*/
8+
export function plugin(): VitePlugin {
9+
return {
10+
name: 'stacks-integration',
11+
12+
// BuildStart hook before the build starts
13+
// buildStart(options) {
14+
// console.log('BuildStart hook with options:', options)
15+
// },
16+
17+
// Load hook for loading individual files
18+
// async load(id) {
19+
// return null // Return null to let Vite handle the file loading
20+
// },
21+
22+
// async resolveId(source, importer) {
23+
// resolveId() {
24+
// return null // Return null to let Vite handle the module resolution
25+
// },
26+
27+
// Transform hook for transforming individual files
28+
// async transform(code, id) {
29+
// return code // Return the unmodified code
30+
// },
31+
}
32+
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import type { BunPlugin } from 'bun'
2+
import type { Plugin as VitePlugin } from 'vite'
23
import { plugin } from 'bun'
34

45
export { plugin }
5-
export type { BunPlugin }
6+
export type { BunPlugin, VitePlugin }
67

7-
// TODO: addStack
8+
export function addStack(name: string) {
9+
// Add a stack to the stack list
10+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Stacks Registry
2+
3+
Where stacks are defined.
4+
5+
## ☘️ Features
6+
7+
- Allows for `buddy add <stack>` to install a stack from the registry
8+
9+
## 🤖 Usage
10+
11+
```bash
12+
bun install -d @stacksjs/registry
13+
```
14+
15+
```js
16+
import type { Registry } from '@stacksjs/registry'
17+
import { registry } from '@stacksjs/registry'
18+
19+
console.log(registry) // the Registry as an object
20+
```
21+
22+
To view the full documentation, please visit [https://stacksjs.org/path](https://stacksjs.org/path).
23+
24+
## 🧪 Testing
25+
26+
```bash
27+
bun test
28+
```
29+
30+
## 📈 Changelog
31+
32+
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
33+
34+
## 🚜 Contributing
35+
36+
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
37+
38+
## 🏝 Community
39+
40+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
41+
42+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
43+
44+
For casual chit-chat with others using this package:
45+
46+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
47+
48+
## 🙏🏼 Credits
49+
50+
Many thanks to the following core technologies & people who have contributed to this package:
51+
52+
- [Chris Breuer](https://github.com/chrisbbreuer)
53+
- [All Contributors](../../contributors)
54+
55+
## 📄 License
56+
57+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
58+
59+
Made with 💙
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { dts } from 'bun-plugin-dts-auto'
2+
import { intro, outro } from '../build/src'
3+
4+
const { startTime } = await intro({
5+
dir: import.meta.dir,
6+
})
7+
8+
const result = await Bun.build({
9+
entrypoints: ['./src/index.ts'],
10+
outdir: './dist',
11+
format: 'esm',
12+
target: 'bun',
13+
// sourcemap: 'linked',
14+
minify: true,
15+
plugins: [
16+
dts({
17+
root: './src',
18+
outdir: './dist',
19+
}),
20+
],
21+
})
22+
23+
await outro({
24+
dir: import.meta.dir,
25+
startTime,
26+
result,
27+
})
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "@stacksjs/registry",
3+
"type": "module",
4+
"version": "0.67.0",
5+
"description": "The Stacks Registry.",
6+
"author": "Chris Breuer",
7+
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
8+
"license": "MIT",
9+
"funding": "https://github.com/sponsors/chrisbbreuer",
10+
"homepage": "https://github.com/stacksjs/stacks/tree/main/registry/framework/core/registry#readme",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/stacksjs/stacks.git",
14+
"directory": "./storage/framework/core/registry"
15+
},
16+
"bugs": {
17+
"url": "https://github.com/stacksjs/stacks/issues"
18+
},
19+
"keywords": ["registry", "stacks"],
20+
"exports": {
21+
".": {
22+
"import": "./dist/index.js"
23+
}
24+
},
25+
"module": "dist/index.js",
26+
"types": "dist/index.d.ts",
27+
"files": ["README.md", "dist"],
28+
"scripts": {
29+
"build": "bun build.ts",
30+
"typecheck": "bun tsc --noEmit",
31+
"prepublishOnly": "bun run build"
32+
},
33+
"devDependencies": {
34+
"@stacksjs/development": "workspace:*"
35+
}
36+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export type Registry = {
2+
name: string
3+
url: string
4+
github: string
5+
// bitbucket: string
6+
// gitlab: string
7+
}[]
8+
9+
export const registry: Registry = [
10+
{
11+
name: 'stacks',
12+
url: 'stacksjs.org',
13+
github: 'stacksjs/stacks',
14+
// bitbucket: 'stacksjs/stacks',
15+
// gitlab: 'stacksjs/stacks'
16+
}
17+
]
18+
19+
export default registry
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('example test', () => {
2+
it('assert', () => {
3+
expect(1).toBe(1)
4+
})
5+
})

0 commit comments

Comments
 (0)