Skip to content

use deno and node#95

Closed
maya-barak wants to merge 14 commits intomainfrom
maya/per-12080-new-deno-and-npm
Closed

use deno and node#95
maya-barak wants to merge 14 commits intomainfrom
maya/per-12080-new-deno-and-npm

Conversation

@maya-barak
Copy link
Copy Markdown
Contributor

Pull Request

Description

Type of Change

  • Bug fix
  • New feature/command
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/update
  • Other (please describe):

Checklist

  • I have created an issue and linked it in this PR
  • I have created a branch from main with an appropriate name (e.g., fix/issue-123, feature/new-command)
  • My code follows the project's coding style guidelines
  • I have added tests for my changes (>90% coverage of new code)
  • I have updated the documentation if necessary
  • All tests pass locally
  • Lint checks pass locally
  • I have reviewed my own code for potential issues

New Command Details (if applicable)

  • Command is placed in the src/commands directory
  • Command file contains only argument configuration and a root command component
  • Command is wrapped with the AuthProvider component
  • Command has an optional apiKey argument
  • API key scope is declared for the command
  • Documentation added to the README

Additional Notes

Screenshots/Recordings

Copy link
Copy Markdown
Collaborator

@gemanor gemanor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress. Let's continue the discussion on the comments

@@ -0,0 +1,14 @@
#!/usr/bin/env -S deno run
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this file?

package.json Outdated
"type": "module",
"engines": {
"node": ">=22"
"node": ">=20"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We intentionally used node 22 to avoid errors that related to Pastel

package.json Outdated
"simple-check": "npx tsx ./source/cli.tsx pdp check -u filip@permit.io -a create -r task",
"test:ts": "tsc --noEmit"
"test:ts": "tsc --noEmit",
"start": "node dist/cli.js"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need it? As an alias for the CLI?

README.md Outdated
Comment on lines +26 to +31
### Using Deno

```bash
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --allow-sys https://raw.githubusercontent.com/permitio/permit-cli/main/source/cli.deno.tsx
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I explained myself wrong, but our mission here is to create a binary that does not require either Deno or Node to be installed. We used Deno because it support the generation of such binaries using the deno compile command


```bash
# Run the PDP container
$ permit pdp run
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK CLI commands are usually documented with the $ sign; any special reason you removed it?

path: dist/
retention-days: 7

- name: Upload Deno artifact
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After creating the binaries (using deno compile, see in further comment), we should find a testing as a service platform that allows us to run it on three OSs (Windows, OS X, Linux) and check the executable is working.

@maya-barak maya-barak force-pushed the maya/per-12080-new-deno-and-npm branch from 4d1feae to 5b47448 Compare April 2, 2025 14:45
@maya-barak maya-barak force-pushed the maya/per-12080-new-deno-and-npm branch from 6e2003f to 9964b9e Compare April 3, 2025 10:54
@gemanor gemanor closed this Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants