Skip to content

Commit

Permalink
fix: add --unstable arg
Browse files Browse the repository at this point in the history
  • Loading branch information
xcatliu committed Mar 3, 2023
1 parent f5e280c commit 44951b6
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
deno-version: v1.30.3

- name: Run tests
run: deno test --allow-read --allow-write --allow-net --allow-env --allow-run src
run: deno test --unstable --allow-read --allow-write --allow-net --allow-env --allow-run src

- name: Build gh-pages
run: deno run --allow-read --allow-write --allow-net --allow-env --allow-run mod.ts build
run: deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run mod.ts build

- name: Deploy gh-pages
if: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ COPY --from=organizer /out /
# Install
WORKDIR /usr/src/install
ENV PATH "/root/.deno/bin:$PATH"
RUN deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic mod.ts \
RUN deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic mod.ts \
# Install dependencies
&& deno cache $(find src -name "*.ts*" ! -name "*_test.ts*")
&& deno cache --unstable $(find src -name "*.ts*" ! -name "*_test.ts*")

WORKDIR /pagic
COPY --from=permissions-giver /out/docker-entrypoint.sh /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# Install deno https://deno.land/#installation
curl -fsSL https://deno.land/x/install/install.sh | sh
# Install Pagic
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
```

### Initialize the project
Expand Down
2 changes: 1 addition & 1 deletion cloudbaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"pagic": {
"use": "@cloudbase/framework-plugin-website",
"inputs": {
"buildCommand": "cd pagic.cn && deno run --allow-read --allow-write build.ts && deno run --allow-read --allow-write --allow-net --allow-env --allow-run https://deno.land/x/[email protected]/mod.ts build",
"buildCommand": "cd pagic.cn && deno run --unstable --allow-read --allow-write build.ts && deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run https://deno.land/x/[email protected]/mod.ts build",
"outputPath": "pagic.cn/dist"
}
}
Expand Down
2 changes: 1 addition & 1 deletion mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S deno --allow-read --allow-write --allow-net --allow-env --allow-run
#!/usr/bin/env -S deno --unstable --allow-read --allow-write --allow-net --allow-env --allow-run
export { React, ReactDOM, ReactDOMServer } from './deps.ts';
export { t, Trans } from './src/plugins/i18n.tsx';

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "A static site generator powered by Deno + React",
"main": "mod.ts",
"scripts": {
"start": "deno run --allow-read --allow-write --allow-net --allow-env --allow-run mod.ts build --serve --watch",
"build": "deno run --allow-read --allow-write --allow-net --allow-env --allow-run mod.ts build",
"test": "deno test --allow-read --allow-write --allow-net --allow-env --allow-run src",
"start": "deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run mod.ts build --serve --watch",
"build": "deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run mod.ts build",
"test": "deno test --unstable --allow-read --allow-write --allow-net --allow-env --allow-run src",
"lint": "run-s eslint prettier",
"eslint": "eslint --ext .ts,.tsx,.js,.jsx .",
"eslint:fix": "eslint --ext .ts,.tsx,.js,.jsx --fix .",
Expand Down
6 changes: 3 additions & 3 deletions pagic.org/docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Build gh-pages
run: |
deno --version
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
pagic build
- name: Deploy gh-pages
Expand Down Expand Up @@ -67,10 +67,10 @@ Create a `deploy-vercel.sh` file in the project root directory:
curl -fsSL https://deno.land/x/install/install.sh | sh
# Install pagic
/vercel/.deno/bin/deno install --allow-read --allow-write --allow-net https://deno.land/x/pagic/mod.ts
/vercel/.deno/bin/deno install --unstable --allow-read --allow-write --allow-net https://deno.land/x/pagic/mod.ts
# Pagic build
/vercel/.deno/bin/deno run --allow-read --allow-write --allow-net --allow-env --allow-run https://deno.land/x/pagic/mod.ts build
/vercel/.deno/bin/deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run https://deno.land/x/pagic/mod.ts build
```

Configure script command in `package.json`:
Expand Down
6 changes: 3 additions & 3 deletions pagic.org/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ Other installation methods (PowerShell, Homebrew, etc.) can be found in [Deno of
Execute the following command to install the latest version of Pagic:

```bash
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
```

If you need to install a specific version of Pagic, you can add the version in the URL:

```bash
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
```

> Pagic will only require the necessary permissions. If you want to further restrict Pagic's runtime permissions, you can limit it by specifying the read and write directories:
>
> ```bash
> deno install --allow-read=/home/xcatliu/site --allow-write=/home/xcatliu/site --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
> deno install --unstable --allow-read=/home/xcatliu/site --allow-write=/home/xcatliu/site --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
> ```
### Install via Docker
Expand Down
2 changes: 1 addition & 1 deletion pagic.org/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const IndexPage: PagicLayout = ({ config, language }) => (
<code
dangerouslySetInnerHTML={{
__html: `# ${t('Install pagic')}
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
# ${t('Create pagic.config.ts and README.md')}
mkdir site && cd site && echo "export default {};" > pagic.config.ts && echo "# Hello world" > README.md
Expand Down
6 changes: 3 additions & 3 deletions pagic.org/zh-CN/docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Build gh-pages
run: |
deno --version
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
pagic build
- name: Deploy gh-pages
Expand Down Expand Up @@ -94,10 +94,10 @@ jobs:
curl -fsSL https://deno.land/x/install/install.sh | sh
# Install pagic
/vercel/.deno/bin/deno install --allow-read --allow-write --allow-net https://deno.land/x/pagic/mod.ts
/vercel/.deno/bin/deno install --unstable --allow-read --allow-write --allow-net https://deno.land/x/pagic/mod.ts
# Pagic build
/vercel/.deno/bin/deno run --allow-read --allow-write --allow-net --allow-env --allow-run https://deno.land/x/pagic/mod.ts build
/vercel/.deno/bin/deno run --unstable --allow-read --allow-write --allow-net --allow-env --allow-run https://deno.land/x/pagic/mod.ts build
```

在 `package.json` 配置脚本命令:
Expand Down
6 changes: 3 additions & 3 deletions pagic.org/zh-CN/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ curl -fsSL https://deno.land/x/install/install.sh | sh
执行以下命令来安装最新版本的 Pagic:

```bash
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
```

若需要安装指定版本的 Pagic,则可以在安装的 URL 中加入版本号:

```bash
deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
deno install --unstable --allow-read --allow-write --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/[email protected]/mod.ts
```

> Pagic 只会要求必须用到的权限,如果你希望更进一步限制 Pagic 运行时的权限,可以通过指定读写目录的方式加以限制:
>
> ```bash
> deno install --allow-read=/home/xcatliu/site --allow-write=/home/xcatliu/site --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
> deno install --unstable --allow-read=/home/xcatliu/site --allow-write=/home/xcatliu/site --allow-net --allow-env --allow-run --name=pagic https://deno.land/x/pagic/mod.ts
> ```
### 通过 Docker 安装
Expand Down

0 comments on commit 44951b6

Please sign in to comment.