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

@dsqr/ace

v0.0.0-beta.18

Published

A library of reusable AWS constructs that can be easily integrated into your applications. ACE supports both the traditional `npm` import style and the newer `shaden` CLI style, giving you flexibility to choose your preferred approach.

Downloads

290

Readme

Amazon Construct Engine

A library of reusable AWS constructs that can be easily integrated into your applications. ACE supports both the traditional npm import style and the newer shaden CLI style, giving you flexibility to choose your preferred approach.

Getting Started

Installation

Local First Constructs

Install and add a construct locally using the CLI. For example, to add a DynamoDB table construct:

npx dsqr add table

Once added, you can use it in your stack:

import { DynamoTable } from "./constructs/table";

new DynamoTable(this, "MyTable", {
  partitionKey: { name: "id", type: "string" },
});

The add command works under the assumption you created your proejcts with teh dsqr or cdk cli tool, and will look for a ./lib/constructs, if one does not exist it will create it. All constrcuts will be imported to ./lib/constrcuts/ace.

NPM Constructs

Prefer not to manage constructs locally? You can import them directly from NPM and use them out of the box:

npm install @dsqr/ace

Then use it in your application:

import { DynamoTable } from "@dsqr/constructs";

new DynamoTable(this, "MyTable", {
  partitionKey: { name: "id", type: "string" },
});

Examples

Using the ACE App

ACE provides a custom App class that extends the standard AWS CDK App. This simplifies managing stages and environments.

#!/usr/bin/env node
import * as ace from "@dsqr/ace";
import { StaticSite } from "../lib/stacks/static-site";

// Define your AWS environment variables
const env = {
  account: process.env.CDK_DEFAULT_ACCOUNT,
  region: process.env.CDK_DEFAULT_REGION,
};

// Determine the current stage (default: development)
const stage = process.env.CDK_STAGE || "development";

// Create a new ACE app
const app = new ace.aws.App({
  name: "MyApplication",
  stage,
  region: env.region,
  account: env.account,
});

// Add the environment-specific stage dynamically
app.addStage("DaveDennisDotDev", (currentStage) => {
  new StaticSite(currentStage, "PersonalSite", {
    env,
    domainName:
      stage === "development" ? "dev.davedennis.dev" : "davedennis.dev",
  });
});

app.synth(); // Synthesize the app

Creating a Static Site

Why this repo was originally built, was the need to deploy static sites (vite in my case, but any static site will work), quick and easy using the CDK. Most pet projects started out this way, so it was used to speed that up. The construct allows you to deploy static content quickly. It will build and deploy your content for you. If you dont' want to build the content, you can just pass in build.path and build.outputDir and it will upload the content at that destination, or you can can not pass in build at all, and handle the deployment of the content your self. The constrcut in this case would simply create the infrastructe for you (CloudFront Distribution -> S3) but would not uplaod any content to the bucket.

import * as "ace" from "@dsqr/ace";

new ace.aws.StaticSite(this, "StaticSite", {
  indexPage: "index.html",
  build: {
    command: "bun run build",
    path: "../../packages/web",
    outputDir: "dist"
  },
  customDomain: {
    domainName: props.domainName,
    overrides: {
      certificate: certificate
    }
  }
})