Skip to content

Commit f577ea6

Browse files
authored
build: Release (#1881)
2 parents b1ac423 + ef34d37 commit f577ea6

39 files changed

+37083
-8952
lines changed

.eslintrc.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"root": true,
33
"extends": [
44
"eslint:recommended",
5-
"plugin:jsdoc/recommended"
5+
"plugin:jsdoc/recommended",
6+
"plugin:flowtype/recommended"
67
],
78
"env": {
89
"node": true,
910
"es6": true
1011
},
11-
"parser": "babel-eslint",
12+
"parser": "@babel/eslint-parser",
1213
"globals": {
1314
"wx": true
1415
},
@@ -18,7 +19,8 @@
1819
],
1920
"parserOptions": {
2021
"ecmaVersion": 6,
21-
"sourceType": "module"
22+
"sourceType": "module",
23+
"requireConfigFile": false
2224
},
2325
"rules": {
2426
"indent": ["error", 2],
@@ -34,6 +36,7 @@
3436
"no-console": 0,
3537
"no-prototype-builtins": "off",
3638
"require-atomic-updates": "off",
39+
"flowtype/no-types-missing-file-annotation": 0,
3740
"jsdoc/require-jsdoc": 0,
3841
"jsdoc/require-returns-description": 0,
3942
"jsdoc/require-param-description": 0,

.github/workflows/ci.yml

+9-11
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
check-lock-file-version:
1010
name: NPM Lock File Version
1111
timeout-minutes: 5
12-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
- name: Check NPM lock file version
1616
uses: mansona/npm-lockfile-version@v1
1717
with:
18-
version: 1
18+
version: 2
1919
build:
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 30
@@ -37,24 +37,22 @@ jobs:
3737
- name: Fix git protocol for Node 14
3838
if: ${{ startsWith(matrix.NODE_VERSION, '14.') }}
3939
run: sudo git config --system url."https://github".insteadOf "ssh://git@github"
40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v3
4141
- name: Use Node.js
42-
uses: actions/setup-node@v1
42+
uses: actions/setup-node@v3
4343
with:
4444
node-version: ${{ matrix.NODE_VERSION }}
4545
- name: Cache Node.js modules
46-
uses: actions/cache@v2
46+
uses: actions/cache@v3
4747
with:
4848
path: ~/.npm
49-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
49+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
5050
restore-keys: |
51-
${{ runner.os }}-node-
51+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
5252
- run: npm ci
53-
- run: npm install -g mongodb-runner
54-
- run: mongodb-runner start
5553
- run: npm run lint
5654
- run: npm test -- --maxWorkers=4
57-
- run: npm run integration
55+
- run: npm run test:mongodb
5856
env:
5957
CI: true
6058
- run: bash <(curl -s https://codecov.io/bash)
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: release-manual-docs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
default: ''
7+
description: 'Version tag:'
8+
jobs:
9+
docs-publish:
10+
if: github.event.inputs.tag != ''
11+
runs-on: ubuntu-18.04
12+
timeout-minutes: 15
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.event.inputs.tag }}
17+
- name: Use Node.js
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 16
21+
- name: Cache Node.js modules
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-node-
28+
- name: Generate Docs
29+
run: |
30+
npm ci
31+
npm run release_docs
32+
env:
33+
SOURCE_TAG: ${{ github.event.inputs.tag }}
34+
- name: Deploy
35+
uses: peaceiris/actions-gh-pages@v3.7.3
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
publish_dir: ./docs

changelogs/CHANGELOG_alpha.md

+35
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
# [4.0.0-alpha.12](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.11...4.0.0-alpha.12) (2023-02-06)
2+
3+
4+
### Features
5+
6+
* `LiveQueryClient.close` returns promise when WebSocket closes ([#1735](https://github.com/parse-community/Parse-SDK-JS/issues/1735)) ([979d660](https://github.com/parse-community/Parse-SDK-JS/commit/979d6607d5449dd3d3c5e51f36119bd05b25feaa))
7+
8+
# [4.0.0-alpha.11](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.10...4.0.0-alpha.11) (2023-02-04)
9+
10+
11+
### Bug Fixes
12+
13+
* Node engine version upper range is <19 despite Node 19 support ([#1732](https://github.com/parse-community/Parse-SDK-JS/issues/1732)) ([febe187](https://github.com/parse-community/Parse-SDK-JS/commit/febe187a24fb56e83542c00ae39148575fc57c4b))
14+
15+
# [4.0.0-alpha.10](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.9...4.0.0-alpha.10) (2023-02-04)
16+
17+
18+
### Features
19+
20+
* Upgrade Node Package Manager lock file `package-lock.json` to version 2 ([#1729](https://github.com/parse-community/Parse-SDK-JS/issues/1729)) ([e993786](https://github.com/parse-community/Parse-SDK-JS/commit/e993786cf0299b1150bf36afee1bc516e23e349a))
21+
22+
# [4.0.0-alpha.9](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.8...4.0.0-alpha.9) (2023-02-04)
23+
24+
25+
### Bug Fixes
26+
27+
* Saving a new `Parse.Object` with an unsaved `Parse.File` fails ([#1662](https://github.com/parse-community/Parse-SDK-JS/issues/1662)) ([16535a4](https://github.com/parse-community/Parse-SDK-JS/commit/16535a43f6c762983460aa837102a4c692de70bb))
28+
29+
# [4.0.0-alpha.8](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.7...4.0.0-alpha.8) (2023-02-04)
30+
31+
32+
### Bug Fixes
33+
34+
* `LiveQuerySubscription.unsubscribe` resolves promise before unsubscribing completes ([#1727](https://github.com/parse-community/Parse-SDK-JS/issues/1727)) ([1c96205](https://github.com/parse-community/Parse-SDK-JS/commit/1c96205cb3c162b21bf4508f7783400a28a99868))
35+
136
# [4.0.0-alpha.7](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.6...4.0.0-alpha.7) (2023-01-30)
237

338

changelogs/CHANGELOG_beta.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [4.1.0-beta.1](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.1...4.1.0-beta.1) (2023-03-01)
2+
3+
4+
### Bug Fixes
5+
6+
* `LiveQuerySubscription.unsubscribe` resolves promise before unsubscribing completes ([#1727](https://github.com/parse-community/Parse-SDK-JS/issues/1727)) ([1c96205](https://github.com/parse-community/Parse-SDK-JS/commit/1c96205cb3c162b21bf4508f7783400a28a99868))
7+
* Node engine version upper range is <19 despite Node 19 support ([#1732](https://github.com/parse-community/Parse-SDK-JS/issues/1732)) ([febe187](https://github.com/parse-community/Parse-SDK-JS/commit/febe187a24fb56e83542c00ae39148575fc57c4b))
8+
* Saving a new `Parse.Object` with an unsaved `Parse.File` fails ([#1662](https://github.com/parse-community/Parse-SDK-JS/issues/1662)) ([16535a4](https://github.com/parse-community/Parse-SDK-JS/commit/16535a43f6c762983460aa837102a4c692de70bb))
9+
10+
### Features
11+
12+
* `LiveQueryClient.close` returns promise when WebSocket closes ([#1735](https://github.com/parse-community/Parse-SDK-JS/issues/1735)) ([979d660](https://github.com/parse-community/Parse-SDK-JS/commit/979d6607d5449dd3d3c5e51f36119bd05b25feaa))
13+
* Upgrade Node Package Manager lock file `package-lock.json` to version 2 ([#1729](https://github.com/parse-community/Parse-SDK-JS/issues/1729)) ([e993786](https://github.com/parse-community/Parse-SDK-JS/commit/e993786cf0299b1150bf36afee1bc516e23e349a))
14+
115
## [4.0.1-beta.1](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0...4.0.1-beta.1) (2023-01-31)
216

317

gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const watch = require('gulp-watch');
1212
const BUILD = process.env.PARSE_BUILD || 'browser';
1313
const VERSION = require('./package.json').version;
1414

15-
const transformRuntime = ["@babel/transform-runtime", {
15+
const transformRuntime = ["@babel/plugin-transform-runtime", {
1616
"corejs": 3,
1717
"helpers": true,
1818
"regenerator": true,

integration/test/ParseEventuallyQueueTest.js

+51-55
Original file line numberDiff line numberDiff line change
@@ -190,67 +190,63 @@ describe('Parse EventuallyQueue', () => {
190190
assert.strictEqual(length, 0);
191191
});
192192

193-
it('can saveEventually', async done => {
193+
it('can saveEventually', async () => {
194194
const parseServer = await reconfigureServer();
195195
const object = new TestObject({ hash: 'saveSecret' });
196-
parseServer.server.close(async () => {
197-
await object.saveEventually();
198-
let length = await Parse.EventuallyQueue.length();
199-
assert(Parse.EventuallyQueue.isPolling());
200-
assert.strictEqual(length, 1);
201-
202-
await reconfigureServer({});
203-
while (Parse.EventuallyQueue.isPolling()) {
204-
await sleep(100);
205-
}
206-
assert.strictEqual(Parse.EventuallyQueue.isPolling(), false);
207-
208-
while (await Parse.EventuallyQueue.length()) {
209-
await sleep(100);
210-
}
211-
length = await Parse.EventuallyQueue.length();
212-
assert.strictEqual(length, 0);
213-
214-
const query = new Parse.Query(TestObject);
215-
query.equalTo('hash', 'saveSecret');
216-
let results = await query.find();
217-
while (results.length === 0) {
218-
results = await query.find();
219-
}
220-
assert.strictEqual(results.length, 1);
221-
done();
222-
});
196+
await new Promise((resolve) => parseServer.server.close(resolve));
197+
await object.saveEventually();
198+
let length = await Parse.EventuallyQueue.length();
199+
assert(Parse.EventuallyQueue.isPolling());
200+
assert.strictEqual(length, 1);
201+
202+
await reconfigureServer({});
203+
while (Parse.EventuallyQueue.isPolling()) {
204+
await sleep(100);
205+
}
206+
assert.strictEqual(Parse.EventuallyQueue.isPolling(), false);
207+
208+
while (await Parse.EventuallyQueue.length()) {
209+
await sleep(100);
210+
}
211+
length = await Parse.EventuallyQueue.length();
212+
assert.strictEqual(length, 0);
213+
214+
const query = new Parse.Query(TestObject);
215+
query.equalTo('hash', 'saveSecret');
216+
let results = await query.find();
217+
while (results.length === 0) {
218+
results = await query.find();
219+
}
220+
assert.strictEqual(results.length, 1);
223221
});
224222

225-
it('can destroyEventually', async done => {
223+
it('can destroyEventually', async () => {
226224
const parseServer = await reconfigureServer();
227225
const object = new TestObject({ hash: 'deleteSecret' });
228226
await object.save();
229-
parseServer.server.close(async () => {
230-
await object.destroyEventually();
231-
let length = await Parse.EventuallyQueue.length();
232-
assert(Parse.EventuallyQueue.isPolling());
233-
assert.strictEqual(length, 1);
234-
235-
await reconfigureServer({});
236-
while (Parse.EventuallyQueue.isPolling()) {
237-
await sleep(100);
238-
}
239-
assert.strictEqual(Parse.EventuallyQueue.isPolling(), false);
240-
while (await Parse.EventuallyQueue.length()) {
241-
await sleep(100);
242-
}
243-
length = await Parse.EventuallyQueue.length();
244-
assert.strictEqual(length, 0);
245-
246-
const query = new Parse.Query(TestObject);
247-
query.equalTo('hash', 'deleteSecret');
248-
let results = await query.find();
249-
while (results.length) {
250-
results = await query.find();
251-
}
252-
assert.strictEqual(results.length, 0);
253-
done();
254-
});
227+
await new Promise((resolve) => parseServer.server.close(resolve));
228+
await object.destroyEventually();
229+
let length = await Parse.EventuallyQueue.length();
230+
assert(Parse.EventuallyQueue.isPolling());
231+
assert.strictEqual(length, 1);
232+
233+
await reconfigureServer({});
234+
while (Parse.EventuallyQueue.isPolling()) {
235+
await sleep(100);
236+
}
237+
assert.strictEqual(Parse.EventuallyQueue.isPolling(), false);
238+
while (await Parse.EventuallyQueue.length()) {
239+
await sleep(100);
240+
}
241+
length = await Parse.EventuallyQueue.length();
242+
assert.strictEqual(length, 0);
243+
244+
const query = new Parse.Query(TestObject);
245+
query.equalTo('hash', 'deleteSecret');
246+
let results = await query.find();
247+
while (results.length) {
248+
results = await query.find();
249+
}
250+
assert.strictEqual(results.length, 0);
255251
});
256252
});

integration/test/ParseFileTest.js

+20
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,24 @@ describe('Parse.File', () => {
120120
assert.equal(e.code, Parse.Error.FILE_DELETE_ERROR);
121121
}
122122
});
123+
124+
it('can save file to localDatastore', async () => {
125+
Parse.enableLocalDatastore();
126+
const file = new Parse.File('parse-js-sdk', [61, 170, 236, 120]);
127+
const object = new Parse.Object('TestObject');
128+
await object.pin();
129+
130+
object.set('file', file);
131+
await object.save();
132+
133+
const query = new Parse.Query(TestObject);
134+
query.fromLocalDatastore();
135+
query.equalTo('objectId', object.id);
136+
const results = await query.find();
137+
138+
const url = results[0].get('file').url();
139+
assert.equal(results.length, 1);
140+
assert.notEqual(url, undefined);
141+
assert.equal(url, file.url());
142+
});
123143
});

0 commit comments

Comments
 (0)