@fishawack/lab-env 4.44.1 → 4.45.0-beta.2
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/CHANGELOG.md +46 -0
- package/_Ai/laravel-12.md +483 -34
- package/_Ai/python-3.md +42 -0
- package/_Ai/vue-3.md +327 -25
- package/bitbucket-pipelines.yml +3 -1
- package/cli.js +89 -63
- package/commands/connect.js +1 -1
- package/commands/create/cmds/dekey.js +3 -1
- package/commands/create/cmds/deprovision.js +3 -1
- package/commands/create/cmds/key.js +3 -1
- package/commands/create/cmds/provision.js +3 -1
- package/commands/create/libs/vars.js +1 -1
- package/commands/create/services/aws/elasticbeanstalk.js +2 -2
- package/commands/create/services/aws/iam.js +8 -0
- package/commands/create/services/aws/index.js +1 -0
- package/commands/execute.js +1 -1
- package/commands/nuke.js +6 -4
- package/commands/pip.js +13 -0
- package/commands/python.js +13 -0
- package/commands/setup.js +5 -0
- package/commands/start.js +6 -0
- package/eslint.config.js +2 -0
- package/globals.js +28 -2
- package/package.json +1 -1
- package/python/0/docker-compose.yml +24 -0
- package/stylelint.config.js +2 -0
package/_Ai/vue-3.md
CHANGED
|
@@ -75,12 +75,13 @@ fw npm -v
|
|
|
75
75
|
|
|
76
76
|
## Project Structure Context
|
|
77
77
|
|
|
78
|
-
- **Vue Components**: Main app component at [`
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
81
|
-
- **
|
|
82
|
-
- **
|
|
83
|
-
- **
|
|
78
|
+
- **Vue Components**: Main app component at [`resources/vue/app.vue`](resources/vue/app.vue)
|
|
79
|
+
- **Vue Components**: Reusable components in [`resources/vue/components/`](resources/vue/components/) directory
|
|
80
|
+
- **Vue Routes**: Page components in [`resources/vue/routes/`](resources/vue/routes/) directory
|
|
81
|
+
- **Vue Stories**: Component documentation in [`resources/vue/stories/`](resources/vue/stories/) directory
|
|
82
|
+
- **JavaScript**: Main script at [`resources/js/script.js`](resources/js/script.js), utilities in [`resources/js/libs/`](resources/js/libs/) directory
|
|
83
|
+
- **Styles**: SASS files in [`resources/sass/`](resources/sass/) directory
|
|
84
|
+
- **Templates**: Handlebars templates in [`resources/handlebars/`](resources/handlebars/) directory
|
|
84
85
|
- **Tests**: Unit tests in [`_Test/unit/`](_Test/unit/), UI tests in [`_Test/ui/`](_Test/ui/)
|
|
85
86
|
|
|
86
87
|
## Technology Stack
|
|
@@ -144,22 +145,85 @@ The project uses Fishawack's custom build system (`@fishawack/core`):
|
|
|
144
145
|
|
|
145
146
|
## Styling Architecture
|
|
146
147
|
|
|
148
|
+
### Critical Styling Philosophy
|
|
149
|
+
|
|
150
|
+
**NEVER use `<style>` blocks in Vue components** - All styling is managed through the structured SASS architecture. This enforces separation of concerns and maintains optimal build performance.
|
|
151
|
+
|
|
147
152
|
### SASS Structure
|
|
148
153
|
|
|
149
|
-
- [`
|
|
150
|
-
- [`
|
|
151
|
-
- [`
|
|
152
|
-
- [`
|
|
154
|
+
- [`resources/sass/vendor.scss`](resources/sass/vendor.scss): Third-party imports and lab-ui components (cached for performance)
|
|
155
|
+
- [`resources/sass/general.scss`](resources/sass/general.scss): Project-specific component imports (fast-reloading)
|
|
156
|
+
- [`resources/sass/_variables.scss`](resources/sass/_variables.scss): Project color overrides and custom variables
|
|
157
|
+
- [`resources/sass/_defaults.scss`](resources/sass/_defaults.scss): Lab-UI component setting overrides
|
|
158
|
+
- [`resources/sass/components/`](resources/sass/components/): Individual component style files using BEM methodology
|
|
159
|
+
|
|
160
|
+
### BEM Methodology
|
|
161
|
+
|
|
162
|
+
All component styling follows BEM (Block Element Modifier) methodology:
|
|
163
|
+
|
|
164
|
+
```scss
|
|
165
|
+
// Block: Base component
|
|
166
|
+
.card {
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Element: Component part
|
|
170
|
+
.card__header {
|
|
171
|
+
}
|
|
172
|
+
.card__body {
|
|
173
|
+
}
|
|
174
|
+
.card__footer {
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Modifier: Variant or state
|
|
178
|
+
.card--featured {
|
|
179
|
+
}
|
|
180
|
+
.card--compact {
|
|
181
|
+
}
|
|
182
|
+
.card__header--sticky {
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Vue Template Example:**
|
|
187
|
+
|
|
188
|
+
```vue
|
|
189
|
+
<template>
|
|
190
|
+
<article class="card card--featured">
|
|
191
|
+
<header class="card__header card__header--sticky">
|
|
192
|
+
<h2 class="card__title">{{ title }}</h2>
|
|
193
|
+
</header>
|
|
194
|
+
<div class="card__body">
|
|
195
|
+
<p>{{ content }}</p>
|
|
196
|
+
</div>
|
|
197
|
+
</article>
|
|
198
|
+
</template>
|
|
199
|
+
```
|
|
153
200
|
|
|
154
201
|
### UI Library Integration
|
|
155
202
|
|
|
156
|
-
Uses `@fishawack/lab-ui`
|
|
203
|
+
Uses `@fishawack/lab-ui` utility-first framework providing:
|
|
204
|
+
|
|
205
|
+
#### Utility Classes (Tailwind-like system):
|
|
157
206
|
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
207
|
+
- **Spacing**: `m-0`, `m-0.5`, `m-1.5`, `p-2`, `p-3`, `p-4`
|
|
208
|
+
- **Colors**: `bg-1` through `bg-6`, `color-1` through `color-6`
|
|
209
|
+
- **Grid**: `grid__6/12`, `mobile:grid__12/12`, `grid--gutters`
|
|
210
|
+
- **Flexbox**: `flex`, `justify-center`, `items-center`, `flex-column`
|
|
211
|
+
- **Typography**: `text-center`, `font-600`, `uppercase`
|
|
212
|
+
- **Display**: `block`, `hidden`, `mobile:hidden`, `tablet:block`
|
|
213
|
+
|
|
214
|
+
#### Responsive Breakpoints:
|
|
215
|
+
|
|
216
|
+
- `mobile:` - 767px and below
|
|
217
|
+
- `tablet:` - 1023px and below
|
|
218
|
+
- `desktop:` - 1299px and below
|
|
219
|
+
|
|
220
|
+
#### Base Components:
|
|
221
|
+
|
|
222
|
+
- Typography system with semantic font weights
|
|
223
|
+
- 12-column flexbox grid system
|
|
224
|
+
- Button component base with extensive customization
|
|
225
|
+
- Form components with validation states
|
|
226
|
+
- Utility classes for spacing, colors, and layout
|
|
163
227
|
|
|
164
228
|
## Testing Guidelines
|
|
165
229
|
|
|
@@ -187,17 +251,241 @@ fw npm run test
|
|
|
187
251
|
|
|
188
252
|
## Development Guidelines
|
|
189
253
|
|
|
254
|
+
### Vue Component Styling Rules
|
|
255
|
+
|
|
256
|
+
**CRITICAL**: Never use `<style>` or `<style scoped>` blocks in Vue components. All styling must be managed through the SASS architecture.
|
|
257
|
+
|
|
258
|
+
#### Correct Approach:
|
|
259
|
+
|
|
260
|
+
```vue
|
|
261
|
+
<!-- MyComponent.vue -->
|
|
262
|
+
<template>
|
|
263
|
+
<div class="my-component my-component--featured">
|
|
264
|
+
<header class="my-component__header">
|
|
265
|
+
<h2 class="my-component__title">{{ title }}</h2>
|
|
266
|
+
</header>
|
|
267
|
+
<div class="my-component__body">
|
|
268
|
+
<p>{{ content }}</p>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
</template>
|
|
272
|
+
|
|
273
|
+
<script>
|
|
274
|
+
export default {
|
|
275
|
+
name: "MyComponent",
|
|
276
|
+
props: ["title", "content"],
|
|
277
|
+
};
|
|
278
|
+
</script>
|
|
279
|
+
|
|
280
|
+
<!-- NO <style> block - styles are in resources/sass/components/_my-component.scss -->
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
#### Corresponding SASS File (`resources/sass/components/_my-component.scss`):
|
|
284
|
+
|
|
285
|
+
```scss
|
|
286
|
+
.my-component {
|
|
287
|
+
// Use lab-ui utilities when possible
|
|
288
|
+
@apply bg-0 p-2 grid--gutters;
|
|
289
|
+
|
|
290
|
+
border: 1px solid $color6;
|
|
291
|
+
border-radius: 4px;
|
|
292
|
+
|
|
293
|
+
&__header {
|
|
294
|
+
@apply border-color-6 pb-1;
|
|
295
|
+
border-bottom: 1px solid;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&__title {
|
|
299
|
+
@apply font-600 color-4;
|
|
300
|
+
margin: 0;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&__body {
|
|
304
|
+
@apply pt-1;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Modifier for featured variant
|
|
308
|
+
&--featured {
|
|
309
|
+
border-color: $color1;
|
|
310
|
+
box-shadow: 0 4px 8px rgba($color1, 0.1);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### BEM Methodology Implementation
|
|
316
|
+
|
|
317
|
+
Use BEM (Block Element Modifier) consistently for all component styling:
|
|
318
|
+
|
|
319
|
+
- **Block**: `.component-name` - The standalone component
|
|
320
|
+
- **Element**: `.component-name__element` - A part of the component
|
|
321
|
+
- **Modifier**: `.component-name--modifier` or `.component-name__element--modifier` - A variant or state
|
|
322
|
+
|
|
323
|
+
#### Vue Template BEM Patterns:
|
|
324
|
+
|
|
325
|
+
```vue
|
|
326
|
+
<template>
|
|
327
|
+
<!-- Block with modifier -->
|
|
328
|
+
<article class="card card--featured">
|
|
329
|
+
<!-- Elements -->
|
|
330
|
+
<header class="card__header card__header--sticky">
|
|
331
|
+
<h2 class="card__title">{{ title }}</h2>
|
|
332
|
+
<button class="card__action card__action--primary">Action</button>
|
|
333
|
+
</header>
|
|
334
|
+
|
|
335
|
+
<div class="card__body">
|
|
336
|
+
<!-- Combine BEM with lab-ui utilities -->
|
|
337
|
+
<p class="card__text color-4 font-400">{{ content }}</p>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
<!-- Conditional modifiers -->
|
|
341
|
+
<footer
|
|
342
|
+
class="card__footer"
|
|
343
|
+
:class="{ 'card__footer--expanded': isExpanded }"
|
|
344
|
+
>
|
|
345
|
+
<slot name="footer" />
|
|
346
|
+
</footer>
|
|
347
|
+
</article>
|
|
348
|
+
</template>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Lab-UI Utility Integration
|
|
352
|
+
|
|
353
|
+
Combine BEM component styles with lab-ui utilities for optimal performance:
|
|
354
|
+
|
|
355
|
+
#### Layout Utilities:
|
|
356
|
+
|
|
357
|
+
```vue
|
|
358
|
+
<template>
|
|
359
|
+
<div class="dashboard-grid grid grid--gutters">
|
|
360
|
+
<div class="dashboard-card grid__6/12 tablet:grid__12/12">
|
|
361
|
+
<!-- Card content -->
|
|
362
|
+
</div>
|
|
363
|
+
<div class="dashboard-card grid__6/12 tablet:grid__12/12">
|
|
364
|
+
<!-- Card content -->
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
</template>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### Responsive Design:
|
|
371
|
+
|
|
372
|
+
```vue
|
|
373
|
+
<template>
|
|
374
|
+
<nav class="main-nav flex justify-between items-center p-2">
|
|
375
|
+
<div class="main-nav__brand">
|
|
376
|
+
<img
|
|
377
|
+
src="logo.svg"
|
|
378
|
+
alt="Brand"
|
|
379
|
+
class="logo--small tablet:logo--medium"
|
|
380
|
+
/>
|
|
381
|
+
</div>
|
|
382
|
+
|
|
383
|
+
<div class="main-nav__menu hidden tablet:block">
|
|
384
|
+
<!-- Desktop menu -->
|
|
385
|
+
</div>
|
|
386
|
+
|
|
387
|
+
<button class="main-nav__toggle block tablet:hidden">
|
|
388
|
+
<!-- Mobile menu toggle -->
|
|
389
|
+
</button>
|
|
390
|
+
</nav>
|
|
391
|
+
</template>
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Component Development Workflow
|
|
395
|
+
|
|
396
|
+
1. **Create Vue Component**: Focus on structure and behavior only
|
|
397
|
+
2. **Define BEM Classes**: Use semantic class names following BEM methodology
|
|
398
|
+
3. **Create SASS File**: Add corresponding file in `resources/sass/components/`
|
|
399
|
+
4. **Import in General**: Add new component to `resources/sass/general.scss`
|
|
400
|
+
5. **Use Lab-UI Utilities**: Leverage existing utilities before writing custom CSS
|
|
401
|
+
6. **Test Responsively**: Verify component works across all breakpoints
|
|
402
|
+
|
|
190
403
|
### Vue Component Patterns
|
|
191
404
|
|
|
192
405
|
- Use Vue 3 Composition API when appropriate
|
|
193
406
|
- Follow Single File Component (SFC) structure
|
|
194
407
|
- Utilize global components (`GIcon`, `GSvg`) for consistent UI
|
|
408
|
+
- Never include styling within component files
|
|
195
409
|
|
|
196
410
|
### Adding New Routes
|
|
197
411
|
|
|
198
|
-
1. Create component in [`
|
|
199
|
-
2. Add route definition to [`
|
|
412
|
+
1. Create component in [`resources/vue/routes/`](resources/vue/routes/)
|
|
413
|
+
2. Add route definition to [`resources/js/libs/routes.js`](resources/js/libs/routes.js)
|
|
200
414
|
3. Set `prerender: false` if route shouldn't be pre-rendered
|
|
415
|
+
4. Create corresponding SASS file in [`resources/sass/components/`](resources/sass/components/) if custom styling needed
|
|
416
|
+
|
|
417
|
+
### Performance Considerations
|
|
418
|
+
|
|
419
|
+
#### SASS Architecture Benefits:
|
|
420
|
+
|
|
421
|
+
- **Vendor Caching**: Third-party libraries in `vendor.scss` are cached for faster rebuilds
|
|
422
|
+
- **Fast Recompilation**: Project styles in `general.scss` recompile quickly during development
|
|
423
|
+
- **PurgeCSS Optimization**: Unused CSS automatically removed in production builds
|
|
424
|
+
- **No Style Duplication**: Global SASS architecture prevents style repetition across components
|
|
425
|
+
|
|
426
|
+
#### PurgeCSS and Dynamic Classes:
|
|
427
|
+
|
|
428
|
+
```javascript
|
|
429
|
+
// If Vue components add classes dynamically via JavaScript:
|
|
430
|
+
export default {
|
|
431
|
+
methods: {
|
|
432
|
+
highlightElement() {
|
|
433
|
+
// Ensure these classes are preserved in production
|
|
434
|
+
this.$el.classList.add("highlighted", "animated-in");
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
Add protection in SASS file:
|
|
441
|
+
|
|
442
|
+
```scss
|
|
443
|
+
/* purgecss start ignore */
|
|
444
|
+
.highlighted,
|
|
445
|
+
.animated-in {
|
|
446
|
+
// These classes will be preserved in production builds
|
|
447
|
+
}
|
|
448
|
+
/* purgecss end ignore */
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Styling Anti-Patterns to Avoid
|
|
452
|
+
|
|
453
|
+
❌ **Never do this:**
|
|
454
|
+
|
|
455
|
+
```vue
|
|
456
|
+
<template>
|
|
457
|
+
<div class="my-component">
|
|
458
|
+
<p :style="{ color: dynamicColor }">Text</p>
|
|
459
|
+
</div>
|
|
460
|
+
</template>
|
|
461
|
+
|
|
462
|
+
<style scoped>
|
|
463
|
+
.my-component {
|
|
464
|
+
padding: 20px;
|
|
465
|
+
}
|
|
466
|
+
</style>
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
✅ **Do this instead:**
|
|
470
|
+
|
|
471
|
+
```vue
|
|
472
|
+
<template>
|
|
473
|
+
<div class="my-component" :class="colorClass">
|
|
474
|
+
<p class="my-component__text">Text</p>
|
|
475
|
+
</div>
|
|
476
|
+
</template>
|
|
477
|
+
|
|
478
|
+
<script>
|
|
479
|
+
export default {
|
|
480
|
+
computed: {
|
|
481
|
+
colorClass() {
|
|
482
|
+
return `my-component--${this.variant}`;
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
};
|
|
486
|
+
</script>
|
|
487
|
+
<!-- Styles in resources/sass/components/_my-component.scss -->
|
|
488
|
+
```
|
|
201
489
|
|
|
202
490
|
### Adding Dependencies
|
|
203
491
|
|
|
@@ -230,10 +518,24 @@ The `fw` command is our container orchestration manager that:
|
|
|
230
518
|
|
|
231
519
|
1. Always assume containerized environment with `fw` prefix
|
|
232
520
|
2. Follow Vue.js 3 best practices and Composition API patterns
|
|
233
|
-
3.
|
|
234
|
-
4.
|
|
235
|
-
5.
|
|
236
|
-
6.
|
|
237
|
-
7.
|
|
238
|
-
|
|
239
|
-
|
|
521
|
+
3. **NEVER suggest `<style>` blocks in Vue components** - All styling goes in SASS files
|
|
522
|
+
4. Use BEM methodology for component class naming (`.block__element--modifier`)
|
|
523
|
+
5. Combine lab-ui utilities with custom component styles for optimal performance
|
|
524
|
+
6. Create corresponding SASS files in `resources/sass/components/` for new components
|
|
525
|
+
7. Import new component styles in `resources/sass/general.scss` for fast recompilation
|
|
526
|
+
8. Use existing global components and utilities from lab-ui
|
|
527
|
+
9. Consider the Handlebars template system for static content
|
|
528
|
+
10. Respect the existing SASS architecture and variable system
|
|
529
|
+
11. Ensure new routes are properly configured for SPA routing
|
|
530
|
+
12. Use the existing testing patterns for unit and integration tests
|
|
531
|
+
13. Always test production builds when adding JavaScript-generated CSS classes (PurgeCSS considerations)
|
|
532
|
+
|
|
533
|
+
### Key Styling Principles:
|
|
534
|
+
|
|
535
|
+
- **Separation of Concerns**: Vue handles logic/templates, SASS handles all styling
|
|
536
|
+
- **Utility-First**: Use lab-ui utilities before writing custom CSS
|
|
537
|
+
- **BEM Methodology**: Consistent class naming for maintainable styles
|
|
538
|
+
- **Performance**: Leverage vendor/general file split for optimal build times
|
|
539
|
+
- **Responsive**: Mobile-first design with lab-ui breakpoint system
|
|
540
|
+
|
|
541
|
+
Remember: This is a containerized Vue.js SPA with structured SASS architecture - all operations must go through the `fw` container orchestration manager, and all styling must be managed through the SASS system using BEM methodology.
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -127,7 +127,9 @@ pipelines:
|
|
|
127
127
|
- production
|
|
128
128
|
size: 4x
|
|
129
129
|
script:
|
|
130
|
-
# Install deps
|
|
130
|
+
# Install lib deps
|
|
131
|
+
- git submodule init && git submodule update
|
|
132
|
+
# Install release deps
|
|
131
133
|
- npm install -g semantic-release@24 @semantic-release/changelog@6 @semantic-release/git@10 conventional-changelog-conventionalcommits@8
|
|
132
134
|
# Release version via node so can exit out when no release made
|
|
133
135
|
- |
|
package/cli.js
CHANGED
|
@@ -33,73 +33,99 @@ const args = hideBin(process.argv);
|
|
|
33
33
|
description: `Continue past standard failure points (use at your own risk)`,
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
36
|
+
// Platform command mapping
|
|
37
|
+
const platformCommands = {
|
|
38
|
+
// Base commands available to all platforms
|
|
39
|
+
base: ["start", "setup", "connect", "execute", "nuke", "lint"],
|
|
40
|
+
|
|
41
|
+
// Web development commands (for frameworks that build frontend assets)
|
|
42
|
+
webDev: [
|
|
43
|
+
"watch",
|
|
44
|
+
"run",
|
|
45
|
+
"check",
|
|
46
|
+
"npm",
|
|
47
|
+
"production",
|
|
48
|
+
"test",
|
|
49
|
+
"reinstall",
|
|
50
|
+
"install",
|
|
51
|
+
"uninstall",
|
|
52
|
+
"clean",
|
|
53
|
+
"regenerate",
|
|
54
|
+
"script",
|
|
55
|
+
],
|
|
56
|
+
|
|
57
|
+
// Platform-specific commands
|
|
58
|
+
laravel: ["artisan", "composer", "php"],
|
|
59
|
+
craftcms: ["craft", "composer", "php"],
|
|
60
|
+
drupal: ["drush", "composer", "php"],
|
|
61
|
+
wordpress: ["wp", "composer", "php"],
|
|
62
|
+
adonis: ["ace", "node"],
|
|
63
|
+
php: ["composer", "php"],
|
|
64
|
+
python: ["python", "pip"],
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Define which platforms get which command groups
|
|
68
|
+
const platformGroups = {
|
|
69
|
+
laravel: ["base", "webDev"],
|
|
70
|
+
craftcms: ["base", "webDev"],
|
|
71
|
+
drupal: ["base", "webDev"],
|
|
72
|
+
wordpress: ["base", "webDev"],
|
|
73
|
+
adonis: ["base", "webDev"],
|
|
74
|
+
php: ["base", "webDev"],
|
|
75
|
+
core: ["base", "webDev"],
|
|
76
|
+
python: ["base"], // Python only gets base commands, no webDev
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Config-based command additions
|
|
80
|
+
const configCommands = {
|
|
81
|
+
content: _.config.preset !== "external",
|
|
82
|
+
deploy: _.config.preset === "permanent",
|
|
83
|
+
origin: _.config.preset === "permanent",
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// Build commands array
|
|
87
|
+
let commands = [];
|
|
88
|
+
|
|
89
|
+
// Special handling for devops preset - only gets create commands and hidden docker commands
|
|
90
|
+
if (_.config.preset === "devops") {
|
|
91
|
+
// No platform or base commands for devops
|
|
92
|
+
commands = [];
|
|
93
|
+
} else {
|
|
94
|
+
// Normal command building for other presets
|
|
95
|
+
// Add command groups based on platform
|
|
96
|
+
const groups = platformGroups[_.platform] || ["base"];
|
|
97
|
+
groups.forEach((group) => {
|
|
98
|
+
if (platformCommands[group]) {
|
|
99
|
+
commands.push(...platformCommands[group]);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
84
102
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
103
|
+
// Add config-based commands
|
|
104
|
+
Object.entries(configCommands).forEach(([command, condition]) => {
|
|
105
|
+
if (condition) {
|
|
106
|
+
commands.push(command);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
88
109
|
|
|
89
|
-
|
|
90
|
-
_.platform
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
// Add platform-specific commands
|
|
111
|
+
if (platformCommands[_.platform]) {
|
|
112
|
+
commands.push(...platformCommands[_.platform]);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Special case for WordPress version 0 (no composer/php)
|
|
116
|
+
if (
|
|
117
|
+
_.platform === "wordpress" &&
|
|
118
|
+
process.env.VERSION_WORDPRESS === "0"
|
|
119
|
+
) {
|
|
120
|
+
commands = commands.filter(
|
|
121
|
+
(cmd) => !["composer", "php"].includes(cmd),
|
|
122
|
+
);
|
|
123
|
+
}
|
|
98
124
|
}
|
|
99
125
|
|
|
100
126
|
commands.forEach((d) => cli.command(...require(`./commands/${d}.js`)));
|
|
101
127
|
|
|
102
|
-
// Docker commands
|
|
128
|
+
// Docker commands (hidden - available to all)
|
|
103
129
|
[
|
|
104
130
|
"build",
|
|
105
131
|
"config",
|
|
@@ -111,8 +137,8 @@ const args = hideBin(process.argv);
|
|
|
111
137
|
"compose",
|
|
112
138
|
].forEach((d) => cli.command(...require(`./commands/docker/${d}.js`)));
|
|
113
139
|
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
// Create commands
|
|
141
|
+
if (_.config.preset === "permanent" || _.config.preset === "devops") {
|
|
116
142
|
[
|
|
117
143
|
"new",
|
|
118
144
|
"provision",
|
package/commands/connect.js
CHANGED
|
@@ -6,7 +6,9 @@ const { stack, client } = require("../libs/prompts.js");
|
|
|
6
6
|
|
|
7
7
|
module.exports = [
|
|
8
8
|
["deprovision", "deprov"],
|
|
9
|
-
|
|
9
|
+
_.config.preset === "devops"
|
|
10
|
+
? "Terminate the provisioned environment on AWS"
|
|
11
|
+
: false,
|
|
10
12
|
(yargs) => {
|
|
11
13
|
yargs.option("branch", {
|
|
12
14
|
alias: "b",
|
|
@@ -9,7 +9,9 @@ const { frameworks } = require("../libs/vars");
|
|
|
9
9
|
|
|
10
10
|
module.exports = [
|
|
11
11
|
["provision", "prov"],
|
|
12
|
-
|
|
12
|
+
_.config.preset === "devops"
|
|
13
|
+
? "Provisions a static or fullstack env on AWS"
|
|
14
|
+
: false,
|
|
13
15
|
(yargs) => {
|
|
14
16
|
yargs.option("branch", {
|
|
15
17
|
alias: "b",
|
|
@@ -56,8 +56,8 @@ module.exports.createElasticBeanstalkEnvironment = async (
|
|
|
56
56
|
SolutionStackName: solutions.SolutionStacks.filter((d) => {
|
|
57
57
|
return language === "node"
|
|
58
58
|
? d.includes("Node.js 20")
|
|
59
|
-
: d.includes("PHP 8.
|
|
60
|
-
d.includes("Amazon Linux
|
|
59
|
+
: d.includes("PHP 8.2") &&
|
|
60
|
+
d.includes("Amazon Linux 2023");
|
|
61
61
|
})[0],
|
|
62
62
|
OptionSettings,
|
|
63
63
|
CNAMEPrefix,
|
|
@@ -136,6 +136,14 @@ module.exports.syncFWIAMPolicies = async (
|
|
|
136
136
|
"arn:aws:iam::aws:policy/AdministratorAccess-AWSElasticBeanstalk",
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
if (permissions.includes("manage-users")) {
|
|
141
|
+
await module.exports.attachIAMPolicy(
|
|
142
|
+
UserName,
|
|
143
|
+
account,
|
|
144
|
+
"arn:aws:iam::aws:policy/IAMFullAccess",
|
|
145
|
+
);
|
|
146
|
+
}
|
|
139
147
|
};
|
|
140
148
|
|
|
141
149
|
module.exports.removeIAMPolicy = async (UserName, account, policy) => {
|