Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun ts extension and Deploy to prod refresh #742

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/advanced/5_sharing_common_logic/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,25 @@ scripts locally and on Windmill. See [Developing scripts locally](../4_local_dev

## Deno or Bun relative imports for sharing common logic

Similarly to Python, it is possible to import directly from other TypeScript scripts. One can simply follow the path layout. For instance,
Similarly to [Python](#python-relative-imports-for-sharing-common-logic), it is possible to import directly from other TypeScript scripts. One can simply follow the path layout. For instance,
`import { foo } from "/f/<foldername>/script_name.ts"`. A more verbose example below:

```typescript
import { main as foo, util } from '../my_script_path.ts';
```

With [Bun](../../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx), you don't need to specify the `.ts` file extension (it is only required for the [Deno](../../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx#deno) runtime):

```typescript
import { main as foo, util } from '../my_script_path';
```

Relative imports syntax is much preferred as it will work on [local editors](../4_local_development/index.mdx) without further configuration.

You may also use absolute imports:

```typescript
import { main as foo, util } from '/f/common/my_script_path.ts';
import { main as foo, util } from '/f/common/my_script_path';

export async function main() {
await foo();
Expand All @@ -101,7 +107,7 @@ but to make it work with your local editor, you will need the following configur
}
```

Note that path in Windmill can have as many depth as needed, so you can have paths like this `f/folder/subfolder/my_script_path.ts` and relative imports will work at any level. Hence, it will work exactly the same as on local.
Note that [paths](../../core_concepts/16_roles_and_permissions/index.mdx#path) in Windmill can have as many depth as needed, so you can have paths like this `f/folder/subfolder/my_script_path` and relative imports will work at any level. Hence, it will work exactly the same as on local.

### Bundle per Script built by CLI

Expand Down
2 changes: 1 addition & 1 deletion docs/core_concepts/0_draft_and_deploy/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Once deployed, scripts, flows and apps will be visible, editable and/or runnable

:::tip Deploy to prod

For all details on Deployments to Prods, see [Deploy to prod](../../advanced/12_deploy_to_prod/index.mdx).
For all details on Deployments to Prod, see [Deploy to prod](../../advanced/12_deploy_to_prod/index.mdx).

:::

Expand Down
6 changes: 3 additions & 3 deletions docs/core_concepts/12_staging_prod/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ From a workspace in Windmill, you can deploy a script/flow/resource/variable and

:::tip Deploy to prod

For all details on Deployments to Prods, see [Deploy to prod](../../advanced/12_deploy_to_prod/index.mdx).
For all details on Deployments to Prod, see [Deploy to prod](../../advanced/12_deploy_to_prod/index.mdx).

:::

Expand All @@ -25,9 +25,9 @@ The [Draft and deploy](../0_draft_and_deploy/index.mdx) is another feature that

## How it works

For users with admin rights on the source workspace, in the `Workspace` menu, go to the "Dev/Staging/Prod" tab and pick a workspace for "Workspace to link to".
For users with admin rights on the source workspace, in the `Workspace` settings, go to the "Deployment UI" tab and pick a workspace for "Workspace to link to".

![Link to a workspace](./workspace_to_link_to.png.webp 'Link to a workspace')
![Link to a workspace](./workspace_to_link_to.png 'Link to a workspace')

This workspace to link to can for example be:

Expand Down
Binary file modified docs/core_concepts/12_staging_prod/workspace_to_link_to.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading