Skip to content

Commit 497e6bf

Browse files
committed
chore: wip
chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip
1 parent 0ff1506 commit 497e6bf

40 files changed

+203
-112
lines changed

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ faker:
136136
- any: ['.stacks/core/faker/**', '!.stacks/core/faker/package.json']
137137

138138
git:
139-
- any: ['.stacks/core/git/**', '!.stacks/core/git/package.json']:
139+
- any: ['.stacks/core/git/**', '!.stacks/core/git/package.json']
140140

141141
health:
142142
- any: ['.stacks/core/health/**', '!.stacks/core/health/package.json']

.npmignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

.stacks/core/actions/src/make.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,23 +295,26 @@ export async function createModel(options: MakeOptions) {
295295
try {
296296
await writeTextFile({
297297
path: `${path}`,
298-
data: `import { faker } from '../../.stacks/core/faker/src' // stacks/faker or
299-
import { validate } from '../../.stacks/core/validation/src' // stacks/validate or @stacksjs/validate
300-
import type { Model } from '../../.stacks/core/types/src' // stacks/types or @stacksjs/types
298+
data: `import { faker } from '@stacksjs/faker'
299+
import { validate } from '@stacksjs/validation'
300+
import type { Model } from '@stacksjs/types'
301301
302302
export default <Model> {
303303
name: '${name}',
304+
304305
searchable: true, // boolean | IndexSettings,
305306
authenticatable: true, // boolean | AuthSettings,
307+
306308
seeder: {
307309
count: 10,
308310
},
311+
309312
fields: {
310313
name: {
311-
type: 'String',
312314
validation: validate.string().min(3).max(255),
313315
factory: () => faker.person,
314316
},
317+
315318
// more fields here
316319
},
317320
}`,

.stacks/core/config/src/defaults.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export { default as app } from '../../../../config/app'
22
export { default as cache } from '../../../../config/cache'
33
export { default as cdn } from '../../../../config/cdn'
4-
export { default as cronJobs } from '../../../../app/jobs'
54
export { default as cli } from '../../../../config/cli'
65
export { default as database } from '../../../../config/database'
76
export { default as debug } from '../../../../config/debug'

.stacks/core/types/build.config.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ import { alias, defineBuildConfig } from '@stacksjs/development'
33

44
type Entries = BuildConfig['entries']
55
const devEntries: Entries = [{
6-
builder: 'mkdist',
7-
input: './src/',
8-
outDir: './dist/',
9-
}]
10-
const buildEntries = [{
11-
builder: 'mkdist',
12-
input: './src/',
6+
input: './src/index',
137
outDir: './dist/',
148
}]
9+
const buildEntries = devEntries
1510
const command = process.env.npm_lifecycle_script
1611
const entries: Entries = command?.includes('--stub') ? devEntries : buildEntries
1712

@@ -20,15 +15,10 @@ export default defineBuildConfig({
2015

2116
entries,
2217

23-
// externals: [
24-
// // '@vinejs/vine',
25-
// '@stacksjs/utils',
26-
// ],
27-
//
28-
// rollup: {
29-
// inlineDependencies: true,
30-
// },
18+
externals: [
19+
'@stacksjs/utils',
20+
],
3121

3222
clean: true,
33-
// declaration: true,
23+
declaration: true,
3424
})

.stacks/core/types/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424
],
2525
"exports": {
2626
".": {
27-
"types": "./dist/index.ts",
28-
"import": "./dist/index.ts"
27+
"types": "./dist/index.d.ts",
28+
"import": "./dist/index.mjs"
2929
},
3030
"./*": "./*"
3131
},
32-
"main": "dist/index.ts",
33-
"module": "dist/index.ts",
34-
"types": "dist/index.ts",
32+
"module": "dist/index.mjs",
33+
"types": "dist/index.d.ts",
3534
"contributors": [
3635
"Chris Breuer <chris@ow3.org>"
3736
],
@@ -40,7 +39,7 @@
4039
"README.md"
4140
],
4241
"scripts": {
43-
"build": "unbuild --stub",
42+
"build": "unbuild",
4443
"dev": "unbuild --stub",
4544
"prepublishOnly": "pnpm run build",
4645
"typecheck": "tsc --noEmit"

.stacks/core/types/src/cron-jobs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export interface JobOptions {
1313
enabled?: boolean
1414
timezone?: string
1515
active?: boolean
16+
tries?: number
17+
backoff?: number | number[]
1618
}
1719
export type Job = JobOptions
1820
export type Jobs = Job[]

.stacks/core/types/src/database.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import type { Model } from './model'
33
export type DatabaseClient = any
44

55
export interface DatabaseOptions {
6-
driver: string
6+
default: string
77

8-
drivers: {
8+
connections: {
99
mysql: {
1010
url?: string
1111
host?: string
@@ -14,11 +14,20 @@ export interface DatabaseOptions {
1414
name?: string
1515
username?: string
1616
password?: string
17+
prefix?: string
18+
}
19+
20+
sqlite: {
21+
url?: string
22+
database?: string
23+
prefix?: string
1724
}
1825

1926
planetscale: {}
2027
postgres: {}
2128
}
29+
30+
migrations: string
2231
}
2332

2433
export interface FactoryOptions {

.stacks/core/types/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export * from './pages'
2929
export * from './payments'
3030
export * from './promise'
3131
export * from './pwa'
32+
export * from './queue'
3233
export * from './reactivity'
3334
export * from './router'
3435
export * from './search-engine'

.stacks/core/types/src/queue.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export interface QueueOptions {
2+
default: 'sync' | 'database' | 'redis' | 'sqs'
3+
connections: {
4+
sync: {
5+
driver: 'sync'
6+
}
7+
database: {
8+
driver: 'database'
9+
table: 'jobs'
10+
queue: 'default'
11+
retry_after: 90
12+
}
13+
redis: {
14+
driver: 'redis'
15+
connection: 'default'
16+
queue: 'default'
17+
retry_after: 90
18+
}
19+
sqs: {
20+
driver: 'sqs'
21+
key: ''
22+
secret: ''
23+
prefix: ''
24+
suffix: ''
25+
queue: 'default'
26+
region: 'us-east-1'
27+
}
28+
}
29+
failed: {
30+
driver: 'database'
31+
database: 'mysql'
32+
table: 'failed_jobs'
33+
}
34+
}

0 commit comments

Comments
 (0)