Skip to content
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

Latest Simpletasks in 2.x.x version (Codemod) #15

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 20 additions & 20 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

[email protected].2 # Packages every Meteor app needs to have
[email protected].2 # Packages for a great mobile UX
mongo@2.0.2 # The database Meteor supports right now
[email protected].13 # Reactive variable for tracker
[email protected].1 # Packages every Meteor app needs to have
[email protected].1 # Packages for a great mobile UX
mongo@1.16.10 # The database Meteor supports right now
[email protected].11 # Reactive variable for tracker

[email protected].3 # CSS minifier run for production mode
[email protected].1 # ECMAScript 5 compatibility for older browsers
[email protected].9 # Enable ECMAScript2015+ syntax in app code
typescript@5.4.3 # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.6.0 # Server-side component of the `meteor shell` command
[email protected].4 # Update client in development without reloading the page
[email protected].2 # CSS minifier run for production mode
[email protected].0 # ECMAScript 5 compatibility for older browsers
[email protected].8 # Enable ECMAScript2015+ syntax in app code
typescript@4.9.5 # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.5.0 # Server-side component of the `meteor shell` command
[email protected].3 # Update client in development without reloading the page

[email protected].3 # Define static page content in .html files
[email protected].3
[email protected].2 # Define static page content in .html files
[email protected].2

accounts-password@3.0.2
[email protected].1
meteortesting:mocha@3.2.0
accounts-password@2.4.0
[email protected].0
meteortesting:mocha
jam:[email protected]
quave:migrations
[email protected].3
react-meteor-data@3.0.0
[email protected].0
react-meteor-data@2.7.2
montiapm:agent
zodern:standard-minifier-js
[email protected].1
[email protected].5
[email protected].2
[email protected].0
[email protected].4
[email protected].1
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@3.0.3
METEOR@2.16
183 changes: 91 additions & 92 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,100 +1,99 @@
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
jam:[email protected]
[email protected].1
[email protected].1
[email protected].5
[email protected].0
[email protected].0
[email protected].4
mdg:[email protected]
meteor@2.0.1
[email protected].2
meteortesting:browser-tests@1.7.0
meteortesting:mocha@3.2.0
meteor@1.11.5
[email protected].1
meteortesting:browser-tests@1.6.0
meteortesting:mocha@3.1.0-beta300.0
meteortesting:[email protected]
minifier-css@2.0.0
minimongo@2.0.1
[email protected].2
[email protected].1
[email protected].11
[email protected].1
[email protected].2
[email protected].3
mongo@2.0.2
[email protected].4-beta300.7
[email protected].1
[email protected].9
montiapm:agent@3.0.0-beta.5
montiapm:meteorx@2.3.1
[email protected].4
oauth@3.0.0
[email protected].3
ordered-dict@1.2.0
promise@1.0.0
minifier-css@1.6.4
minimongo@1.9.4
[email protected].1
[email protected].0
[email protected].10
[email protected].0
[email protected].1
[email protected].2
mongo@1.16.10
[email protected].3
[email protected].0
[email protected].8
montiapm:agent@2.49.4
montiapm:meteorx@2.2.0
[email protected].2
oauth@2.2.1
[email protected].2
ordered-dict@1.1.0
promise@0.12.2
quave:[email protected]
[email protected].2
[email protected].2
[email protected].9
[email protected].1
[email protected].1
[email protected].8
[email protected]
react-meteor-data@3.0.2
[email protected].13
[email protected].2
[email protected].1
[email protected].2
[email protected].5
[email protected].10
shell-server@0.6.0
[email protected].3
spacebars-compiler@2.0.0
[email protected].3
[email protected].3
templating-tools@2.0.0
[email protected].4
typescript@5.4.3
[email protected].4
[email protected].3
webapp@2.0.1
[email protected].2
react-meteor-data@2.7.2
[email protected].12
[email protected].1
[email protected].0
[email protected].1
[email protected].4
[email protected].9
shell-server@0.5.0
[email protected].2
spacebars-compiler@1.3.1
[email protected].2
[email protected].2
templating-tools@1.2.2
[email protected].3
typescript@4.9.5
[email protected].2
[email protected].2
webapp@1.13.8
[email protected].1
zodern:[email protected]
zodern:[email protected]
zodern:[email protected]
Expand Down
18 changes: 9 additions & 9 deletions api/db/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Tasks } from '../tasks/tasks';
Migrations.add({
version: 1,
name: 'Add a seed username and password.',
async up() {
await Accounts.createUserAsync({
up() {
Accounts.createUser({
username: 'fredmaia',
password: 'abc123',
});
Expand All @@ -16,21 +16,21 @@ Migrations.add({
Migrations.add({
version: 2,
name: 'Add a few sample tasks.',
async up() {
const user = await Accounts.findUserByUsername('fredmaia');
await Tasks.insertAsync({
description: 'Install Node@20',
up() {
const user = Accounts.findUserByUsername('fredmaia');
Tasks.insert({
description: 'Install Node@14',
done: false,
userId: user._id,
createdAt: new Date(2024, 1, 1),
});
await Tasks.insertAsync({
description: 'Install Meteor.js 3.0',
Tasks.insert({
description: 'Install Meteor.js 2.0',
done: false,
userId: user._id,
createdAt: new Date(2024, 1, 2),
});
await Tasks.insertAsync({
Tasks.insert({
description: 'Clone this repository',
done: false,
userId: user._id,
Expand Down
4 changes: 2 additions & 2 deletions api/lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export function checkLoggedIn() {
* @param {{ taskId: String }}
* @throws Will throw an error if user is not logged in or is not the task owner.
*/
export async function checkTaskOwner({ taskId }) {
export function checkTaskOwner({ taskId }) {
check(taskId, String);
checkLoggedIn();
const task = await Tasks.findOneAsync({
const task = Tasks.findOne({
_id: taskId,
userId: Meteor.userId(),
});
Expand Down
24 changes: 12 additions & 12 deletions api/tasks/tasks.methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Tasks } from './tasks';
@function insertTask
@param {Object} taskData - The task data.
@param {string} taskData.description - The description of the task.
@returns {Promise<string>} - The ID of the inserted task.
@returns {string} - The ID of the inserted task.
*/
async function insertTask({ description }) {
function insertTask({ description }) {
check(description, String);
checkLoggedIn();
const task = {
Expand All @@ -21,7 +21,7 @@ async function insertTask({ description }) {
userId: Meteor.userId(),
createdAt: new Date(),
};
return Tasks.insertAsync(task);
return Tasks.insert(task);
}

/**
Expand All @@ -30,12 +30,12 @@ async function insertTask({ description }) {
@function removeTask
@param {Object} taskData - The task data.
@param {string} taskData.taskId - The ID of the task to remove.
@returns {Promise<number>}
@returns {number}
*/
async function removeTask({ taskId }) {
function removeTask({ taskId }) {
check(taskId, String);
await checkTaskOwner({ taskId });
return Tasks.removeAsync(taskId);
checkTaskOwner({ taskId });
return Tasks.remove(taskId);
}

/**
Expand All @@ -44,13 +44,13 @@ async function removeTask({ taskId }) {
@function toggleTaskDone
@param {Object} taskData - The task data.
@param {string} taskData.taskId - The ID of the task to toggle.
@returns {Promise<number>}
@returns {number}
*/
async function toggleTaskDone({ taskId }) {
function toggleTaskDone({ taskId }) {
check(taskId, String);
await checkTaskOwner({ taskId });
const task = await Tasks.findOneAsync(taskId);
return Tasks.updateAsync({ _id: taskId }, { $set: { done: !task.done } });
checkTaskOwner({ taskId });
const task = Tasks.findOne(taskId);
return Tasks.update({ _id: taskId }, { $set: { done: !task.done } });
}

Meteor.methods({ insertTask, removeTask, toggleTaskDone });
Loading