open-index/open-npm huggingface dataset:
npm package: @starmandeluxe/babel-plugin-react-component-data-attribute
Description: Babel plugin to add a data attribute containing its component’s name to the top-level DOM node
Author: Chris Sauve
Latest version: 0.6.0

# babel-plugin-react-component-data-attribute

Fork of https://github.com/lemonmade/babel-plugin-react-component-data-attribute
that adds Babel 7 compatibility.

This plugin adds a `data-component` attribute to top-level DOM elements rendered by your component. This can be useful for constructing a high-level component hierarchy outside the context of your React application (for instance, for the purposes of click tracking).

## Example

**In**

```js
class ComponentOne extends React.Component {
  render() {
    return <div />;
  }
}

function ComponentTwo() {
  return someCondition
    ? <div><div /></div>
    : <ComponentOne />;
}

const ComponentThree = () => (
  <div />
);
```

**Out**

```js
class ComponentOne extends React.Component {
  render() {
    return <div data-component="ComponentOne" />;
  }
}

function ComponentTwo() {
  return someCondition
    ? <div data-component="ComponentTwo"><div /></div>
    : <ComponentOne />;
}

const ComponentThree = () => (
  <div data-component="ComponentThree" />
);
```

## Installation

```sh
# yarn
yarn add --dev babel-plugin-react-component-data-attribute

# npm
npm install --save-dev babel-plugin-react-component-data-attribute
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["react-component-data-attribute"]
}
```

### Via CLI

```sh
babel --plugins react-component-data-attribute script.js
```

### Via Node API

```js
require('babel-core').transform('code', {
  plugins: ['react-component-data-attribute'],
});
```

## Options

This plugin accepts an options object with a single option: `onlyRootComponents`. When this option is `true`, only components that appear to be the "main" part of a particular component will get the data attribute. The plugin determines whether a component is "root" or not based on the following criteria:

* It is a named or default export
* It is in a file named `index`, or in a file named the same as the directory (so, for instance, `MyComponent/MyComponent.js`)
npm package: @starnetbih/au2-api
Description: Api plugin for aurelia 2 (alpha)
Latest version: 0.5.0

# au2-api

This library is a partial port of the excellent SpoonX/aurelia-api plugin for the Aurelia platform. It contains support for multiple endpoints, extending the functionalities supplied by aurelia HttpClient.

au2-api is a module wrapped around HttpClient that allows you to:

- Supply criteria for your api
- Manage more than one endpoint
- Add defaults
- Add interceptors
- And more

It depends on **au2-configuration**.

**Full disclosure**: this plugin is in alpha stage. Use at your own risk.

## Installation

`npm install @starnetbih/au2-api` or `yarn add @starnetbih/au2-api`

## Configure your app

Inside of your main.ts/main.js file register the plugin on the register method:

```js
import { AureliaApiConfiguration } from '@starnetbih/au2-api';

/* Configure in code */
Aurelia.register(AureliaApiConfiguration.configure(cfg => {
        cfg.register('myApi1', '/mypath');
        cfg.registerUsingCallback('myApi2', (cfg) => {
           return cfg.withBaseUrl('/mypath'l)
          },
          { headers: {'Accept': 'application/json'}
        );
    }));

/* Or configure by convention, using au2-configuration plugin */
Aurelia.register(AureliaApiConfiguration); 
```

#### Configure using configuration

Make sure that your config.json used by au2-configuration plugin contains **au2-api** section:

```js
{
 "au2-api": {
  "myApi1": {
   "url": "http://localhost:5005"
  },
  "myApi2": {
   "url": "http://localhost:5000",
   "auth": true
  }
 }
}
```

Setting auth to true will include credentials with requests.  

## Usage

```js
import { IApiEndpoints } from '@starnetbih/au2-api';

export class MyApp {

    constructor(@IApiEndpoints private ApiEndpoints: IApiEndpoints) { }

    async attached() {
         const rest = this.ApiEndpoints.get('myApi1');
         const resp = await rest.find('/ba/entities?pageSize=10');
         console.log(resp);

         const req = {
            currentPage: 0,
            pageSize: 10,
            qry: {
                "name": "filterByName",
                "startsWith ": "Ag"
            }
        };
        const resp2 = await rest.post({ resource: '/typeaheads', body: req });
        console.log(resp2);
    }
}
```
npm package: @starnetbih/au2-auth
Description: Auth plugin for aurelia 2 (alpha)
Latest version: 0.2.3

