@osdk/create-app 0.17.0-beta.1 → 0.17.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/browser/index.js +1 -1
- package/build/cjs/index.cjs +1 -1
- package/build/esm/index.js +1 -1
- package/package.json +1 -1
- package/templates/template-tutorial-todo-aip-app/src/Home.tsx +6 -4
- package/templates/template-tutorial-todo-aip-app/src/TaskList.tsx +1 -1
- package/templates/template-tutorial-todo-aip-app/src/TaskListItem.tsx +3 -4
package/CHANGELOG.md
CHANGED
package/build/browser/index.js
CHANGED
|
@@ -457,7 +457,7 @@ async function run({
|
|
|
457
457
|
|
|
458
458
|
// src/cli.ts
|
|
459
459
|
async function cli(args = process.argv) {
|
|
460
|
-
const base = yargs(hideBin(args)).version("0.17.0-beta.
|
|
460
|
+
const base = yargs(hideBin(args)).version("0.17.0-beta.2").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK application based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
|
|
461
461
|
type: "string",
|
|
462
462
|
describe: "Project name to create"
|
|
463
463
|
}).option("overwrite", {
|
package/build/cjs/index.cjs
CHANGED
|
@@ -467,7 +467,7 @@ async function run({
|
|
|
467
467
|
|
|
468
468
|
// src/cli.ts
|
|
469
469
|
async function cli(args = process.argv) {
|
|
470
|
-
const base = yargs__default.default(helpers.hideBin(args)).version("0.17.0-beta.
|
|
470
|
+
const base = yargs__default.default(helpers.hideBin(args)).version("0.17.0-beta.2").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK application based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
|
|
471
471
|
type: "string",
|
|
472
472
|
describe: "Project name to create"
|
|
473
473
|
}).option("overwrite", {
|
package/build/esm/index.js
CHANGED
|
@@ -457,7 +457,7 @@ async function run({
|
|
|
457
457
|
|
|
458
458
|
// src/cli.ts
|
|
459
459
|
async function cli(args = process.argv) {
|
|
460
|
-
const base = yargs(hideBin(args)).version("0.17.0-beta.
|
|
460
|
+
const base = yargs(hideBin(args)).version("0.17.0-beta.2").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK application based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
|
|
461
461
|
type: "string",
|
|
462
462
|
describe: "Project name to create"
|
|
463
463
|
}).option("overwrite", {
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import type { MockProject } from "./mocks";
|
|
|
9
9
|
import ProjectSelect from "./ProjectSelect";
|
|
10
10
|
import TaskList from "./TaskList";
|
|
11
11
|
import useProjects from "./useProjects";
|
|
12
|
+
import { useProjectTasks } from "./useProjectTasks";
|
|
12
13
|
|
|
13
14
|
function Home() {
|
|
14
15
|
const [projectId, setProjectId] = useState<string | undefined>(undefined);
|
|
@@ -18,6 +19,7 @@ function Home() {
|
|
|
18
19
|
|
|
19
20
|
const textAreaRef = useRef<HTMLTextAreaElement>(null);
|
|
20
21
|
const project = projects?.find((p) => p.id === projectId);
|
|
22
|
+
const tasks = useProjectTasks(project).tasks;
|
|
21
23
|
|
|
22
24
|
const handleSelectProject = useCallback(
|
|
23
25
|
(p: MockProject) => setProjectId(p.id),
|
|
@@ -36,9 +38,9 @@ function Home() {
|
|
|
36
38
|
useEffect(() => {
|
|
37
39
|
if (project == null && projects != null && projects.length > 0) {
|
|
38
40
|
setProjectId(projects[0].id);
|
|
39
|
-
setProjectHasTasks(
|
|
41
|
+
setProjectHasTasks(tasks == null ? false : tasks.length > 0);
|
|
40
42
|
}
|
|
41
|
-
}, [project, projects]);
|
|
43
|
+
}, [project, projects, tasks]);
|
|
42
44
|
|
|
43
45
|
useEffect(() => {
|
|
44
46
|
if (textAreaRef.current) {
|
|
@@ -61,10 +63,10 @@ function Home() {
|
|
|
61
63
|
);
|
|
62
64
|
|
|
63
65
|
const handleOnTaskDeleted = useCallback(() => {
|
|
64
|
-
if (
|
|
66
|
+
if (tasks?.length === 0) {
|
|
65
67
|
setProjectHasTasks(false);
|
|
66
68
|
}
|
|
67
|
-
}, [
|
|
69
|
+
}, [tasks]);
|
|
68
70
|
|
|
69
71
|
return (
|
|
70
72
|
<Layout>
|
|
@@ -5,7 +5,7 @@ import { useProjectTasks } from "./useProjectTasks";
|
|
|
5
5
|
|
|
6
6
|
interface TaskListProps {
|
|
7
7
|
project: MockProject;
|
|
8
|
-
onTaskDeleted: (taskId: string) => void;
|
|
8
|
+
onTaskDeleted: (taskId: string | undefined) => void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function TaskList({ project, onTaskDeleted }: TaskListProps) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
2
|
import type { MockTask } from "./mocks";
|
|
3
3
|
import css from "./TaskListItem.module.css";
|
|
4
|
+
|
|
4
5
|
interface TaskListItemProps {
|
|
5
6
|
task: MockTask;
|
|
6
7
|
deleteTask: (task: MockTask) => Promise<void>;
|
|
7
|
-
onTaskDeleted: (taskId: string) => void;
|
|
8
|
+
onTaskDeleted: (taskId: string | undefined) => void;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
function TaskListItem({ task, deleteTask, onTaskDeleted }: TaskListItemProps) {
|
|
@@ -28,9 +29,7 @@ function TaskListItem({ task, deleteTask, onTaskDeleted }: TaskListItemProps) {
|
|
|
28
29
|
textArea.style.height = `${textArea.scrollHeight}px`;
|
|
29
30
|
}
|
|
30
31
|
}, [task.description]);
|
|
31
|
-
const cleanDescription = task.description
|
|
32
|
-
? null
|
|
33
|
-
: task.description.trim();
|
|
32
|
+
const cleanDescription = task.description?.trim();
|
|
34
33
|
return (
|
|
35
34
|
<li className={css.li}>
|
|
36
35
|
<input
|