open-index/open-npm huggingface dataset:
npm package: @instnt/instnt-angular-js-main
Description: This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.6.
Latest version: 0.1.0

# InstntAngularJs

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.6.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
npm package: @instra/vite-plugin-instra
Description: Instra Vite plugin for serve-time env vars injection
Latest version: 0.0.2

# @instra/vite-plugin-instra (PoC)

Customer-installed Vite plugin for **serve-time** public env vars.

It rewrites direct reads of:
- `import.meta.env.INSTRA_PUBLIC_*`
- `process.env.INSTRA_PUBLIC_*`

into:
- `__instraEnv.INSTRA_PUBLIC_*`

…and injects (once per transformed module):

```ts
import __instraEnv from "instra-envs";
```

The specifier `instra-envs` is resolved to the runtime module path `/.instra/env.mjs` (same-origin).

## Build/preview without the Worker

To keep builds self-contained, the plugin emits a **static fallback** env module into the build output at:

- `dist/.instra/env.mjs` (derived from `runtimePath`)

This fallback is generated from `.env` files via Vite `loadEnv()` and includes **only the `INSTRA_PUBLIC_*` keys that were actually rewritten** in your source.

At runtime on the Instra platform, the multi-tenant edge Worker overrides `GET /.instra/env.mjs` to return per-tenant values.

## Install

```bash
pnpm add -D @instra/vite-plugin-instra
```

## Usage

```ts
// vite.config.ts
import { defineConfig } from "vite";
import { instraEnvPlugin } from "@instra/vite-plugin-instra";

export default defineConfig({
  plugins: [instraEnvPlugin()]
});
```

## Supported patterns (PoC)

✅ Supported (direct member access only):
- `import.meta.env.INSTRA_PUBLIC_API_URL`
- `process.env.INSTRA_PUBLIC_FLAG`

❌ Not supported yet (documented limitation):
- Bracket access: `import.meta.env["INSTRA_PUBLIC_X"]`, `process.env["INSTRA_PUBLIC_X"]`
- Destructuring: `const { INSTRA_PUBLIC_X } = import.meta.env` / `process.env`
- Indirect access: `const env = import.meta.env; env.INSTRA_PUBLIC_X`

## Runtime requirement

Your app must be served behind the Instra gateway Worker which serves:
- `GET /.instra/env.mjs`

…on the same hostname as the app.

## Options

```ts
instraEnvPlugin({
  prefix: "INSTRA_PUBLIC_",          // default
  moduleId: "instra-envs",           // default
  runtimePath: "/.instra/env.mjs"     // default
  emitStaticFallback: true,           // default
  devMiddleware: true                // default
})
```