open-index/open-npm huggingface dataset:
npm package: @square360/drupal-scss-addon
Description: Storybook addon to show themes and use ecosystem for global theme value.
Author: Rena Fletcher
Latest version: 0.1.3

# Storybook Addon Drupal SCSS Theming
Storybook addon to show themes and use cohesive ecosystem for global theme value. Addon will place other theme stylesheets on head of story book and remove on switch component or change theme.

## Installation

From the root of your repo:

```console
yarn add -D @square360/drupal-scss-addon
```

## Getting started

First enable the addon. Add it to the `addons` in the `.storybook/main.js`.

```javascript
// .storybook/main.js
module.exports = {
  // ...
  addons: [
    // ...
    '@square360/drupal-scss-addon',
  ],
  // ...
};
```

Then, configure the `supportedThemes` and `selectedTheme` parameters in `.storybook/preview.js`.

`supportedThemes` is an object where the keys are the IDs of the dropdown, and the values are the theme names that will show in the dropdown of the storybook preview toolbar.

```javascript
// .storybook/preview.js
export const parameters = {
  // ...
  selectedTheme: "primary",
  supportedThemes: {
    primary: "Primary",
    secondary: "Secondary"
  },
  // ...
};
```

## Start Storybook

```console
yarn storybook
```

# Usage in Stories

The currently selected theme is available in `selectedTheme` globally, you can access it in `MyComponent.stories.js`. eg:

```js
const Template = (args, { globals: { selectedTheme } }) => {
  console.log("Template selectedTheme:", selectedTheme);

  return <Button {...args} selectedTheme={selectedTheme} />;
};
```

# Usage with CSS

There is another way to use this addon. You just enable `../dist/` staticDir in `.storybook/main.js` globally.

```js
module.exports = {
  stories: [
    '../src/**/*.stories.@(js|ts)',
  ],
  addons: [
    '@storybook/addon-a11y',
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    '@square360/drupal-scss-addon',
  ],
  staticDirs: [
    '../dist/', // this one
    './fontawesome'
  ],
};
```

Now your directory structure should be like this:

```shell
/{component-name}
  {component-name}.stories.js
  {component-name}.js
  {component-name}.scss
  {component-name}.twig
  {component-name}.yml
  /{theme-name}
    {component-name}.{theme-name}.js
    {component-name}.{theme-name}.scss
    {component-name}.{theme-name}.yml (optional)
    {component-name}.{theme-name}.twig (optional)
```

The above should create the following files inside the `dist` folder on root:

```shell
{component-name}/{component-name}.css
{component-name}/{component-name}.js
{component-name}/{theme-name}/{component-name}.{theme-name}.css
{component-name}/{theme-name}/{component-name}.{theme-name}.js
```
By following the above instruction addon will call css files according the story component loaded and theme changes from dropdown.

<!--
npm login
npm publish --access public
-->
npm package: @squareball/aws-vault-credentials
Description: Load current AWS credentials from [aws-vault](https://github.com/99designs/aws-vault).
Author: Gordon Leigh
Latest version: 0.1.0

# @squareball/aws-vault-credentials

Load current AWS credentials from [aws-vault](https://github.com/99designs/aws-vault).

## Usage

```typescript
import { S3Client } from '@aws-sdk/client-s3';
import { AwsVaultCredentials } from '@squareball/aws-vault-credentials';

const s3 = new S3Client({
  crentials: AwsVaultCredentails.provide({
    awsVaultPath: 'aws-vault', // path to aws-vault
    durationSeconds: undefined, // length in seconds for the session
    guiPrompt: false, // true to show a platform-specific GUI MFA prompt
    mfaToken: undefined, // manually pass a specific MFA token
    noSession: false, // true to use the long-term credentials
    profileName: 'your-profile', // the name of the aws-vault profile to use
    prompt: undefined, // a named prompt option (see aws-vault options)
  }),
});
```

#### `guiPrompt` option

This will choose `osascript` on darwin and `wincredui` on win32. It is ignored on other platforms.
npm package: @squareball/cfn-web-resources
Description: Custom resources for standard web deployments:
Author: Gordon Leigh
Latest version: 0.1.1

# @squareball/cfn-web-resources

Custom resources for standard web deployments:

1. `auto-cert`: provision and validate a certificate in ACM
1. `empty-bucket`: deletes everything in a bucket when the custom resource is deleted; useful to remove static content buckets that don't need to persist beyond a deployment
1. `get-stream-arn`: get the DynamoDB Stream ARN of a specified table
1. `put-object`: write specific content to an S3 bucket
1. `unpack-asset`: unpack a whole zip file to an S3 bucket

## Documentation

See [documentation](https://squareballdigital.github.io/cfn-web-resources).
npm package: @squareball/cfnassets
Description: Build asset zip packages for deployment.
Author: Gordon Leigh
Latest version: 0.5.6

# @squareball/cfnassets

Build asset zip packages for deployment.

## Quick Start

You need an assets config file:

```jsonc
// cfnassets.config.json
{
  "api": {
    "type": "rollup",
    "options": {
      "entrypoint": "./core/lib/api/lambda.js",
      "install": ["source-map-support"],
      "packageFilePath": "package.json",
      "packageInstallImage": "node:16-slim",
      "packageLockPath": "package-lock.json"
    }
  },
  "app-client": {
    "type": "content",
    "options": {
      "source": "apps/client/build"
    }
  }
}
```

Then run:

```
cfnassets build --config cfnassets.config.json
```

## Work In Progress 🚧

This project has been hacked off the codebase of another project, and is currently missing documentation.

![We Can Do It!](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/We_Can_Do_It%21_NARA_535413_-_Restoration_2.jpg/800px-We_Can_Do_It%21_NARA_535413_-_Restoration_2.jpg)

Help wanted 😁
npm package: @squareball/cfnspec
Description: This package retrieves and validates the AWS CloudFormation Resource Specification, and provides TypeScript types for the specification.
Author: Gordon Leigh
Latest version: 0.3.2

# @squareball/cfnspec

This package retrieves and validates the AWS CloudFormation Resource Specification, and provides TypeScript types for the specification.

## About the specification

From the [official docs][docs]:

> The AWS CloudFormation resource specification is a JSON-formatted text file that defines the resources and properties that AWS CloudFormation supports. The document is a machine-readable, strongly typed specification that you can use to build tools for creating AWS CloudFormation templates. For example, you can use the specification to build auto completion and validation functionality for AWS CloudFormation templates in your IDE (integrated development environment).

## Specification format

See AWS CloudFormation [Specification Format](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification-format.html).

## API

### DefaultSpecUrl

The location of the specification for `us-east-1` (N. Virginia) region.

```typescript
export const DefaultSpecUrl: string;
```

### getLatestSpec()

Get the latest specification from the specified URL (or `us-east-1` if not specified). For other regions, see the [docs][docs]. This will validate the specification by default unless `false` is passed as the second parameter.

```typescript
function getLatestSpec(
  url = DefaultSpecUrl,
  validate = true,
): Promise<CloudFormationSpec>;
```

## Interfaces

```typescript
export interface CloudFormationSpec {
  PropertyTypes: Dictionary<TypeDefinition>;
  ResourceSpecificationVersion: string;
  ResourceTypes: Dictionary<ResourceDefinition>;
}

export interface TypeDefinition {
  AdditionalProperties?: boolean;
  Documentation?: string;
  DuplicatesAllowed?: boolean;
  ItemType?: string;
  PrimitiveItemType?: PrimitiveType;
  PrimitiveType?: PrimitiveType;
  Properties?: Dictionary<TypeDefinition>;
  Required?: boolean;
  Type?: string;
  UpdateType?: UpdateType;
}

export interface ResourceDefinition extends TypeDefinition {
  Attributes?: Dictionary<TypeDefinition>;
}

export interface Dictionary<T> {
  [key: string]: T;
}

export enum PrimitiveType {
  String = 'String',
  Long = 'Long',
  Integer = 'Integer',
  Double = 'Double',
  Boolean = 'Boolean',
  Timestamp = 'Timestamp',
  Json = 'Json',
}

export enum UpdateType {
  Mutable = 'Mutable',
  Immutable = 'Immutable',
  Conditional = 'Conditional',
}
```

[docs]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
npm package: @squareball/cfntemplate
Description: This package contains type definitions for AWS CloudFormation templates, so that you can create CloudFormation templates in code.
Author: Gordon Leigh
Latest version: 0.5.1

# @squareball/cfntemplate

This package contains type definitions for AWS CloudFormation templates, so that you can create CloudFormation templates in code.

## Documentation

See [documentation](https://squareballdigital.github.io/cfntemplate/).

## Example

```typescript
import { Fn, Template, makePolicyDocument } from '@squareball/cfntemplate';
import { ResourceType } from '@squareball/cfntypes';

const template: Template = {
  Resources: {
    MyLambda: {
      Type: ResourceType.LambdaFunction,
      Properties: {
        Handler: 'index.handler',
        Role: Fn.GetAtt('MyLambdaRole', 'Arn'),
        Code: {
          S3Bucket: 'lambda-functions',
          S3Key: 'amilookup.zip',
        },
        Runtime: 'nodejs12.x',
        Timeout: 25,
        TracingConfig: {
          Mode: 'Active',
        },
      },
    },
    MyLambdaRole: {
      Type: ResourceType.IAMRole,
      Properties: {
        AssumeRolePolicyDocument: makePolicyDocument({
          Action: 'sts:AssumeRole',
          Principal: { Service: 'lambda.amazonaws.com' },
          Effect: PolicyEffect.Allow,
        }),
        Policies: [
          {
            PolicyName: 'Logging',
            PolicyDocument: makePolicyDocument({
              Effect: PolicyEffect.Allow,
              Action: [
                'logs:CreateLogGroup',
                'logs:CreateLogStream',
                'logs:PutLogEvents',
                'xray:PutTraceSegments',
                'xray:PutTelemetryRecords',
              ],
              Resource: '*',
            }),
          },
        ],
      },
    },
  },
};
```
npm package: @squareball/cfntypes
Description: Typescript types for AWS CloudFormation types.
Author: Gordon Leigh
Latest version: 0.40.4

# @squareball/cfntypes

Typescript types for AWS CloudFormation types.

## Specification Version

The specification version is available via the `ResourceSpecificationVersion` export and via `awsResourceSpecificationVersion` in `package.json`.

```typescript
import { ResourceSpecificationVersion } from '@squareball/cfntypes';

console.log(`using version ${ResourceSpecificationVersion}`);
```

## Resource Types

The resource types are all defined individually as interfaces with predictable names, and also as properties of the `ResourceTypes` interface keyed by the CloudFormation resource type.

```typescript
import { ResourceTypes, ResourceType } from '@squareball/cfntypes';

type ApiGatewayProps = ResourceTypes[ResourceType.ApiGatewayRestApi];
// also exported as ApiGatewayRestApi
```

## Attribute Types

The attribute types are all defined individually as interfaces with predictable names, and also as properties of the `AttributeTypes` interface keyed by the CloudFormation resource type. Note that not all resource types have attributes.

```typescript
import { AttributeTypes, AttributeTypeFor } from '@squareball/cfntypes';

type ApiGatewayAttribs = AttributeTypes[ResourceType.ApiGatewayRestApi];
// also exported as ApiGatewayRestApiAttributes

// the AttributeTypeFor helper returns `never` for resources
// with no attributes defined
type NeverAttribs = AttributeTypeFor<ResourceType.ApiGatewayAccount>;
```