# au2-auth

This library is a based on aurelia2-auth plugin and previous work done by SpoonX.

**Full disclosure**: this plugin is in alpha stage. Use at your own risk.

## Installation

`npm install @starnetbih/au2-auth` or `yarn add @starnetbih/au2-auth`

## Configuration

Inside of your main.ts/main.js file register the plugin on the register method:

```js
import { AureliaAuthConfiguration } from '@starnetbih/au2-auth';

Aurelia.register(AureliaAuthConfiguration); 

//Or configure
Aurelia.register(
     AureliaAuthConfiguration.configure({responseTokenProp: 'bearerToken'})
);


```

## Usage

```js
import { IAppConfiguration } from '@starnetbih/au2-auth';

export class MyApp {

    constructor( @IAuthService private Auth: IAuthService ) { }

    async attached() {
        let resp = await this.Auth.login({
            credentials: { username: "admin", password: "admin" }
        });
        console.log(this.Auth.getTokenPayload());
    }
}
```
npm package: @starnetbih/au2-configuration
Description: Configuration (app settings) plugin for aurelia 2 (alpha)
Latest version: 0.5.0

# au2-configuration

This library is a partial port of the aurelia-configuration plugin.

**Full disclosure**: this plugin is in alpha stage. Use at your own risk.

## Installation

`npm install @starnetbih/au2-configuration` or `yarn add @starnetbih/au2-configuration`

## Configuration

Inside of your main.ts/main.js file register the plugin on the register method:

```js
import { AureliaConfigurationConfiguration } from '@starnetbih/au2-configuration';

Aurelia.register(AureliaConfigurationConfiguration); 

//Or configure
Aurelia.register(
    AureliaConfigurationConfiguration.configure({ dir: 'mydir', file: 'myfile' })
);

```

### Default configuration conventions

Make sure that your src directory contains **config** directory with **config.json** file in it.
So:

- app
  - src
    - config
      - config.json

config.json example

```js
{
 "obj": {
  "sub": {
   "prop": "value"
  }
 }
}
```

### Setup your webpack.config.js

Make sure that you have `copy-webpack-plugin` installed

`npm install copy-webpack-plugin --save-dev` or `yarn add -D copy-webpack-plugin`

Configure *copy-webpack-plugin* so it copies your configuration do dist directory.

```js
/*Import plugin*/
const CopyWebpackPlugin = require('copy-webpack-plugin');

/*Initialize variables*/
const srcDir = path.resolve(__dirname, 'src');
const outDir = path.resolve(__dirname, 'dist');

/*Add CopyWebpackPlugin to plugins array*/
plugins: [
      new HtmlWebpackPlugin({ template: 'index.html' }),
      new Dotenv({
        path: `./.env${production ? '' :  '.' + (process.env.NODE_ENV || 'development')}`,
      }),
      analyze && new BundleAnalyzerPlugin(),
      new CopyWebpackPlugin({
        patterns:[
        { from: srcDir +'/config', to: outDir + '/config' }
      ]})
    ].filter(p => p)
```

## Usage

```js
import { IAureliaConfiguration } from '@starnetbih/au2-configuration';

export class MyApp {

    constructor( @IAureliaConfiguration private cfg: IAureliaConfiguration ) { }

    async attached() {
        console.log(this.cfg.get('obj.sub.prop'));
    }
}
```
npm package: @starnetbih/au2-paginator
Description: An Aurelia 2 plugin.
Latest version: 0.6.3

# au2-paginator

