npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sassoftware/afcli

v0.8.0

Published

This utility generates TypeScript interfaces and client-side code from server-side App Factory Applications (so you don't have to).

Downloads

23

Readme

afcli

afcli is a full node JS commandline for interacting with App Factory Cloud apps, functions, and schemas.

It supports two primary commands:

  • create for creating a create-react-app template for a new React UI that integrates with App Factory cloud API.
  • sync for generating TypeScript definitions and full interactable hooks for fetching, creating, and using functions and schemas.

Read more about the CLI in our official documentation

afcli commands

Creating new projects with afcli

  1. Run the create command in a directory where you want a new Create SAS App project
npx @sassoftware/afcli@latest create

Generate files from an AFC App with afcli

  1. Open an App on App Factory Cloud and copy CSA Sync Command

Example:

npx @sassoftware/afcli@latest sync --instance=https://appfactory-<YOUR TEAM>.engage.sas.com --app-id=58 --app-revision=2
  1. Paste it in terminal and follow the procedure and provide user ID and password for SAS server

  2. Files will be created in folder afcGenerated, by default.

  3. Run command without parameters and start the interactive mode

Example:

npx @sassoftware/afcli@latest sync

Generate files (offline mode alternative)

Offline mode supports generating TS code without any network connection. The workflow described above has to contact App Factory to fetch OpenAPI specs for projects, but they can be downloaded for offline use.

  1. Download the OpenAPI specs for all functions and for the schema in the app you wish to generate for.
  2. In your local project, create the .afc folder if it doesn't already exist.
  3. If your app has a schema, move the schema OpenAPI spec to .afc/customAPISpec/schema.json. It must be named schema.json.
  4. Add each function OpenAPI spec JSON file to the .afc/customAPISpec/functions/ folder.
  5. Run @sassoftware/afcli@latest sync as normal.

You will see the sync command uses the local .afc specs provided.

Note: For updates to the definitions, download the new OpenAPI specs and follow the same steps.

For more information and examples please take a look at mock projects in tests/fixtures.

Local Development

You can setup a local version of the CLI using this repo that updates as code changes are made:

# in the current directory
npm link

Once the link is established, the CLI can be run directly:

afcli --help

Note: For dev server all afcli initial commands need to be prefixed with OAUTH_CLIENT_ID=''.

Before running the afcli, the value of OAUTH_CLIENT_ID has to be replaced with the actual value.

OAUTH_CLIENT_ID="ENTER_CLIENT_ID" afcli sync --insecure

To remove the link, you can simply remove it:

On linux: (You may need superuser permission)

rm $(which afcli)

On windows:

# in the repo
npm unlink

Contributions

This project is currently intended for use by participants in the SAS Hackathon. During this event, the repository will refrain from accepting external contributions. However, we have plans to open source the project in the near future, at which point we will welcome contributions from the community.

Please note that after the SAS Hackathon concludes, this notice will be removed, and we will provide updated guidelines for contributing to the project once it becomes open source. We appreciate your understanding and look forward to collaborating with you in the future.