Git Product home page Git Product logo

fast-cli's Introduction

FAST CLI Project

This is the FAST CLI project, containing the @microsoft/fast-cli package as well as related packages for FAST project creation and management. The goal of this project is to allow users to accelerate their workflows in FAST projects.

Usage

Check out our documentation for details on how to use our packages at https://microsoft.github.io/fast-cli/.

Joining the Community

Get started here with the Contributor Guide. Looking to get answers to questions or engage with us in realtime? Our community is most active on Discord. Submit requests and issues on GitHub, or join us by contributing on some good first issues via GitHub.

We look forward to building an amazing open source community with you!

Contact

  • Join the community and chat with us in real-time on Discord.
  • Submit requests and issues on GitHub.

fast-cli's People

Contributors

abhishekshahane avatar bougwal avatar dependabot[bot] avatar janechu avatar microsoftopensource avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fast-cli's Issues

Add a package to create a project

Description

A package with the naming convention starting with create should be added to facilitate using npm and npx for creating a project.

Requirements

  • Create a package named @microsoft/create-fast-project
  • Initialize with a utility from @microsoft/fast-cli

[Bug]: can't add component: fast add-component

What happened?

i'm in endeavouros "Arch Linux based Distro" i installed nodejs using fnm tried both node v16 and node v14 the output below from v14
steps:-
$ mkdir sbird-design-system
$ cd sbird-design-system
$ npm init
$ npm install --save-dev @microsoft/fast-cli
i aliased fast command in package.json ( "scripts": { "fast": "fast" } )
npm run fast ....
$ npm run fast config
i realized it only added config file so next i ran :
$ npm run fast init
image
Note: until now things all fine

when i run fast add-component :
$ npm run fast add-component --name test
Note: i tried installed fast-cli globaly as well node v16 same results

this happen and component doesnt appear in my " src/components folder"
output:

[mohammed9@architect-pc sbird-design-system]$ npm run fast add-component --name test

[email protected] fast /home/mohammed9/webdev/design-systems/sbird-design-system
fast "add-component" "test"

npm WARN deprecated [email protected]: this package has been deprecated
npm WARN [email protected] requires a peer of acorn@^8 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

249 packages are looking for funding
run npm fund for details

found 8 high severity vulnerabilities
run npm audit fix to fix them, or npm audit for details
(node:164735) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (internal/errors.js:322:7)
at validateString (internal/validators.js:124:11)
at Object.resolve (path.js:1074:7)
at file:///home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/@microsoft/fast-cli/dist/esm/cli.js:234:34
at Generator.next ()
at /home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/tslib/tslib.js:118:75
at new Promise ()
at __awaiter (/home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/tslib/tslib.js:114:16)
at checkTemplateForFiles (file:///home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/@microsoft/fast-cli/dist/esm/cli.js:233:12)
at file:///home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/@microsoft/fast-cli/dist/esm/cli.js:284:15
(Use node --trace-warnings ... to show where the warning was created)
(node:164735) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:164735) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✔ The package containing a component template … test
✔ The name of the component … test

last 2 lines after the error above appear i can enter the component name and i pressed enter but nothing happened
i went through docs many times but couldn't see anything wrong with my approach i'm some what still new developer.

Best regards

What package(s) are causing the problem?

"@microsoft/fast-cli": "^1.0.0-alpha.5"

Relevant log output

mohammed9@architect-pc sbird-design-system]$ npm run fast add-component --name test

> [email protected] fast /home/mohammed9/webdev/design-systems/sbird-design-system
> fast "add-component" "test"

npm WARN deprecated [email protected]: this package has been deprecated
npm WARN [email protected] requires a peer of acorn@^8 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
updated 1 package and audited 1679 packages in 17.083s

249 packages are looking for funding
  run `npm fund` for details

