Skip to content

Commit 4736056

Browse files
Merge pull request #143 from appwrite/dev
Deno fixes among others
2 parents aa69621 + 5e55d29 commit 4736056

24 files changed

+114
-44
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
2929

3030
```sh
3131
$ appwrite -v
32-
6.0.0
32+
6.0.1
3333
```
3434

3535
### Install using prebuilt binaries
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
6060
Once the installation completes, you can verify your install using
6161
```
6262
$ appwrite -v
63-
6.0.0
63+
6.0.1
6464
```
6565

6666
## Getting Started

docs/examples/databases/update-boolean-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ appwrite databases updateBooleanAttribute \
33
--collectionId <COLLECTION_ID> \
44
--key '' \
55
--required false \
6-
--default false
6+
--default false \
7+

docs/examples/databases/update-datetime-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ appwrite databases updateDatetimeAttribute \
33
--collectionId <COLLECTION_ID> \
44
--key '' \
55
--required false \
6-
--default ''
6+
--default '' \
7+

docs/examples/databases/update-email-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ appwrite databases updateEmailAttribute \
33
--collectionId <COLLECTION_ID> \
44
--key '' \
55
--required false \
6-
6+
--default [email protected] \
7+

docs/examples/databases/update-enum-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ appwrite databases updateEnumAttribute \
44
--key '' \
55
--elements one two three \
66
--required false \
7-
--default <DEFAULT>
7+
--default <DEFAULT> \
8+

docs/examples/databases/update-float-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ appwrite databases updateFloatAttribute \
55
--required false \
66
--min null \
77
--max null \
8-
--default null
8+
--default null \
9+

docs/examples/databases/update-integer-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ appwrite databases updateIntegerAttribute \
55
--required false \
66
--min null \
77
--max null \
8-
--default null
8+
--default null \
9+

docs/examples/databases/update-ip-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ appwrite databases updateIpAttribute \
33
--collectionId <COLLECTION_ID> \
44
--key '' \
55
--required false \
6-
--default ''
6+
--default '' \
7+

docs/examples/databases/update-relationship-attribute.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ appwrite databases updateRelationshipAttribute \
33
--collectionId <COLLECTION_ID> \
44
--key '' \
55

6+

docs/examples/databases/update-string-attribute.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ appwrite databases updateStringAttribute \
33
--collectionId <COLLECTION_ID> \
44
--key '' \
55
--required false \
6-
--default <DEFAULT>
6+
--default <DEFAULT> \
7+
8+

docs/examples/databases/update-url-attribute.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ appwrite databases updateUrlAttribute \
33
--collectionId <COLLECTION_ID> \
44
--key '' \
55
--required false \
6-
--default https://example.com
6+
--default https://example.com \
7+

install.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# You can use "View source" of this page to see the full script.
1414

1515
# REPO
16-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0/appwrite-cli-win-x64.exe"
17-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0/appwrite-cli-win-arm64.exe"
16+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.1/appwrite-cli-win-x64.exe"
17+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.1/appwrite-cli-win-arm64.exe"
1818

