stacks 0.58.48 → 0.58.50
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/core/actions/dist/src/generate/ide-helpers.js +1 -0
- package/core/actions/dist/src/generate/lib-entries.js +4 -2
- package/core/actions/dist/src/generate/vscode-custom-data.js +1 -0
- package/core/actions/dist/src/helpers/lib-entries.js +1 -0
- package/core/actions/dist/src/helpers/package-json.js +1 -0
- package/core/actions/dist/src/helpers/vscode-custom-data.js +1 -0
- package/core/actions/dist/src/index.js +2 -0
- package/core/actions/dist/src/release.js +2 -0
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +3 -2
- package/core/actions/src/action.ts +2 -0
- package/core/actions/src/generate/custom-cli-file.ts +24 -0
- package/core/actions/src/generate/lib-entries.ts +3 -2
- package/core/ai/dist/index.js +6 -6
- package/core/ai/package.json +5 -4
- package/core/alias/package.json +3 -2
- package/core/analytics/package.json +3 -2
- package/core/api/package.json +3 -2
- package/core/arrays/package.json +3 -2
- package/core/auth/package.json +3 -2
- package/core/buddy/dist/{chunk-b32089b9556f373c.js → chunk-91084836e95161e8.js} +1 -1
- package/core/buddy/dist/cli.js +13 -1
- package/core/buddy/dist/index.js +1 -1
- package/core/buddy/package.json +3 -2
- package/core/buddy/src/cli.ts +17 -0
- package/core/buddy/src/commands/deploy.ts +1 -1
- package/core/buddy/src/custom-cli.ts +36 -0
- package/core/build/package.json +3 -2
- package/core/bun-create/bud/package.json +3 -2
- package/core/bun-create/buddy/package.json +3 -2
- package/core/bun-create/stack/package.json +3 -2
- package/core/bun-create/stacks/package.json +3 -2
- package/core/bun-create/stx/package.json +3 -2
- package/core/bun-plugin-yaml/dist/index.js +1 -1
- package/core/bun-plugin-yaml/package.json +3 -2
- package/core/bun-plugin-yaml/src/index.ts +1 -1
- package/core/cache/package.json +4 -3
- package/core/chat/package.json +3 -2
- package/core/cli/dist/index.js +2 -2
- package/core/cli/package.json +3 -2
- package/core/cli/src/cli.ts +1 -1
- package/core/cloud/deploy.ts +2 -2
- package/core/cloud/dist/index.js +144 -60
- package/core/cloud/package.json +34 -33
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
- package/core/cloud/src/cloud/cdn.ts +5 -5
- package/core/cloud/src/cloud/compute.ts +150 -28
- package/core/cloud/src/cloud/index.ts +13 -9
- package/core/cloud/src/cloud/network.ts +4 -24
- package/core/cloud/src/cloud/package/README.md +59 -0
- package/core/cloud/src/cloud/package/package.json +63 -0
- package/core/cloud/src/cloud/router-layer/nodejs/package.json +15 -0
- package/core/cloud/src/runtime/example/lambda.ts +1 -1
- package/core/cloud/src/runtime/server.ts +1 -1
- package/core/collections/package.json +3 -2
- package/core/config/dist/index.js +14 -12
- package/core/config/package.json +2 -2
- package/core/config/src/config.ts +1 -1
- package/core/config/src/defaults.ts +3 -3
- package/core/config/src/overrides.ts +22 -22
- package/core/database/package.json +3 -2
- package/core/database/src/kysely-bun-worker/worker.ts +1 -1
- package/core/datetime/package.json +3 -2
- package/core/desktop/package.json +3 -2
- package/core/development/package.json +1 -1
- package/core/dns/package.json +9 -8
- package/core/docs/package.json +5 -4
- package/core/email/dist/index.js +0 -38
- package/core/email/package.json +5 -4
- package/core/email/src/send.ts +3 -3
- package/core/enums/package.json +1 -1
- package/core/env/package.json +1 -1
- package/core/error-handling/package.json +3 -2
- package/core/eslint-config/package.json +4 -4
- package/core/events/package.json +3 -2
- package/core/faker/package.json +3 -2
- package/core/git/package.json +3 -2
- package/core/health/package.json +3 -2
- package/core/http/package.json +3 -2
- package/core/lint/package.json +5 -4
- package/core/logging/package.json +3 -2
- package/core/notifications/package.json +3 -2
- package/core/objects/package.json +3 -2
- package/core/orm/package.json +3 -2
- package/core/path/package.json +3 -2
- package/core/payments/package.json +3 -2
- package/core/push/package.json +3 -2
- package/core/query-builder/package.json +3 -2
- package/core/queue/dist/index.js +3 -1
- package/core/queue/package.json +3 -2
- package/core/queue/src/index.ts +4 -2
- package/core/raycast/package.json +1 -1
- package/core/realtime/package.json +3 -2
- package/core/repl/package.json +3 -2
- package/core/router/package.json +3 -2
- package/core/scheduler/dist/index.js +3 -2
- package/core/scheduler/package.json +3 -2
- package/core/scheduler/src/index.ts +1 -1
- package/core/search-engine/package.json +3 -2
- package/core/security/package.json +3 -2
- package/core/server/package.json +3 -2
- package/core/signals/package.json +3 -2
- package/core/slug/package.json +3 -2
- package/core/sms/package.json +3 -2
- package/core/storage/package.json +3 -2
- package/core/storage/src/files.ts +1 -1
- package/core/storage/src/zip.ts +1 -1
- package/core/strings/package.json +3 -2
- package/core/tables/package.json +1 -1
- package/core/testing/package.json +5 -4
- package/core/tinker/package.json +3 -2
- package/core/tsconfig.json +1 -0
- package/core/tunnel/package.json +3 -2
- package/core/types/package.json +6 -5
- package/core/types/src/api.ts +2 -0
- package/core/types/src/cli.ts +2 -2
- package/core/types/src/cron-jobs.ts +2 -1
- package/core/types/src/library.ts +2 -0
- package/core/types/src/stacks.ts +6 -6
- package/core/ui/package.json +6 -5
- package/core/utils/dist/index.js +1 -1
- package/core/utils/package.json +3 -2
- package/core/validation/package.json +3 -2
- package/core/vite/dist/index.js +1 -1
- package/core/vite/package.json +3 -2
- package/core/whois/package.json +3 -2
- package/core/x-ray/package.json +3 -2
- package/core/zsh-buddy/package.json +1 -1
- package/ide/dictionary.txt +1 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* eslint-disable no-new */
|
|
2
|
-
import type { aws_certificatemanager as acm,
|
|
3
|
-
import { Duration, CfnOutput as Output,
|
|
2
|
+
import type { aws_certificatemanager as acm, aws_efs as efs, aws_lambda as lambda, aws_route53 as route53 } from 'aws-cdk-lib'
|
|
3
|
+
import { Duration, CfnOutput as Output, RemovalPolicy, aws_ec2 as ec2, aws_ecs as ecs, aws_secretsmanager as secretsmanager } from 'aws-cdk-lib'
|
|
4
4
|
import type { Construct } from 'constructs'
|
|
5
5
|
import { path as p } from '@stacksjs/path'
|
|
6
6
|
import { env } from '@stacksjs/env'
|
|
7
|
+
import { LogGroup } from 'aws-cdk-lib/aws-logs'
|
|
8
|
+
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'
|
|
7
9
|
import type { NestedCloudProps } from '../types'
|
|
8
10
|
import type { EnvKey } from '../../../../env'
|
|
9
11
|
|
|
@@ -15,6 +17,7 @@ export interface ComputeStackProps extends NestedCloudProps {
|
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export class ComputeStack {
|
|
20
|
+
lb: elbv2.ApplicationLoadBalancer
|
|
18
21
|
apiServer: lambda.Function
|
|
19
22
|
apiServerUrl: lambda.FunctionUrl
|
|
20
23
|
|
|
@@ -25,22 +28,149 @@ export class ComputeStack {
|
|
|
25
28
|
if (!fileSystem)
|
|
26
29
|
throw new Error('The file system is missing. Please make sure it was created properly.')
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
const cluster = new ecs.Cluster(scope, 'StacksCluster', {
|
|
32
|
+
clusterName: `${props.slug}-${props.appEnv}-web-server-cluster`,
|
|
33
|
+
vpc,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const taskDefinition = new ecs.FargateTaskDefinition(scope, 'TaskDefinition', {
|
|
37
|
+
family: `${props.appName}-${props.appEnv}-api`,
|
|
38
|
+
memoryLimitMiB: 512, // Match your Lambda memory size
|
|
39
|
+
cpu: 256, // Choose an appropriate value
|
|
40
|
+
runtimePlatform: {
|
|
41
|
+
cpuArchitecture: ecs.CpuArchitecture.ARM64,
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const container = taskDefinition.addContainer('WebServerContainer', {
|
|
46
|
+
containerName: `${props.appName}-${props.appEnv}-api`,
|
|
47
|
+
image: ecs.ContainerImage.fromAsset(p.frameworkPath('server')),
|
|
48
|
+
logging: new ecs.AwsLogDriver({
|
|
49
|
+
streamPrefix: `${props.appName}-${props.appEnv}-web`,
|
|
50
|
+
logGroup: new LogGroup(scope, 'StacksApiLogs', {
|
|
51
|
+
logGroupName: '/ecs/stacks-api',
|
|
52
|
+
removalPolicy: RemovalPolicy.DESTROY, // Automatically remove logs on stack deletion
|
|
53
|
+
}),
|
|
54
|
+
}),
|
|
55
|
+
healthCheck: {
|
|
56
|
+
command: ['CMD-SHELL', 'curl -f http://localhost:3000/health || exit 1'],
|
|
57
|
+
interval: Duration.seconds(10),
|
|
58
|
+
timeout: Duration.seconds(5),
|
|
59
|
+
retries: 3,
|
|
60
|
+
startPeriod: Duration.seconds(10),
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
container.addPortMappings({
|
|
65
|
+
containerPort: 3000,
|
|
66
|
+
hostPort: 3000,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const serviceSecurityGroup = new ec2.SecurityGroup(scope, 'ServiceSecurityGroup', {
|
|
70
|
+
securityGroupName: `${props.appName}-${props.appEnv}-api-service-sg`,
|
|
71
|
+
vpc,
|
|
72
|
+
description: 'Stacks Security Group for API Service',
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const publicLoadBalancerSG = new ec2.SecurityGroup(scope, 'PublicLoadBalancerSG', {
|
|
76
|
+
securityGroupName: `${props.appName}-${props.appEnv}-public-load-balancer-sg`,
|
|
77
|
+
vpc,
|
|
78
|
+
description: 'Access to the public facing load balancer',
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// Assuming serviceSecurityGroup and publicLoadBalancerSG are already defined
|
|
82
|
+
serviceSecurityGroup.addIngressRule(
|
|
83
|
+
publicLoadBalancerSG,
|
|
84
|
+
ec2.Port.allTraffic(),
|
|
85
|
+
'Ingress from the public ALB',
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
// Assuming serviceSecurityGroup and publicLoadBalancerSG are already defined
|
|
89
|
+
serviceSecurityGroup.addIngressRule(publicLoadBalancerSG, ec2.Port.allTraffic(), 'Ingress from the public ALB')
|
|
90
|
+
|
|
91
|
+
this.lb = new elbv2.ApplicationLoadBalancer(scope, 'ApplicationLoadBalancer', {
|
|
92
|
+
loadBalancerName: `${props.appName}-${props.appEnv}-alb`,
|
|
93
|
+
vpc,
|
|
94
|
+
vpcSubnets: {
|
|
95
|
+
subnets: vpc.selectSubnets({
|
|
96
|
+
subnetType: ec2.SubnetType.PUBLIC,
|
|
97
|
+
onePerAz: true,
|
|
98
|
+
}).subnets,
|
|
99
|
+
},
|
|
100
|
+
internetFacing: true,
|
|
101
|
+
idleTimeout: Duration.seconds(30),
|
|
102
|
+
securityGroup: publicLoadBalancerSG,
|
|
103
|
+
})
|
|
31
104
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
description: 'The web server for the Stacks application',
|
|
35
|
-
code: lambda.Code.fromAssetImage(p.frameworkPath('server')),
|
|
36
|
-
handler: lambda.Handler.FROM_IMAGE,
|
|
37
|
-
runtime: lambda.Runtime.FROM_IMAGE,
|
|
105
|
+
const serviceTargetGroup = new elbv2.ApplicationTargetGroup(scope, 'ServiceTargetGroup', {
|
|
106
|
+
// targetGroupName: `${props.appName}-${props.appEnv}-service-tg`,
|
|
38
107
|
vpc,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
108
|
+
targetType: elbv2.TargetType.IP,
|
|
109
|
+
protocol: elbv2.ApplicationProtocol.HTTP,
|
|
110
|
+
port: 3000,
|
|
111
|
+
healthCheck: {
|
|
112
|
+
interval: Duration.seconds(6),
|
|
113
|
+
path: '/',
|
|
114
|
+
protocol: elbv2.Protocol.HTTP,
|
|
115
|
+
timeout: Duration.seconds(5),
|
|
116
|
+
healthyThresholdCount: 2,
|
|
117
|
+
unhealthyThresholdCount: 10,
|
|
118
|
+
},
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const service = new ecs.FargateService(scope, 'StacksApiService', {
|
|
122
|
+
serviceName: `${props.appName}-${props.appEnv}-api-service`,
|
|
123
|
+
cluster,
|
|
124
|
+
taskDefinition,
|
|
125
|
+
desiredCount: 2,
|
|
126
|
+
assignPublicIp: true,
|
|
127
|
+
maxHealthyPercent: 200,
|
|
128
|
+
vpcSubnets: vpc.selectSubnets({
|
|
129
|
+
subnetType: ec2.SubnetType.PUBLIC,
|
|
130
|
+
onePerAz: true,
|
|
131
|
+
}),
|
|
132
|
+
minHealthyPercent: 75,
|
|
133
|
+
securityGroups: [serviceSecurityGroup],
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
service.attachToApplicationTargetGroup(serviceTargetGroup)
|
|
137
|
+
publicLoadBalancerSG.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.allTraffic())
|
|
138
|
+
|
|
139
|
+
this.lb.addListener('HttpListener', {
|
|
140
|
+
port: 80,
|
|
141
|
+
defaultAction: elbv2.ListenerAction.forward([serviceTargetGroup]),
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
props.fileSystem.connections.allowFromAnyIpv4(ec2.Port.tcp(2049)) // port 2049 (NFS) for EFS
|
|
145
|
+
|
|
146
|
+
const volumeName = `${props.slug}-${props.appEnv}-efs`
|
|
147
|
+
taskDefinition.addVolume({
|
|
148
|
+
name: volumeName,
|
|
149
|
+
efsVolumeConfiguration: {
|
|
150
|
+
fileSystemId: props.fileSystem.fileSystemId,
|
|
151
|
+
},
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
container.addMountPoints({
|
|
155
|
+
sourceVolume: volumeName,
|
|
156
|
+
containerPath: '/mnt/efs',
|
|
157
|
+
readOnly: false,
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
// Setup AutoScaling policy
|
|
161
|
+
// TODO: make this configurable in cloud.compute
|
|
162
|
+
const scaling = service.autoScaleTaskCount({ maxCapacity: 2 })
|
|
163
|
+
|
|
164
|
+
scaling.scaleOnCpuUtilization('CpuScaling', {
|
|
165
|
+
targetUtilizationPercent: 50,
|
|
166
|
+
scaleInCooldown: Duration.seconds(60),
|
|
167
|
+
scaleOutCooldown: Duration.seconds(60),
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
scaling.scaleOnMemoryUtilization('MemoryScaling', {
|
|
171
|
+
targetUtilizationPercent: 60,
|
|
172
|
+
scaleInCooldown: Duration.seconds(60),
|
|
173
|
+
scaleOutCooldown: Duration.seconds(60),
|
|
44
174
|
})
|
|
45
175
|
|
|
46
176
|
const keysToRemove = ['_HANDLER', '_X_AMZN_TRACE_ID', 'AWS_REGION', 'AWS_EXECUTION_ENV', 'AWS_LAMBDA_FUNCTION_NAME', 'AWS_LAMBDA_FUNCTION_MEMORY_SIZE', 'AWS_LAMBDA_FUNCTION_VERSION', 'AWS_LAMBDA_INITIALIZATION_TYPE', 'AWS_LAMBDA_LOG_GROUP_NAME', 'AWS_LAMBDA_LOG_STREAM_NAME', 'AWS_ACCESS_KEY', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_SESSION_TOKEN', 'AWS_LAMBDA_RUNTIME_API', 'LAMBDA_TASK_ROOT', 'LAMBDA_RUNTIME_DIR', '_']
|
|
@@ -55,16 +185,8 @@ export class ComputeStack {
|
|
|
55
185
|
},
|
|
56
186
|
})
|
|
57
187
|
|
|
58
|
-
secrets.grantRead(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
this.apiServerUrl = new lambda.FunctionUrl(scope, 'StacksServerUrl', {
|
|
62
|
-
function: this.apiServer,
|
|
63
|
-
authType: lambda.FunctionUrlAuthType.NONE, // becomes a public API
|
|
64
|
-
cors: {
|
|
65
|
-
allowedOrigins: ['*'],
|
|
66
|
-
},
|
|
67
|
-
})
|
|
188
|
+
secrets.grantRead(service.taskDefinition.executionRole!)
|
|
189
|
+
container.addEnvironment('SECRETS_ARN', secrets.secretArn)
|
|
68
190
|
|
|
69
191
|
const apiPrefix = 'api'
|
|
70
192
|
new Output(scope, 'ApiUrl', {
|
|
@@ -73,8 +195,8 @@ export class ComputeStack {
|
|
|
73
195
|
})
|
|
74
196
|
|
|
75
197
|
new Output(scope, 'ApiVanityUrl', {
|
|
76
|
-
value: this.
|
|
77
|
-
description: 'The Vanity URL of the
|
|
198
|
+
value: `http://${this.lb.loadBalancerDnsName}`,
|
|
199
|
+
description: 'The Vanity URL / DNS name of the load balancer',
|
|
78
200
|
})
|
|
79
201
|
}
|
|
80
202
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-new */
|
|
2
2
|
import { Stack } from 'aws-cdk-lib'
|
|
3
3
|
import type { Construct } from 'constructs'
|
|
4
|
+
import { config } from '@stacksjs/config'
|
|
4
5
|
import type { CloudOptions } from '../types'
|
|
5
6
|
import { AiStack } from './ai'
|
|
6
7
|
import { CdnStack } from './cdn'
|
|
@@ -62,13 +63,16 @@ export class Cloud extends Stack {
|
|
|
62
63
|
|
|
63
64
|
// new DashboardStack(this)
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
let api
|
|
67
|
+
if (config.cloud.api?.deploy) {
|
|
68
|
+
api = new ComputeStack(this, {
|
|
69
|
+
...props,
|
|
70
|
+
vpc: network.vpc,
|
|
71
|
+
fileSystem: fileSystem.fileSystem,
|
|
72
|
+
zone: dns.zone,
|
|
73
|
+
certificate: security.certificate,
|
|
74
|
+
})
|
|
75
|
+
}
|
|
72
76
|
|
|
73
77
|
const ai = new AiStack(this, props)
|
|
74
78
|
|
|
@@ -82,11 +86,11 @@ export class Cloud extends Stack {
|
|
|
82
86
|
firewall: security.firewall,
|
|
83
87
|
originRequestFunction: docs.originRequestFunction,
|
|
84
88
|
zone: dns.zone,
|
|
85
|
-
webServer: api.apiServer,
|
|
86
|
-
webServerUrl: api.apiServerUrl,
|
|
87
89
|
cliSetupUrl: cli.cliSetupUrl,
|
|
88
90
|
askAiUrl: ai.askAiUrl,
|
|
89
91
|
summarizeAiUrl: ai.summarizeAiUrl,
|
|
92
|
+
webServer: api?.apiServer,
|
|
93
|
+
webServerUrl: api?.apiServerUrl,
|
|
90
94
|
})
|
|
91
95
|
|
|
92
96
|
new DeploymentStack(this, {
|
|
@@ -17,34 +17,14 @@ export class NetworkStack {
|
|
|
17
17
|
natGateways: 0,
|
|
18
18
|
subnetConfiguration: [
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
name: `${props.slug}-${props.appEnv}-public-subnet-1`,
|
|
20
|
+
name: 'public-subnet-1',
|
|
22
21
|
subnetType: ec2.SubnetType.PUBLIC,
|
|
22
|
+
cidrMask: 24,
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
|
|
26
|
-
name: `${props.slug}-${props.appEnv}-public-subnet-2`,
|
|
27
|
-
subnetType: ec2.SubnetType.PUBLIC,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
cidrMask: 21,
|
|
31
|
-
name: `${props.slug}-${props.appEnv}-public-subnet-3`,
|
|
32
|
-
subnetType: ec2.SubnetType.PUBLIC,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
cidrMask: 21,
|
|
36
|
-
name: `${props.slug}-${props.appEnv}-private-subnet-1`,
|
|
37
|
-
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
cidrMask: 21,
|
|
41
|
-
name: `${props.slug}-${props.appEnv}-private-subnet-2`,
|
|
42
|
-
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
cidrMask: 21,
|
|
46
|
-
name: `${props.slug}-${props.appEnv}-private-subnet-3`,
|
|
25
|
+
name: 'private-subnet-1',
|
|
47
26
|
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
|
27
|
+
cidrMask: 28,
|
|
48
28
|
},
|
|
49
29
|
],
|
|
50
30
|
})
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Stacks Router
|
|
2
|
+
|
|
3
|
+
This package contains the Stacks Router.
|
|
4
|
+
|
|
5
|
+
## ☘️ Features
|
|
6
|
+
|
|
7
|
+
wip
|
|
8
|
+
|
|
9
|
+
- ⚡️
|
|
10
|
+
|
|
11
|
+
wip
|
|
12
|
+
|
|
13
|
+
## 🤖 Usage
|
|
14
|
+
|
|
15
|
+
wip
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun install -d @stacksjs/actions
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Now, you can use it in your project:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import * as router from '@stacksjs/router'
|
|
25
|
+
|
|
26
|
+
// wip
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Learn more in the docs.
|
|
30
|
+
|
|
31
|
+
## 🧪 Testing
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
bun test
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 📈 Changelog
|
|
38
|
+
|
|
39
|
+
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
|
|
40
|
+
|
|
41
|
+
## 🚜 Contributing
|
|
42
|
+
|
|
43
|
+
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
|
|
44
|
+
|
|
45
|
+
## 🏝 Community
|
|
46
|
+
|
|
47
|
+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
48
|
+
|
|
49
|
+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
|
|
50
|
+
|
|
51
|
+
For casual chit-chat with others using this package:
|
|
52
|
+
|
|
53
|
+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
|
|
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 💙
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stacksjs/router",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.58.50",
|
|
5
|
+
"description": "The Stacks framework router.",
|
|
6
|
+
"author": "Chris Breuer",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
9
|
+
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/router#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
13
|
+
"directory": "./storage/framework/core/router"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/stacksjs/stacks/issues"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"router",
|
|
20
|
+
"stacks",
|
|
21
|
+
"framework",
|
|
22
|
+
"typescript",
|
|
23
|
+
"javascript"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"bun": "./src/index.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./*": {
|
|
31
|
+
"bun": "./src/*",
|
|
32
|
+
"import": "./dist/*"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"module": "dist/index.js",
|
|
36
|
+
"types": "dist/index.d.ts",
|
|
37
|
+
"contributors": [
|
|
38
|
+
"Chris Breuer <chris@stacksjs.org>"
|
|
39
|
+
],
|
|
40
|
+
"files": [
|
|
41
|
+
"README.md",
|
|
42
|
+
"dist",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "bun --bun build.ts",
|
|
47
|
+
"typecheck": "bun --bun tsc --noEmit",
|
|
48
|
+
"prepublishOnly": "bun --bun run build"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@stacksjs/config": "latest",
|
|
52
|
+
"unplugin-vue-router": "^0.7.0",
|
|
53
|
+
"vue-router": "^4.2.5"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@stacksjs/config": "latest",
|
|
57
|
+
"unplugin-vue-router": "^0.7.0",
|
|
58
|
+
"vue-router": "^4.2.5"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@stacksjs/development": "latest"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stacks-router-layer",
|
|
3
|
+
"version": "0.58.50",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [],
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@stacksjs/router": "^0.58.49"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/collections",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.50",
|
|
5
5
|
"description": "The Stacks collections.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
],
|
|
42
42
|
"files": [
|
|
43
43
|
"README.md",
|
|
44
|
-
"dist"
|
|
44
|
+
"dist",
|
|
45
|
+
"src"
|
|
45
46
|
],
|
|
46
47
|
"scripts": {
|
|
47
48
|
"build": "bun --bun build.ts",
|
|
@@ -253,14 +253,14 @@ __export(exports_config, {
|
|
|
253
253
|
return cloud2;
|
|
254
254
|
}
|
|
255
255
|
},
|
|
256
|
-
|
|
256
|
+
cli: () => {
|
|
257
257
|
{
|
|
258
|
-
return
|
|
258
|
+
return cli2;
|
|
259
259
|
}
|
|
260
260
|
},
|
|
261
|
-
|
|
261
|
+
cache: () => {
|
|
262
262
|
{
|
|
263
|
-
return
|
|
263
|
+
return cache2;
|
|
264
264
|
}
|
|
265
265
|
},
|
|
266
266
|
app: () => {
|
|
@@ -338,9 +338,9 @@ var defaults_default = {
|
|
|
338
338
|
api: 3999
|
|
339
339
|
}
|
|
340
340
|
},
|
|
341
|
-
|
|
342
|
-
name: "
|
|
343
|
-
command: "
|
|
341
|
+
cli: {
|
|
342
|
+
name: "My Custom CLI",
|
|
343
|
+
command: "my-custom-cli",
|
|
344
344
|
description: "Stacks is a full-stack framework for TypeScript.",
|
|
345
345
|
source: p.appPath("commands")
|
|
346
346
|
},
|
|
@@ -754,8 +754,8 @@ var cache_default = {
|
|
|
754
754
|
|
|
755
755
|
// /home/runner/work/stacks/stacks/config/cli.ts
|
|
756
756
|
var cli_default = {
|
|
757
|
-
name: "
|
|
758
|
-
command: "
|
|
757
|
+
name: "My Custom CLI",
|
|
758
|
+
command: "custom-cli",
|
|
759
759
|
description: "This is an example command to illustrate how to create your own commands. Check out `../app/commands` for more."
|
|
760
760
|
};
|
|
761
761
|
|
|
@@ -798,6 +798,7 @@ var cloud_default = {
|
|
|
798
798
|
}
|
|
799
799
|
},
|
|
800
800
|
api: {
|
|
801
|
+
deploy: true,
|
|
801
802
|
prefix: env6.API_PREFIX || "api",
|
|
802
803
|
description: "Stacks API",
|
|
803
804
|
memorySize: 512,
|
|
@@ -1238,6 +1239,7 @@ var library_default = {
|
|
|
1238
1239
|
author: "Chris Breuer",
|
|
1239
1240
|
contributors: ["Chris Breuer <chris@stacksjs.org>"],
|
|
1240
1241
|
defaultLanguage: "en",
|
|
1242
|
+
releaseable: true,
|
|
1241
1243
|
vueComponents: {
|
|
1242
1244
|
name: "hello-world-vue",
|
|
1243
1245
|
description: "Your Vue component library description",
|
|
@@ -1406,8 +1408,8 @@ var ui_default = {
|
|
|
1406
1408
|
var overrides_default = {
|
|
1407
1409
|
ai: ai_default,
|
|
1408
1410
|
app: app_default,
|
|
1409
|
-
binary: cli_default,
|
|
1410
1411
|
cache: cache_default,
|
|
1412
|
+
cli: cli_default,
|
|
1411
1413
|
cloud: cloud_default,
|
|
1412
1414
|
database: database_default,
|
|
1413
1415
|
dns: dns_default,
|
|
@@ -1620,9 +1622,9 @@ var {
|
|
|
1620
1622
|
analytics,
|
|
1621
1623
|
api,
|
|
1622
1624
|
app: app2,
|
|
1623
|
-
binary,
|
|
1624
1625
|
cache: cache2,
|
|
1625
1626
|
cloud: cloud2,
|
|
1627
|
+
cli: cli2,
|
|
1626
1628
|
database: database2,
|
|
1627
1629
|
dns: dns2,
|
|
1628
1630
|
docs: docs2,
|
|
@@ -1689,8 +1691,8 @@ export {
|
|
|
1689
1691
|
database2 as database,
|
|
1690
1692
|
exports_config as config,
|
|
1691
1693
|
cloud2 as cloud,
|
|
1694
|
+
cli2 as cli,
|
|
1692
1695
|
cache2 as cache,
|
|
1693
|
-
binary,
|
|
1694
1696
|
app2 as app,
|
|
1695
1697
|
api,
|
|
1696
1698
|
analytics,
|
package/core/config/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.50",
|
|
5
5
|
"description": "The Stacks config helper methods.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
-
"bun": "./
|
|
29
|
+
"bun": "./dist/index.js",
|
|
30
30
|
"import": "./dist/index.js"
|
|
31
31
|
},
|
|
32
32
|
"./*": {
|
|
@@ -59,9 +59,9 @@ export default {
|
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
name: '
|
|
64
|
-
command: '
|
|
62
|
+
cli: {
|
|
63
|
+
name: 'My Custom CLI',
|
|
64
|
+
command: 'my-custom-cli',
|
|
65
65
|
description: 'Stacks is a full-stack framework for TypeScript.',
|
|
66
66
|
source: p.appPath('commands'),
|
|
67
67
|
},
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import type { StacksConfig } from '@stacksjs/types'
|
|
2
|
-
import ai from '
|
|
3
|
-
import app from '
|
|
4
|
-
import cache from '
|
|
5
|
-
import
|
|
6
|
-
import cloud from '
|
|
7
|
-
import database from '
|
|
8
|
-
import dns from '
|
|
9
|
-
import docs from '
|
|
10
|
-
import email from '
|
|
11
|
-
import git from '
|
|
12
|
-
import hashing from '
|
|
13
|
-
import library from '
|
|
14
|
-
import queue from '
|
|
15
|
-
import payment from '
|
|
16
|
-
import notification from '
|
|
17
|
-
import storage from '
|
|
18
|
-
import searchEngine from '
|
|
19
|
-
import security from '
|
|
20
|
-
import services from '
|
|
21
|
-
import team from '
|
|
22
|
-
import ui from '
|
|
2
|
+
import ai from 'config/ai'
|
|
3
|
+
import app from 'config/app'
|
|
4
|
+
import cache from 'config/cache'
|
|
5
|
+
import cli from 'config/cli'
|
|
6
|
+
import cloud from 'config/cloud'
|
|
7
|
+
import database from 'config/database'
|
|
8
|
+
import dns from 'config/dns'
|
|
9
|
+
import docs from 'config/docs'
|
|
10
|
+
import email from 'config/email'
|
|
11
|
+
import git from 'config/git'
|
|
12
|
+
import hashing from 'config/hashing'
|
|
13
|
+
import library from 'config/library'
|
|
14
|
+
import queue from 'config/queue'
|
|
15
|
+
import payment from 'config/payment'
|
|
16
|
+
import notification from 'config/notification'
|
|
17
|
+
import storage from 'config/storage'
|
|
18
|
+
import searchEngine from 'config/search-engine'
|
|
19
|
+
import security from 'config/security'
|
|
20
|
+
import services from 'config/services'
|
|
21
|
+
import team from 'config/team'
|
|
22
|
+
import ui from 'config/ui'
|
|
23
23
|
|
|
24
24
|
// this "user config" will override the default config options
|
|
25
25
|
export default {
|
|
26
26
|
ai,
|
|
27
27
|
app,
|
|
28
|
-
binary,
|
|
29
28
|
cache,
|
|
29
|
+
cli,
|
|
30
30
|
cloud,
|
|
31
31
|
database,
|
|
32
32
|
dns,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/database",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.50",
|
|
5
5
|
"description": "The Stacks database integration.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
],
|
|
43
43
|
"files": [
|
|
44
44
|
"README.md",
|
|
45
|
-
"dist"
|
|
45
|
+
"dist",
|
|
46
|
+
"src"
|
|
46
47
|
],
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "bun --bun build.ts",
|