Skip to content

Adds .NET support in CLI #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
May 16, 2025
Merged

Adds .NET support in CLI #231

merged 30 commits into from
May 16, 2025

Conversation

kavins14
Copy link
Contributor

@kavins14 kavins14 commented May 15, 2025

Features includes

  • Echo template
  • set-lang command support
  • dotnet TTK basic config
  • update all ports to 3978

How to set preferred language?

// sets preferred language to csharp
teams set-lang cs 

// sets preferred language to typescript
teams set-lang ts

Once that is done users can simply do

teams new <app>

And it will provision files in the preferred language. If it is not set then they will be asked to specify typescript or csharp like this:

teams new csharp <app>

How to add configs?

Running

teams config add <config>

will detect if your project is typescript or csharp and add the correct files. The command also gracefully checks which configs are supported for that language.

In the current state just ttk.basic is supported for csharp, and so only that choice will be shown.

@singhk97 singhk97 changed the title [draft] Adds .NET support in CLI Adds .NET support in CLI May 16, 2025
heyitsaamir
heyitsaamir previously approved these changes May 16, 2025
Copy link
Contributor

@heyitsaamir heyitsaamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any blocking things so approving to unblock. As long as you've tested it reasonably with both TS and C#. @aacebo knows this code best so he may have thoughts, but to me it looks ok

heyitsaamir
heyitsaamir previously approved these changes May 16, 2025
Co-authored-by: Aamir <48929123+heyitsaamir@users.noreply.github.com>
kavins14 added 2 commits May 16, 2025 22:16
Merge branch 'kavin/dotnet-cli' of https://github.com/kavins14/spark.js into kavin/dotnet-cli
heyitsaamir
heyitsaamir previously approved these changes May 16, 2025
@aacebo
Copy link
Collaborator

aacebo commented May 16, 2025

teams config add --help yields this error

Error: invalid project. Directory should contain a package.json (typescript) or .sln (csharp) file.
    at p.load (C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:20:4594)
    at C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:21:2027
    at Array.map (<anonymous>)
    at builder (C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:21:2011)
    at _.applyBuilderUpdateUsageAndParse (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7435)
    at _.runCommand (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7078)
    at [runYargsParserAndExecuteCommands] (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:58539)
    at _.parseAndUpdateUsage (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:8102)
    at _.applyBuilderUpdateUsageAndParse (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7809)
    at _.runCommand (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7078)

@aacebo
Copy link
Collaborator

aacebo commented May 16, 2025

another error

image

@singhk97
Copy link
Contributor

teams config add --help yields this error

Error: invalid project. Directory should contain a package.json (typescript) or .sln (csharp) file.
    at p.load (C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:20:4594)
    at C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:21:2027
    at Array.map (<anonymous>)
    at builder (C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:21:2011)
    at _.applyBuilderUpdateUsageAndParse (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7435)
    at _.runCommand (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7078)
    at [runYargsParserAndExecuteCommands] (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:58539)
    at _.parseAndUpdateUsage (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:8102)
    at _.applyBuilderUpdateUsageAndParse (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7809)
    at _.runCommand (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7078)

I tested this out and config add --help works but doing config add <config name> throws this error which is consisent to it was from before.

@kavins14
Copy link
Contributor Author

teams config add --help yields this error

Error: invalid project. Directory should contain a package.json (typescript) or .sln (csharp) file.
    at p.load (C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:20:4594)
    at C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:21:2027
    at Array.map (<anonymous>)
    at builder (C:\Users\aacebo\Documents\GitHub\spark.js\packages\cli\dist\index.js:21:2011)
    at _.applyBuilderUpdateUsageAndParse (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7435)
    at _.runCommand (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7078)
    at [runYargsParserAndExecuteCommands] (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:58539)
    at _.parseAndUpdateUsage (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:8102)
    at _.applyBuilderUpdateUsageAndParse (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7809)
    at _.runCommand (C:\Users\aacebo\Documents\GitHub\spark.js\node_modules\yargs\build\index.cjs:1:7078)

I tested this out and config add --help works but doing config add <config name> throws this error which is consisent to it was from before.

Mb... I ran the wrong command. Looking into it.

aacebo
aacebo previously approved these changes May 16, 2025
@aacebo aacebo merged commit 04edc90 into microsoft:main May 16, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants