Skip to content

build: Release #1883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 60 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
beda1a1
ci: Remove release-automated-scheduler (#1802)
mtrezza Mar 1, 2023
04a02f0
chore(release): 4.1.0-alpha.1 [skip ci]
semantic-release-bot Mar 1, 2023
b755e42
fix: `Parse.File.cancel` starts new attempt to save file (#1781)
dplewis Mar 1, 2023
fd108bf
chore(release): 4.1.0-alpha.2 [skip ci]
semantic-release-bot Mar 1, 2023
c87768f
refactor: Bump eslint-plugin-jsdoc from 40.0.0 to 40.0.1 (#1805)
dependabot[bot] Mar 3, 2023
e64fbe3
refactor: Bump parse-server from `e9ab6b0` to `0f1979f` (#1809)
dependabot[bot] Mar 6, 2023
1c97b4c
refactor: Bump metro-react-native-babel-preset from 0.75.1 to 0.76.0 …
dependabot[bot] Mar 7, 2023
20ce483
refactor: Bump puppeteer from 19.7.2 to 19.7.3 (#1812)
dependabot[bot] Mar 7, 2023
fae2f78
refactor: Bump babel-jest from 29.4.3 to 29.5.0 (#1814)
dependabot[bot] Mar 8, 2023
c67fe66
refactor: Bump jest-environment-jsdom from 29.4.3 to 29.5.0 (#1815)
dependabot[bot] Mar 9, 2023
010ed6c
refactor: Bump lint-staged from 13.1.2 to 13.2.0 (#1816)
dependabot[bot] Mar 10, 2023
2fef57b
refactor: Bump puppeteer from 19.7.3 to 19.7.5 (#1820)
dependabot[bot] Mar 14, 2023
2a9cd6c
refactor: Bump parse-server from `0f1979f` to `65e5879` (#1819)
dependabot[bot] Mar 14, 2023
ad06af0
refactor: Bump eslint-plugin-jsdoc from 40.0.1 to 40.0.3 (#1822)
dependabot[bot] Mar 16, 2023
9149d0d
refactor: Bump @babel/eslint-parser from 7.19.1 to 7.21.3 (#1821)
dependabot[bot] Mar 16, 2023
0a8b955
refactor: Bump jasmine from 4.5.0 to 4.6.0 (#1824)
dependabot[bot] Mar 18, 2023
dba63ac
refactor: Bump jest from 29.4.3 to 29.5.0 (#1823)
dependabot[bot] Mar 18, 2023
163a2db
refactor: Bump prettier from 2.8.4 to 2.8.5 (#1827)
dependabot[bot] Mar 20, 2023
79e8877
refactor: Bump @babel/core from 7.21.0 to 7.21.3 (#1828)
dependabot[bot] Mar 22, 2023
c1689cd
refactor: Bump core-js from 3.29.0 to 3.29.1 (#1826)
dependabot[bot] Mar 22, 2023
39032b5
refactor: Bump eslint-plugin-jsdoc from 40.0.3 to 40.1.0 (#1829)
dependabot[bot] Mar 23, 2023
659657d
refactor: Bump prettier from 2.8.5 to 2.8.6 (#1830)
dependabot[bot] Mar 23, 2023
d1928d2
refactor: Bump @semantic-release/changelog from 6.0.2 to 6.0.3 (#1832)
dependabot[bot] Mar 25, 2023
edac791
refactor: Bump puppeteer from 19.7.5 to 19.8.0 (#1831)
dependabot[bot] Mar 25, 2023
f30c3ab
refactor: Bump eslint from 8.35.0 to 8.36.0 (#1834)
dependabot[bot] Mar 27, 2023
a59ce65
refactor: Bump prettier from 2.8.6 to 2.8.7 (#1835)
dependabot[bot] Mar 28, 2023
7479343
feat: Add `ParseQuery.watch` to trigger LiveQuery only on update of s…
dplewis Apr 2, 2023
a6f8bc1
chore(release): 4.1.0-alpha.3 [skip ci]
semantic-release-bot Apr 2, 2023
35c8c7c
refactor: Bump eslint from 8.36.0 to 8.37.0 (#1836)
dependabot[bot] Apr 2, 2023
a6cc8e7
refactor: Bump puppeteer from 19.8.0 to 19.8.2 (#1837)
dependabot[bot] Apr 2, 2023
c6376b8
refactor: Bump @babel/plugin-transform-runtime from 7.21.0 to 7.21.4 …
dependabot[bot] Apr 3, 2023
21c1529
refactor: Bump puppeteer from 19.8.2 to 19.8.5 (#1845)
dependabot[bot] Apr 9, 2023
5077822
refactor: Bump eslint-plugin-jsdoc from 40.1.0 to 40.1.2 (#1846)
dependabot[bot] Apr 9, 2023
a17ea76
refactor: Bump eslint from 8.37.0 to 8.38.0 (#1849)
dependabot[bot] Apr 10, 2023
de774a5
refactor: Bump metro-react-native-babel-preset from 0.76.0 to 0.76.1 …
dependabot[bot] Apr 10, 2023
d1761bf
refactor: Bump eslint-plugin-jsdoc from 40.1.2 to 40.3.0 (#1851)
dependabot[bot] Apr 11, 2023
8030e8b
refactor: Bump @babel/core from 7.21.3 to 7.21.4 (#1850)
dependabot[bot] Apr 11, 2023
f8aedf4
refactor: Bump @babel/preset-env from 7.20.2 to 7.21.4 (#1854)
dependabot[bot] Apr 12, 2023
29d31d5
refactor: Bump ws from 8.12.0 to 8.13.0 (#1852)
dblythy Apr 13, 2023
d1080d9
refactor: Bump lint-staged from 13.2.0 to 13.2.1 (#1855)
dependabot[bot] Apr 13, 2023
290e837
refactor: Bump core-js from 3.29.1 to 3.30.0 (#1856)
dependabot[bot] Apr 13, 2023
159bd74
refactor: Bump eslint-plugin-jsdoc from 40.3.0 to 41.1.1 (#1853)
dependabot[bot] Apr 14, 2023
aa541d4
refactor: Bump core-js from 3.30.0 to 3.30.1 (#1859)
dependabot[bot] Apr 15, 2023
f980cab
refactor: Bump metro-react-native-babel-preset from 0.76.1 to 0.76.2 …
dependabot[bot] Apr 16, 2023
b92b46b
refactor: Bump parse-server from `65e5879` to `177891e` (#1857)
dependabot[bot] Apr 16, 2023
e4d42e0
refactor: Bump puppeteer from 19.8.5 to 19.9.1 (#1860)
dependabot[bot] Apr 17, 2023
b48caa8
refactor: Bump eslint-plugin-jsdoc from 41.1.1 to 41.1.2 (#1861)
dependabot[bot] Apr 17, 2023
9fb26b6
refactor: Bump eslint-plugin-jsdoc from 41.1.2 to 43.0.3 (#1862)
dependabot[bot] Apr 18, 2023
882fab2
refactor: Bump eslint-plugin-jsdoc from 43.0.3 to 43.0.6 (#1863)
dependabot[bot] Apr 20, 2023
9007ab4
refactor: Bump puppeteer from 19.9.1 to 19.10.1 (#1866)
dependabot[bot] Apr 21, 2023
79f64f1
refactor: Bump eslint-plugin-jsdoc from 43.0.6 to 43.0.7 (#1865)
dependabot[bot] Apr 22, 2023
4a9255a
refactor: Bump prettier from 2.8.7 to 2.8.8 (#1868)
dependabot[bot] Apr 24, 2023
af6f197
refactor: Bump eslint from 8.38.0 to 8.39.0 (#1867)
dependabot[bot] Apr 25, 2023
fe03f51
refactor: Bump puppeteer from 19.10.1 to 19.11.1 (#1872)
dependabot[bot] Apr 26, 2023
ced1ff5
refactor: Bump metro-react-native-babel-preset from 0.76.2 to 0.76.3 …
dependabot[bot] Apr 26, 2023
24c03dd
refactor: Bump lint-staged from 13.2.1 to 13.2.2 (#1874)
dependabot[bot] Apr 27, 2023
381fcfc
feat: Add `Parse.User.loginAs` (#1875)
dplewis Apr 28, 2023
3013470
chore(release): 4.1.0-alpha.4 [skip ci]
semantic-release-bot Apr 28, 2023
abbf130
refactor: Bump @babel/core from 7.21.4 to 7.21.5 (#1877)
dependabot[bot] May 1, 2023
cff639b
Merge branch 'beta' into build-release
mtrezza May 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"jsdoc/require-param-description": 0,
"jsdoc/require-property-description": 0,
"jsdoc/require-param-type": 0,
"jsdoc/tag-lines": 0,
"jsdoc/check-param-names": [
"error",
{
Expand Down
73 changes: 0 additions & 73 deletions .github/workflows/release-automated-scheduler.yml

This file was deleted.

35 changes: 35 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# [4.1.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/4.1.0-alpha.3...4.1.0-alpha.4) (2023-04-28)


### Features

* Add `Parse.User.loginAs` ([#1875](https://github.com/parse-community/Parse-SDK-JS/issues/1875)) ([381fcfc](https://github.com/parse-community/Parse-SDK-JS/commit/381fcfc7f9cfda70af7c6dc3a35de59b82b72258))

# [4.1.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/4.1.0-alpha.2...4.1.0-alpha.3) (2023-04-02)


### Features

* Add `ParseQuery.watch` to trigger LiveQuery only on update of specific fields ([#1839](https://github.com/parse-community/Parse-SDK-JS/issues/1839)) ([7479343](https://github.com/parse-community/Parse-SDK-JS/commit/7479343abd8739fe03558ff9b2ce610c34c568ae))

# [4.1.0-alpha.2](https://github.com/parse-community/Parse-SDK-JS/compare/4.1.0-alpha.1...4.1.0-alpha.2) (2023-03-01)


### Bug Fixes

* `Parse.File.cancel` starts new attempt to save file ([#1781](https://github.com/parse-community/Parse-SDK-JS/issues/1781)) ([b755e42](https://github.com/parse-community/Parse-SDK-JS/commit/b755e42394db8b94b87b0dbefc6cf6f18189c46d))

# [4.1.0-alpha.1](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.1...4.1.0-alpha.1) (2023-03-01)


### Bug Fixes

* `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))
* 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))
* 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))

### Features

* `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))
* 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))

# [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)


Expand Down
29 changes: 17 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const FULL_HEADER = (
' */\n'
);

gulp.task('compile', function() {
return gulp.src('src/*.js')
function compileTask(stream) {
return stream
.pipe(babel({
presets: PRESETS[BUILD],
plugins: PLUGINS[BUILD],
Expand All @@ -76,6 +76,10 @@ gulp.task('compile', function() {
plugins: ['minify-dead-code-elimination'],
}))
.pipe(gulp.dest(path.join('lib', BUILD)));
}

gulp.task('compile', function() {
return compileTask(gulp.src('src/*.js'));
});

gulp.task('browserify', function(cb) {
Expand Down Expand Up @@ -132,14 +136,15 @@ gulp.task('minify-weapp', function() {
});

gulp.task('watch', function() {
return watch('src/*.js', { ignoreInitial: false, verbose: true })
.pipe(babel({
presets: PRESETS[BUILD],
plugins: PLUGINS[BUILD],
}))
// Second pass to kill BUILD-switched code
.pipe(babel({
plugins: ['minify-dead-code-elimination'],
}))
.pipe(gulp.dest(path.join('lib', BUILD)));
if (BUILD === 'browser') {
const watcher = gulp.watch('src/*.js', { ignoreInitial: false }, gulp.series('compile', 'browserify', 'minify'));
watcher.on('add', function(path) {
console.log(`File ${path} was added`);
});
watcher.on('change', function(path) {
console.log(`File ${path} was changed`);
});
return watcher;
}
return compileTask(watch('src/*.js', { ignoreInitial: false, verbose: true }));
});
46 changes: 44 additions & 2 deletions integration/test/ParseDistTest.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const puppeteer = require('puppeteer');
const { resolvingPromise } = require('../../lib/node/promiseUtils');

let browser = null;
let page = null;
for (const fileName of ['parse.js', 'parse.min.js']) {
describe(`Parse Dist Test ${fileName}`, () => {
beforeEach(async () => {
browser = await puppeteer.launch();
page = await browser.newPage();
browser = await puppeteer.launch({ args: ['--disable-web-security'] });
const context = await browser.createIncognitoBrowserContext();
page = await context.newPage();
await page.setCacheEnabled(false);
await page.goto(`http://localhost:1337/${fileName}`);
});

Expand Down Expand Up @@ -35,5 +39,43 @@ for (const fileName of ['parse.js', 'parse.min.js']) {
expect(obj).toBeDefined();
expect(obj.id).toEqual(response);
});

it('can cancel save file with uri', async () => {
let requestsCount = 0;
let abortedCount = 0;
const promise = resolvingPromise();
await page.setRequestInterception(true);
page.on('request', request => {
if (!request.url().includes('favicon.ico')) {
requestsCount += 1;
}
request.continue();
});
page.on('requestfailed', request => {
if (request.failure().errorText === 'net::ERR_ABORTED' && !request.url().includes('favicon.ico')) {
abortedCount += 1;
promise.resolve();
}
});
await page.evaluate(async () => {
const parseLogo =
'https://raw.githubusercontent.com/parse-community/parse-server/master/.github/parse-server-logo.png';
const file = new Parse.File('parse-server-logo', { uri: parseLogo });
file.save().then(() => {});

return new Promise((resolve) => {
const intervalId = setInterval(() => {
if (file._requestTask && typeof file._requestTask.abort === 'function') {
file.cancel();
clearInterval(intervalId);
resolve();
}
}, 1);
});
});
await promise;
expect(requestsCount).toBe(1);
expect(abortedCount).toBe(1);
});
});
}
42 changes: 40 additions & 2 deletions integration/test/ParseLiveQueryTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Parse LiveQuery', () => {
query.equalTo('objectId', object.id);
const subscription = await client.subscribe(query);
const promise = resolvingPromise();
subscription.on('update', async (object) => {
subscription.on('update', async object => {
assert.equal(object.get('foo'), 'bar');
await client.close();
promise.resolve();
Expand Down Expand Up @@ -206,7 +206,7 @@ describe('Parse LiveQuery', () => {
subscription.on('update', async object => {
assert.equal(object.get('foo'), 'bar');
await Parse.User.logOut();
promise.resolve()
promise.resolve();
});
await object.save({ foo: 'bar' });
await promise;
Expand Down Expand Up @@ -276,6 +276,44 @@ describe('Parse LiveQuery', () => {
await promise;
});

it('can subscribe to query with watch', async () => {
const query = new Parse.Query(TestObject);
query.watch('yolo');
const subscription = await query.subscribe();
const spy = {
create(obj) {
if (!obj.get('yolo')) {
fail('create should not have been called');
}
},
update(object, original) {
if (object.get('yolo') === original.get('yolo')) {
fail('create should not have been called');
}
},
};
const createSpy = spyOn(spy, 'create').and.callThrough();
const updateSpy = spyOn(spy, 'update').and.callThrough();
subscription.on('create', spy.create);
subscription.on('update', spy.update);
const obj = new TestObject();
obj.set('foo', 'bar');
await obj.save();
obj.set('foo', 'xyz');
obj.set('yolo', 'xyz');
await obj.save();
const obj2 = new TestObject();
obj2.set('foo', 'bar');
obj2.set('yolo', 'bar');
await obj2.save();
obj2.set('foo', 'bart');
await obj2.save();
await sleep(1000);
await subscription.unsubscribe();
expect(createSpy).toHaveBeenCalledTimes(1);
expect(updateSpy).toHaveBeenCalledTimes(1);
});

it('live query can handle beforeConnect and beforeSubscribe errors', async () => {
await reconfigureServer({
cloud({ Cloud }) {
Expand Down
31 changes: 31 additions & 0 deletions integration/test/ParseUserTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,27 @@ describe('Parse User', () => {
expect(sessions[1].get('sessionToken')).toBe(installationUser.getSessionToken());
});

it('can login with userId', async () => {
Parse.User.enableUnsafeCurrentUser();

const user = await Parse.User.signUp('parsetest', 'parse', { code: 'red' });
assert.equal(Parse.User.current(), user);
await Parse.User.logOut();
assert(!Parse.User.current());

const newUser = await Parse.User.loginAs(user.id);
assert.equal(Parse.User.current(), newUser);
assert(newUser);
assert.equal(user.id, newUser.id);
assert.equal(user.get('code'), 'red');

await Parse.User.logOut();
assert(!Parse.User.current());
await expectAsync(Parse.User.loginAs('garbage')).toBeRejectedWithError(
'user not found'
);
});

it('can become a user', done => {
Parse.User.enableUnsafeCurrentUser();
let session = null;
Expand Down Expand Up @@ -782,6 +803,16 @@ describe('Parse User', () => {
expect(user.doSomething()).toBe(5);
});

it('can loginAs user with subclass static', async () => {
Parse.User.enableUnsafeCurrentUser();

let user = await CustomUser.signUp('username', 'password');

user = await CustomUser.loginAs(user.id);
expect(user instanceof CustomUser).toBe(true);
expect(user.doSomething()).toBe(5);
});

it('can get user (me) with subclass static', async () => {
Parse.User.enableUnsafeCurrentUser();

Expand Down
Loading