glass-js
TypeScript icon, indicating that this package has built-in type declarations

1.3.7 • Public • Published

Glass

Explanation

The relevant directories are glass-react, glass-swc, and vscode-extension.

The other directories are irrelevant (babel-extension is not used, and www is a Next.js project that renders what you see on https://useglass.ai).

Running

  1. Add glass_swc.wasm to your config:
// next.config.js
const nextConfig = {
    experimental: {
        swcPlugins: [
            ['glass-js/swc', {}],
        ],
    }
}

Or if you want to use the development version on your own computer:

// next.config.js
const nextConfig = {
    experimental: {
        swcPlugins: [
            ['PATH/TO/glass/glass-swc/dist/glass_swc.wasm', {}],
        ],
    }
}
  1. Add <GlassProvider /> to your app.
import GlassProvider from "glass-js";

Or if you want to use the development version on your own computer:

import GlassProvider from "PATH/TO/GlassProvider";
  1. Run the vscode extension either through the VSCode marketplace, or opening vscode-extension inside a separate VSCode window and pressing F5.

Building

To get started developing, run these steps:

Run pnpm install to install everything. We use pnpm instead of npm because we're a monorepo and pnpm is more efficient, but it works exactly the same as npm.

Run npm run build:all to build both the Glass React bar and the Nextjs swc plugin (this just runs npm run build in both folders).

You don't have to do anything more unless you want to edit the extension. If you want to edit the extension, cd into vscode-extension and run npm install (we disabled pnpm in vscode-extension because most vscode docs use npm instead).

Publishing

You can publish two things:

  1. Contents of the vscode extension (from vscode-extension) to the VSCode marketplace.

  2. The <GlassProvider /> package (from glass-react) together with the SWC plugin (from glass-swc) to npm.

To publish vscode extension, it's like publishing any other vscode extension. Run vsce publish.

To publish the the npm package, run npm run publish. Make sure to increment the version number in the relevant package.json or you'll be rejected. Look at the command for more details, but in short it publishes only the built files.

/glass-js/

    Package Sidebar

    Install

    npm i glass-js

    Homepage

    useglass.ai

    Weekly Downloads

    61

    Version

    1.3.7

    License

    none

    Unpacked Size

    4.28 MB

    Total Files

    5

    Last publish

    Collaborators

    • mp187
    • andrew_glass