Skip to content

Commit

Permalink
chore!: remove allow-hrtime by default for Deno (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel authored Dec 11, 2024
1 parent 9d56069 commit 7b748a4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 15 deletions.
8 changes: 1 addition & 7 deletions src/parsers/get-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ export const runner = (filename: string, configs?: Configs): string[] => {
? configs.deno.allow
.map((allow) => (allow ? `--allow-${allow}` : ''))
.filter((allow) => allow)
: [
'--allow-read',
'--allow-env',
'--allow-run',
'--allow-net',
'--allow-hrtime',
];
: ['--allow-read', '--allow-env', '--allow-run', '--allow-net'];

const denoDeny = configs?.deno?.deny
? configs.deno.deny
Expand Down
2 changes: 1 addition & 1 deletion test/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { poku } from '../src/modules/essentials/poku.js';
poku(['test/unit', 'test/integration', 'test/e2e'], {
debug: true,
deno: {
allow: ['read', 'write', 'hrtime', 'env', 'run', 'net'],
allow: ['read', 'write', 'env', 'run', 'net'],
},
});
1 change: 0 additions & 1 deletion test/unit/deno/allow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ test('Deno Permissions (Allow)', () => {
'--allow-env',
'--allow-run',
'--allow-net',
'--allow-hrtime',
],
'Default Permissions'
);
Expand Down
4 changes: 2 additions & 2 deletions website/docs/documentation/poku/config-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = defineConfig({
},
platform: 'node', // "node", "bun" and "deno"
deno: {
allow: ['run', 'env', 'read', 'hrtime', 'net'],
allow: ['run', 'env', 'read', 'net'],
deny: [], // Same as allow
cjs: ['.js', '.cjs'], // specific extensions
// "cjs": true // all extensions
Expand Down Expand Up @@ -126,7 +126,7 @@ Create a `.pokurc.json` (or `.pokurc.jsonc`) in your project's root directory, f
},
"platform": "node", // "node", "bun" and "deno"
"deno": {
"allow": ["run", "env", "read", "hrtime", "net"],
"allow": ["run", "env", "read", "net"],
"deny": [], // Same as allow
"cjs": [".js", ".cjs"], // specific extensions
// "cjs": true // all extensions
Expand Down
2 changes: 1 addition & 1 deletion website/docs/documentation/poku/options/deno.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Exclusive options for **Deno** platform.

Change permissions for **Deno**.

By default **Poku** uses `--allow-run`, `--allow-env`, `--allow-read`, `allow-hrtime` and `--allow-net`.
By default **Poku** uses `--allow-run`, `--allow-env`, `--allow-read` and `--allow-net`.

### CLI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = defineConfig({
},
platform: 'node', // "node", "bun" e "deno"
deno: {
allow: ['run', 'env', 'read', 'hrtime', 'net'],
allow: ['run', 'env', 'read', 'net'],
deny: [], // O mesmo que allow
cjs: ['.js', '.cjs'], // extensões específicas
// "cjs": true // todas as extensões
Expand Down Expand Up @@ -128,7 +128,7 @@ Crie um arquivo `.pokurc.json` (ou `.pokurc.jsonc`) no diretório raiz do seu pr
},
"platform": "node", // "node", "bun" e "deno"
"deno": {
"allow": ["run", "env", "read", "hrtime", "net"],
"allow": ["run", "env", "read", "net"],
"deny": [], // O mesmo que allow
"cjs": [".js", ".cjs"], // extensões específicas
// "cjs": true // todas as extensões
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Opções exclusivas para a plataforma **Deno**.

Altere as permissões para o **Deno**.

Por padrão, o **Poku** utiliza `--allow-run`, `--allow-env`, `--allow-read`, `allow-hrtime` e `--allow-net`.
Por padrão, o **Poku** utiliza `--allow-run`, `--allow-env`, `--allow-read` e `--allow-net`.

### CLI

Expand Down

0 comments on commit 7b748a4

Please sign in to comment.