This project is bootstrapped by [aurelia/new](https://github.com/aurelia/new).

## Start dev web server

    npm start

Note this plugin project comes with a dev-app. The above command starts the dev app in `dev-app/` folder. The plugin source code is in `src/` folder.

## Build the plugin in production modern

    npm run build

It builds plugin into `dist/index.js` file.

Note when you do `npm publish` or `npm pack` to prepare the plugin package, it automatically run the above build command by the `prepare` script defined in your package.json `"scripts"` section.

## Consume the plugin

If your plugin is published to npm or a private registry, just install the plugin package.json

    npm install au2-paginator

If you want to directly use plugin's git repo.

    npm install git@github.com:username/au2-paginator.git

or

    npm install https://some.git.server/username/au2-paginator.git

If you want to install from local folder, don't do "npm install ../local/au2-paginator/" as the folder's `node_modules/` will cause webpack to complain about duplicated dependency like "@aurelia/metadata".

In this plugin's folder, do

    npm pack

This will pack the plugin into au2-paginator
In an application project's main file.

```js
import * as myPlugin from 'au2-paginator';
Aurelia
  // Load all exports from the plugin
  .register(myPlugin)
  .app(MyApp)
  .start();
```

## Unit Tests

    npm run test

Run unit tests in watch mode.

    npm run test:watch


## Analyze webpack bundle

    npm run analyze
npm package: @starnetbih/au2-servicestack-auth
Description: ServiceStack Auth plugin for aurelia 2 (alpha)
Latest version: 0.5.0

# au2-servicestack-auth

Aurelia 2 auth library for servicestack. JWT Tokens are maintained via Secure HttpOnly Cookies.
This plugin depends on:
- @starnetbih/au2-configuration
- @starnetbih/au2-api

Make sure that your src directory contains **config** directory with **config.json** file in it.
So:

- app
  - src
    - config
      - config.json

Add 'au2-api' section with key 'authApi' with url and auth set to true.

config.json example

```js
{
 "au2-api": {
  "authApi": {
   "url": "https://localhost:5010",
   "auth": true
  }
 }
}
```

**Full disclosure**: this plugin is in alpha stage. Use at your own risk.

## Installation

`npm install @starnetbih/au2-servicestack-auth` or `yarn add @starnetbih/au2-servicestack-auth`

## Usage

```js
import { IAuthService, IUserProfile, SS_AUTH_CHANNEL_SIGNED_IN, SS_AUTH_CHANNEL_SIGNED_OUT } from '@starnetbih/au2-servicestack-auth';
import { IEventAggregator } from 'aurelia';

export class MyApp {
 constructor(
    @IAuthService private Auth: IAuthService,
    @IEventAggregator readonly EventAggregator: IEventAggregator) {
        this.EventAggregator.subscribe(SS_AUTH_CHANNEL_SIGNED_IN, (usr) => {
            console.log(`${(usr as IUserProfile).displayName} signed in!`);
            console.log(usr);
        });
        this.EventAggregator.subscribe(SS_AUTH_CHANNEL_SIGNED_OUT, () => {
            console.log('User signed out');
        });
    }

    async attached() {
       await this.Auth.signIn({ username: "admin", password: "admin" });
       await this.Auth.signOut();
    }
}
```
npm package: @starnetbih/au2-toaster
Description: An Aurelia 2 client application.
Latest version: 0.6.0

# au2-toaster

This project is bootstrapped by [aurelia/new](https://github.com/aurelia/new).

## Start dev web server

    npm start

## Build the app in production mode

    npm run build

It builds all files to dist folder. To deploy to production server, copy all the `dist/*` files to production root folder.

For example
```
dist/index.html
dist/foo.12345.js
```
Copy to production root folder
```
root_folder/index.html
root_folder/foo.12345.js
```


## Analyze webpack bundle

    npm run analyze
npm package: @starnote/publish-github
Description: 辰记发布Github SDK
Author: 辰记ludejun
Latest version: 1.0.2

# @starnote/publish-github 辰记发布Github SDK



### 开发须知
|-src
  |- index.ts 全局配置文件，发布主要读这个文件导出的变量，如$publish_github（在window上）
  |- electron 给桌面版提供的发布SDK
  |- node 给server端提供的发布SDK，目前不推荐
  |- web 给浏览器端提供的发布SDK，优先级最高

新的发布平台应该复制github的文件夹，改动上面4个文件的实现。

### 打包、发布
依托于母项目：使用monorepo理念管理所有发布SDK。使用turbo一个命令打包所有SDK，加快打包速度。使用changeset管理每个npm包的发布及changelog。

打包、发布命令需要在母项目中，参考readme执行。

母项目URL在package.json中。