Skip to content

Commit 496b21e

Browse files
committed
Fixes lines endings for shell scripts
1 parent 8569ee0 commit 496b21e

File tree

2 files changed

+187
-6
lines changed

2 files changed

+187
-6
lines changed

.gitattributes

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
*.go text eol=lf
2-
*.snap text eol=lf
3-
*.txt text eol=lf
1+
*.go text eol=lf
2+
*.snap text eol=lf
3+
*.txt text eol=lf
4+
*.sh text eol=lf

cli/azd/docs/extension-framework.md

Lines changed: 183 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Table of Contents
1919

2020
## Getting Started
2121

22-
`azd` extensions are currently an alpha feature within `azd.
22+
`azd` extensions are currently an alpha feature within `azd`.
2323

2424
> [!IMPORTANT]
2525
> Enable `azd` extensions alpha feature by running `azd config set alpha.extensions on`
@@ -126,8 +126,25 @@ The following guide will help you develop and ship extensions for `azd`.
126126
- Go (Best support)
127127
- Dotnet (C#)
128128
- Python
129-
- JavaScript (Coming Soon)
130-
- TypeScript (Common Soon)
129+
- JavaScript
130+
- TypeScript (Coming Soon)
131+
132+
Each language has different build times and integration capabilities:
133+
134+
| Language | Build Time | Platform Support | Integration Level |
135+
|----------|------------|------------------|-------------------|
136+
| Go | Fast (~15s)| All platforms | Full native support |
137+
| Dotnet | Medium (~60s)| All platforms | Strong integration |
138+
| Python | Slower (~4m) | All platforms | Good integration |
139+
| JavaScript| Medium (~90s)| All platforms | Basic integration |
140+
141+
The build process automatically creates binaries for multiple platforms and architectures:
142+
- Windows (AMD64, ARM64)
143+
- Linux (AMD64, ARM64)
144+
- macOS/Darwin (AMD64, ARM64)
145+
146+
> [!NOTE]
147+
> Build times may vary depending on your hardware and extension complexity.
131148
132149
### Developer Extension
133150

@@ -225,6 +242,169 @@ Usage: `azd x publish --repo {owner}/{name}`
225242

226243
---
227244

245+
### Extension Structure Overview
246+
247+
When you create a new extension using `azd x init`, it generates a directory structure with several important files:
248+
249+
```
250+
contoso.azd.samples.<language>/
251+
├── bin/ # Contains built binaries
252+
├── build.ps1 # Windows build script
253+
├── build.sh # Unix build script
254+
├── changelog.md # Version history and release notes
255+
├── extension.yaml # Extension metadata and capabilities
256+
├── README.md # Documentation for your extension
257+
└── <language-specific> # Source code files specific to the chosen language
258+
```
259+
260+
Key files in the extension structure:
261+
262+
- **extension.yaml**: Defines metadata, capabilities, and commands for your extension
263+
- **changelog.md**: Documents changes between versions (used for release notes)
264+
- **build scripts**: Language-specific scripts for building your extension
265+
266+
Each supported language has a slightly different structure:
267+
268+
#### Go Extension Structure
269+
```
270+
├── go.mod # Go module definition
271+
├── go.sum # Go dependency checksums
272+
├── main.go # Entry point for the extension
273+
└── internal/ # Internal implementation code
274+
```
275+
276+
#### .NET Extension Structure
277+
```
278+
├── <ExtensionName>.csproj # .NET project file
279+
├── Program.cs # Entry point for the extension
280+
└── Commands/ # Command implementations
281+
```
282+
283+
#### Python Extension Structure
284+
```
285+
├── pyproject.toml # Python project configuration
286+
├── requirements.txt # Python dependencies
287+
├── setup.py # Package setup script
288+
├── __main__.py # Entry point for the extension
289+
└── src/ # Source code directory
290+
```
291+
292+
#### JavaScript Extension Structure
293+
```
294+
├── package.json # NPM package configuration
295+
├── package-lock.json # NPM dependency locks
296+
├── index.js # Entry point for the extension
297+
└── src/ # Source code directory
298+
```
299+
300+
### Version Upgrade Path
301+
302+
Managing versions of your extension is an important part of the development process. Here's how to properly upgrade your extension version:
303+
304+
1. **Update Version Number**:
305+
- Modify the `version` field in your `extension.yaml` file
306+
- Follow [Semantic Versioning](https://semver.org/) (MAJOR.MINOR.PATCH)
307+
308+
2. **Document Changes**:
309+
- Update your `changelog.md` with details about what's new or fixed
310+
- Include any breaking changes or migration notes
311+
312+
3. **Build, Package and Test**:
313+
```bash
314+
azd x build --all # Build for all platforms
315+
azd x pack # Package the extension
316+
```
317+
318+
4. **Release the New Version**:
319+
```bash
320+
azd x release --repo <owner>/<repo>
321+
```
322+
323+
5. **Publish to Registry**:
324+
```bash
325+
azd x publish --repo <owner>/<repo>
326+
```
327+
328+
#### Version Compatibility
329+
330+
- **Major Version Changes (1.0.0 → 2.0.0)**: Indicates breaking changes
331+
- **Minor Version Changes (1.0.0 → 1.1.0)**: Adds new features while maintaining backward compatibility
332+
- **Patch Version Changes (1.0.0 → 1.0.1)**: Includes bug fixes with no feature changes
333+
334+
When upgrading across major versions, users may need to adapt to API changes. Document these changes clearly in your `changelog.md`.
335+
336+
### GitHub Authentication Requirements
337+
338+
When using the `release` and `publish` commands that interact with GitHub repositories, you'll need proper authentication:
339+
340+
1. Ensure you're authenticated with GitHub before attempting to create releases
341+
2. Use a Personal Access Token (PAT) with appropriate permissions:
342+
- For `azd x release`: `repo` scope permissions
343+
- For `azd x publish`: `repo` scope permissions
344+
345+
You can authenticate with GitHub using:
346+
347+
```bash
348+
# Login with your GitHub credentials
349+
gh auth login
350+
351+
# Or set the GITHUB_TOKEN environment variable
352+
export GITHUB_TOKEN=your_personal_access_token
353+
```
354+
355+
> [!NOTE]
356+
> Releases and publishing will fail without proper GitHub authentication.
357+
358+
### Publishing Workflow
359+
360+
The publishing process for `azd` extensions involves multiple steps:
361+
362+
1. **Build** the extension for all target platforms
363+
2. **Package** the extension artifacts
364+
3. **Release** the extension to GitHub
365+
4. **Publish** the extension to a registry
366+
367+
Each step can be performed manually or combined in a single script for automation:
368+
369+
```bash
370+
# Complete publishing workflow example
371+
cd path/to/your/extension
372+
azd x pack --rebuild
373+
azd x release --repo owner/repo
374+
azd x publish --repo owner/repo
375+
```
376+
377+
#### Cross-Platform Support
378+
379+
When publishing an extension, the system automatically generates binaries and packages for multiple platforms:
380+
- Windows (AMD64, ARM64)
381+
- Linux (AMD64, ARM64)
382+
- macOS/Darwin (AMD64, ARM64)
383+
384+
This ensures your extension can be used across different operating systems and architectures without additional configuration.
385+
386+
### Troubleshooting
387+
388+
Common issues you might encounter when developing and publishing extensions:
389+
390+
#### Build Issues
391+
392+
- **Language-Specific Dependencies**: Ensure all required dependencies for your language are installed
393+
- **Platform Compatibility**: Test on the platforms you're targeting
394+
- **Build Times**: Python extensions take significantly longer to build (~4 minutes) compared to Go (~15 seconds)
395+
396+
#### Release Issues
397+
398+
- **GitHub Authentication**: Verify your GitHub token has proper permissions
399+
- **Version Conflicts**: Ensure you're not trying to release a version that already exists
400+
- **Release Asset Size**: Large extensions may take longer to upload
401+
402+
#### Publishing Issues
403+
404+
- **Registry Conflicts**: Check if the extension ID already exists in the registry
405+
- **Permission Denied**: Verify your GitHub token has proper permissions
406+
- **Registry Schema Validation**: Ensure your extension manifest follows the schema
407+
228408
### Capabilities
229409

230410
#### Current Capabilities (May 2025)

0 commit comments

Comments
 (0)