found 8 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
(node:164735) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (internal/errors.js:322:7)
    at validateString (internal/validators.js:124:11)
    at Object.resolve (path.js:1074:7)
    at file:///home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/@microsoft/fast-cli/dist/esm/cli.js:234:34
    at Generator.next (<anonymous>)
    at /home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/tslib/tslib.js:118:75
    at new Promise (<anonymous>)
    at __awaiter (/home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/tslib/tslib.js:114:16)
    at checkTemplateForFiles (file:///home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/@microsoft/fast-cli/dist/esm/cli.js:233:12)
    at file:///home/mohammed9/webdev/design-systems/sbird-design-system/node_modules/@microsoft/fast-cli/dist/esm/cli.js:284:15
(Use `node --trace-warnings ...` to show where the warning was created)
(node:164735) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:164735) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✔ The package containing a component template … test
✔ The name of the component … test

[Feature]: Add `--help` and `--version` commands

What package(s) should this feature be added to?

@microsoft/fast-cli

Summary

Common options among CLI projects is a help command to list out available commands as well as help for a specific command.

Another common command is a version command that tends to be used to check if the latest version is installed as well as for debugging version issues between locally and globally installed versions of the CLI.

[Bug]: Package not available in NPM

What happened?

Hi,

When running the following, the package is not installed because it is not found in npm registry.
npm install -g @microsoft/fast-cli

What package(s) are causing the problem?

@microsoft/fast-cli

Relevant log output

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@microsoft%2ffast-cli - Not found
npm ERR! 404
npm ERR! 404  '@microsoft/fast-cli@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Refactor for ambiguous pathing

Abstract

Currently the CLI makes assumptions about where it is installed. This is due to the initial stab at this project relying on reading template files and copying them as a means of initializing a project.

Requirements

  • Create a new private project that simply houses a working version of the default FAST project
  • Create a node script exported from @microsoft/fast-cli that will target a folder and convert it to an exported executable that can be used by the @microsoft/fast-cli to build a project
  • Utilize the node script in @microsoft/cfp-template and include the generated file as an export
  • Separate the exports from the @microsoft/cfp-template so that different maintained template projects can be specified, for example "project" vs "component library" vs "design-system"

Benefits

  • Easier testing as this simplifies and flattens the project structure

Add a package for the FAST CLI

Description

To aide in the process of using FAST, including such things and project maintenance for SSR, adding components, etc., a CLI should be added.

Requirements

  • Add a @microsoft/fast-cli package
  • Add a script to initialize a project #2 from a default template see #1
  • Ensure the user is online before using the default template
  • Create the project based on the configuration specified in fastconfig.json
  • Ensure that fastconfig.json is available and passes a JSON schema validation test
  • Create documentation for templates
  • Create documentation for CLI commands

Ensure the components are installed in sequence

Description

When multiple components are installed at once they tend to cause an issue in node_modules for their dependencies.

Requirements

  • Ensure components are installed synchronously
  • Check dependencies so the same dependency is not installed multiple times

Update CFP template and CLI initialization based on the specification

Description

The CLI and CFP template must be updated to match the CLI specification for dealing with project templates.

Requirements

Add a migrate command

Description

The following dependencies that the CLI relies on for templates may be updated at various points:

  • @microsoft/fast-foundation
  • @microsoft/fast-element
  • @microsoft/adaptive-ui (tbd)

There may be others but these are the primary dependencies for foundation components.

Due to this there is a need for the CLI to facilitate migration. The 2.x release of @microsoft/fast-element is coming up, along with planned changes for @microsoft/fast-foundation which will facilitate a major version bump.

Each major version bump has the capability to break the CLI and any users on the CLI. If a user is interested in updating to a new version of the CLI, this must be addressed.

Additionally, when the CLI is released, it should provide a migration path for users on the previous version of @microsoft/fast-element.

Requirements

  • List all dependencies that would facilitate a major version bump of the CLI
  • Determine a method of tracking these dependencies
  • Add a migrate command with arguments for which version should be targeted
    • The targeted version must be greater than the current version

Document a list of available foundation components

Description

The FAST components are being deprecated and as part of that story, the styles and references to templates are moving to the CLI. Enabling the creation of styled foundation components requires that a documented list of available components must be added.

Requirements

[Bug]: npm ERR! code E404

What happened?

When I tried to install the fast-cli: I got the following error:

npm install -g @microsoft/fast-cli

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@microsoft%2ffast-cli - Not found
npm ERR! 404
npm ERR! 404  '@microsoft/fast-cli@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shijirtsogoo\AppData\Local\npm-cache\_logs\2022-06-07T19_57_00_665Z-debug.log

What package(s) are causing the problem?

No response

Relevant log output

`npm install -g @microsoft/fast-cli`

 install -g @microsoft/fast-cli
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@microsoft%2ffast-cli - Not found
npm ERR! 404
npm ERR! 404  '@microsoft/fast-cli@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shijirtsogoo\AppData\Local\npm-cache\_logs\2022-06-07T19_57_00_665Z-debug.log

Abstract the CLI logic for testing

Description

Currently the CLI take a long time to test due to the fact that building a project to test the output takes a long time, this would be better served if the generated files were abstracted and only the full project with all components was tested.

Requirements

  • Abstract the files and their contents in such a way that the CLI functions can be called to retrieve this information before it is written to disc.
  • Test a separate function that writes files to disc

Add --all to add-foundation-component command

Description

A user may want to set up a project will all available foundation components, this should be facilitated by an --all command line argument.

Requirements

  • Allow all foundation components to be added

Add a spec to determine how FAST components will be integrated into the CLI

Description

The @microsoft/fast-components must be moved as part of their evolution going forward.

Requirements

  • Write a spec that determines
    • How will components @microsoft/fast-components be integrated into the FAST CLI
    • How will the design tokens be implemented, if any work is needed
    • What changes will need to be made to the fastconfig.json files needed for templates
    • How will adding components to a FAST CLI compliant project work
    • What choices can be made now, and what future work can be expected, planning should include non-breaking changes
  • Write an issue for a roadmap of non-MVP work

Add multiple foundation components at once

Description

Allow the addition of multiple foundation components at once in the add-foundation-component command.

Requirements

  • Multiple foundation components should be added at once
  • No rename-mapping will be available for this option, these will use the default names

Include FAST components into the FAST CLI

Description

The @microsoft/fast-components package is being deprecated. As a means of supporting consumers who still want to create components with design systems, this work will be migrated to the FAST CLI package.

This issue will serve as a tracking issue for ongoing spec writing and work moving forward.

Requirements

Add documentation site

Description

Add a documentation site for the packages that leverages markdown.

Requirements

  • Add a front page which has some content and serves as a landing page
  • Add a scripts to generate a static site from markdown content
  • Add a sidebar script
  • Add version control logic for the various packages

Add a package to serve as the CLI default template

Description

The CLI needs a package that will be used as a template for both project creation and maintenance. It should have a very simple "Hello world" component and webpack setup to start out with. This will serve as the method for testing CLI projects and to be used as the default.

Requirements

  • Create a new package to be used as a template
  • The package name should be @microsoft/cfp-template
  • The package should include typescript as default
  • The package should include both a simple production and webpack-dev-server setup
  • A single component should be used which includes no attributes and simply says "Hello World"
  • A configuration file should be created that follows the naming convention fastconfig.json

Setup the repository with NPM 7+

Description

The repository must be prepared to handle the new packages:

Requirements

  • Setup NPM 7 with workspaces
  • Add a build script workflow for the build gate

Update the components in the CLI for the new `1.0.0-alpha.2` config version

Description

For the upcoming release the dependencies for the CLI config version 1.0.0-alpha.2 necessitates the updating of the CLI components.

Requirements

  • Update the components in the CLI components/ folder to match API updates for the updated dependencies in the version matrix for config version 1.0.0-alpha.2

Update the `@microsoft/cfp-template-files` to new dependencies for config version `1.0.0-alpha.2`

Description

The migrate command necessitates that the new current version is tied to FAST CLI config version 1.0.0-alpha.2 which requires the updating of dependencies of the main app project.

Requirements

  • Update the files in @microsoft/cfp-template-files private package to the new dependencies for FAST CLI config version 1.0.0-alpha.2
  • Generate the new content for @microsoft/cfp-template export

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.