1919
$APPWRITE_BINARY_NAME = "appwrite.exe"
2020

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ printSuccess() {
9797
downloadBinary() {
9898
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
9999

100-
GITHUB_LATEST_VERSION="6.0.0"
100+
GITHUB_LATEST_VERSION="6.0.1"
101101
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
102102
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
103103

lib/client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Client {
1616
'x-sdk-name': 'Command Line',
1717
'x-sdk-platform': 'console',
1818
'x-sdk-language': 'cli',
19-
'x-sdk-version': '6.0.0',
20-
'user-agent' : `AppwriteCLI/6.0.0 (${os.type()} ${os.version()}; ${os.arch()})`,
19+
'x-sdk-version': '6.0.1',
20+
'user-agent' : `AppwriteCLI/6.0.1 (${os.type()} ${os.version()}; ${os.arch()})`,
2121
'X-Appwrite-Response-Format' : '1.6.0',
2222
};
2323
}

lib/commands/databases.js

+65-10
Large diffs are not rendered by default.

lib/commands/generic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const DEFAULT_ENDPOINT = 'https://cloud.appwrite.io/v1';
1313
const loginCommand = async ({ email, password, endpoint, mfa, code }) => {
1414
const oldCurrent = globalConfig.getCurrentSession();
1515

16-
const configEndpoint = endpoint ?? globalConfig.getEndpoint() ?? DEFAULT_ENDPOINT;
16+
const configEndpoint = (endpoint ?? globalConfig.getEndpoint()) || DEFAULT_ENDPOINT;
1717

1818
if (globalConfig.getCurrentSession() !== '') {
1919
log('You are currently signed in as ' + globalConfig.getEmail());

lib/commands/run.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ const runFunction = async ({ port, functionId, withVariables, reload, userId } =
9797
process.exit();
9898
});
9999

100-
const logsPath = path.join(process.cwd(), func.path, '.appwrite/logs.txt');
101-
const errorsPath = path.join(process.cwd(), func.path, '.appwrite/errors.txt');
100+
const logsPath = path.join(localConfig.getDirname(), func.path, '.appwrite/logs.txt');
101+
const errorsPath = path.join(localConfig.getDirname(), func.path, '.appwrite/errors.txt');
102102

103103
if(!fs.existsSync(path.dirname(logsPath))) {
104104
fs.mkdirSync(path.dirname(logsPath), { recursive: true });
@@ -131,7 +131,7 @@ const runFunction = async ({ port, functionId, withVariables, reload, userId } =
131131
}
132132
}
133133

134-
const functionPath = path.join(process.cwd(), func.path);
134+
const functionPath = path.join(localConfig.getDirname(), func.path);
135135
const envPath = path.join(functionPath, '.env');
136136
if(fs.existsSync(envPath)) {
137137
const env = parseDotenv(fs.readFileSync(envPath).toString() ?? '');
@@ -192,7 +192,7 @@ const runFunction = async ({ port, functionId, withVariables, reload, userId } =
192192
}
193193

194194
chokidar.watch('.', {
195-
cwd: path.join(process.cwd(), func.path),
195+
cwd: path.join(localConfig.getDirname(), func.path),
196196
ignoreInitial: true,
197197
ignored: (xpath) => {
198198
const relativePath = path.relative(functionPath, xpath);

lib/config.js

+4
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ class Local extends Config {
145145
this.configDirectoryPath =_path.dirname(absolutePath);
146146
}
147147

148+
getDirname() {
149+
return _path.dirname(this.path)
150+
}
151+
148152
getFunctions() {
149153
if (!this.has("functions")) {
150154
return [];

lib/emulation/docker.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function dockerBuild(func, variables) {
4747
const runtimeName = runtimeChunks.join("-");
4848
const imageName = `openruntimes/${runtimeName}:${openRuntimesVersion}-${runtimeVersion}`;
4949

50-
const functionDir = path.join(process.cwd(), func.path);
50+
const functionDir = path.join(localConfig.getDirname(), func.path);
5151

5252
const id = func.$id;
5353

@@ -124,7 +124,7 @@ async function dockerBuild(func, variables) {
124124
return;
125125
}
126126

127-
const copyPath = path.join(process.cwd(), func.path, '.appwrite', 'build.tar.gz');
127+
const copyPath = path.join(localConfig.getDirname(), func.path, '.appwrite', 'build.tar.gz');
128128
const copyDir = path.dirname(copyPath);
129129
if (!fs.existsSync(copyDir)) {
130130
fs.mkdirSync(copyDir, { recursive: true });
@@ -143,7 +143,7 @@ async function dockerBuild(func, variables) {
143143

144144
await dockerStop(id);
145145

146-
const tempPath = path.join(process.cwd(), func.path, 'code.tar.gz');
146+
const tempPath = path.join(localConfig.getDirname(), func.path, 'code.tar.gz');
147147
if (fs.existsSync(tempPath)) {
148148
fs.rmSync(tempPath, { force: true });
149149
}
@@ -153,7 +153,7 @@ async function dockerBuild(func, variables) {
153153

154154
async function dockerStart(func, variables, port) {
155155
// Pack function files
156-
const functionDir = path.join(process.cwd(), func.path);
156+
const functionDir = path.join(localConfig.getDirname(), func.path);
157157

158158
const runtimeChunks = func.runtime.split("-");
159159
const runtimeVersion = runtimeChunks.pop();
@@ -211,12 +211,12 @@ async function dockerCleanup(functionId) {
211211
await dockerStop(functionId);
212212

213213
const func = localConfig.getFunction(functionId);
214-
const appwritePath = path.join(process.cwd(), func.path, '.appwrite');
214+
const appwritePath = path.join(localConfig.getDirname(), func.path, '.appwrite');
215215
if (fs.existsSync(appwritePath)) {
216216
fs.rmSync(appwritePath, { recursive: true, force: true });
217217
}
218218

219-
const tempPath = path.join(process.cwd(), func.path, 'code.tar.gz');
219+
const tempPath = path.join(localConfig.getDirname(), func.path, 'code.tar.gz');
220220
if (fs.existsSync(tempPath)) {
221221
fs.rmSync(tempPath, { force: true });
222222
}

lib/emulation/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const systemTools = {
5050
},
5151
'deno': {
5252
isCompiled: false,
53-
startCommand: "deno start",
53+
startCommand: "deno run --allow-run --allow-net --allow-write --allow-read --allow-env src/server.ts",
5454
dependencyFiles: [ ]
5555
},
5656
'dart': {

lib/parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const parseError = (err) => {
120120
} catch {
121121
}
122122

123-
const version = '6.0.0';
123+
const version = '6.0.1';
124124
const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
125125
const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud}`;
126126

lib/questions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const getInstallCommand = (runtime) => {
9494
case 'dart':
9595
return 'dart pub get';
9696
case 'deno':
97-
return "deno install";
97+
return "deno cache src/main.ts";
9898
case 'node':
9999
return 'npm install';
100100
case 'bun':

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "appwrite-cli",
33
"homepage": "https://appwrite.io/support",
44
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5-
"version": "6.0.0",
5+
"version": "6.0.1",
66
"license": "BSD-3-Clause",
77
"main": "index.js",
88
"bin": {

scoop/appwrite.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
3-
"version": "6.0.0",
3+
"version": "6.0.1",
44
"description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
55
"homepage": "https://github.com/appwrite/sdk-for-cli",
66
"license": "BSD-3-Clause",
77
"architecture": {
88
"64bit": {
9-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0/appwrite-cli-win-x64.exe",
9+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.1/appwrite-cli-win-x64.exe",
1010
"bin": [
1111
[
1212
"appwrite-cli-win-x64.exe",
@@ -15,7 +15,7 @@
1515
]
1616
},
1717
"arm64": {
18-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0/appwrite-cli-win-arm64.exe",
18+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.1/appwrite-cli-win-arm64.exe",
1919
"bin": [
2020
[
2121
"appwrite-cli-win-arm64.exe",

0 commit comments

Comments
 (0)