From f04594229772c85ce3a509fee9754ead4a07d272 Mon Sep 17 00:00:00 2001 From: Guillaume Jenkins Date: Fri, 28 Oct 2016 14:12:25 -0700 Subject: [PATCH] Project templates (#295) Moved default projects from pxtarget.json to libs/templates/ --- libs/templates/blocksprj/README.md | 0 libs/templates/blocksprj/main.blocks | 62 ++++++++++++++++++++++++++ libs/templates/blocksprj/main.ts | 16 +++++++ libs/templates/blocksprj/pxt.json | 13 ++++++ libs/templates/blocksprj/tsconfig.json | 8 ++++ libs/templates/tsprj/README.md | 0 libs/templates/tsprj/main.ts | 7 +++ libs/templates/tsprj/pxt.json | 12 +++++ libs/templates/tsprj/tsconfig.json | 8 ++++ pxtarget.json | 40 ----------------- 10 files changed, 126 insertions(+), 40 deletions(-) create mode 100644 libs/templates/blocksprj/README.md create mode 100644 libs/templates/blocksprj/main.blocks create mode 100644 libs/templates/blocksprj/main.ts create mode 100644 libs/templates/blocksprj/pxt.json create mode 100644 libs/templates/blocksprj/tsconfig.json create mode 100644 libs/templates/tsprj/README.md create mode 100644 libs/templates/tsprj/main.ts create mode 100644 libs/templates/tsprj/pxt.json create mode 100644 libs/templates/tsprj/tsconfig.json diff --git a/libs/templates/blocksprj/README.md b/libs/templates/blocksprj/README.md new file mode 100644 index 00000000..e69de29b diff --git a/libs/templates/blocksprj/main.blocks b/libs/templates/blocksprj/main.blocks new file mode 100644 index 00000000..d809e7e4 --- /dev/null +++ b/libs/templates/blocksprj/main.blocks @@ -0,0 +1,62 @@ + + + + +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +TRUE +FALSE +TRUE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +TRUE +FALSE +FALSE +FALSE +TRUE +FALSE +TRUE +TRUE +TRUE +FALSE + + +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE +FALSE + + + + + + \ No newline at end of file diff --git a/libs/templates/blocksprj/main.ts b/libs/templates/blocksprj/main.ts new file mode 100644 index 00000000..4dfdb3a1 --- /dev/null +++ b/libs/templates/blocksprj/main.ts @@ -0,0 +1,16 @@ +basic.forever(() => { + basic.showLeds(` + . # . # . + # . # . # + # . . . # + . # . # . + . . # . . + `) + basic.showLeds(` + . . . . . + . . . . . + . . . . . + . . . . . + . . . . . + `) +}) \ No newline at end of file diff --git a/libs/templates/blocksprj/pxt.json b/libs/templates/blocksprj/pxt.json new file mode 100644 index 00000000..e7c395e6 --- /dev/null +++ b/libs/templates/blocksprj/pxt.json @@ -0,0 +1,13 @@ +{ + "name": "{0} block", + "dependencies": { + "core": "*", + "radio": "*" + }, + "description": "", + "files": [ + "main.blocks", + "main.ts", + "README.md" + ] +} diff --git a/libs/templates/blocksprj/tsconfig.json b/libs/templates/blocksprj/tsconfig.json new file mode 100644 index 00000000..1ba59f2c --- /dev/null +++ b/libs/templates/blocksprj/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es5", + "noImplicitAny": true, + "outDir": "built", + "rootDir": "." + } +} diff --git a/libs/templates/tsprj/README.md b/libs/templates/tsprj/README.md new file mode 100644 index 00000000..e69de29b diff --git a/libs/templates/tsprj/main.ts b/libs/templates/tsprj/main.ts new file mode 100644 index 00000000..f5d34304 --- /dev/null +++ b/libs/templates/tsprj/main.ts @@ -0,0 +1,7 @@ +basic.showLeds(` + . . . . . + . # . # . + . . . . . + # . . . # + . # # # . + `); \ No newline at end of file diff --git a/libs/templates/tsprj/pxt.json b/libs/templates/tsprj/pxt.json new file mode 100644 index 00000000..dbd3d5ea --- /dev/null +++ b/libs/templates/tsprj/pxt.json @@ -0,0 +1,12 @@ +{ + "name": "{0} bit", + "dependencies": { + "core": "*", + "radio": "*" + }, + "description": "", + "files": [ + "main.ts", + "README.md" + ] +} diff --git a/libs/templates/tsprj/tsconfig.json b/libs/templates/tsprj/tsconfig.json new file mode 100644 index 00000000..1ba59f2c --- /dev/null +++ b/libs/templates/tsprj/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es5", + "noImplicitAny": true, + "outDir": "built", + "rootDir": "." + } +} diff --git a/pxtarget.json b/pxtarget.json index 4d53f410..4b5f3e7a 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -21,46 +21,6 @@ ], "githubPackages": false }, - "blocksprj": { - "id": "blocksprj", - "config": { - "name": "{0} block", - "dependencies": { - "core": "*", - "radio": "*" - }, - "description": "", - "files": [ - "main.blocks", - "main.ts", - "README.md" - ] - }, - "files": { - "main.blocks": "\n\n\n\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nTRUE\nTRUE\nTRUE\nFALSE\n\n\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n\n\n\n\n\n", - "main.ts": "basic.forever(() => {\r\n basic.showLeds(`\r\n . # . # .\r\n # . # . #\r\n # . . . #\r\n . # . # .\r\n . . # . .\r\n `)\r\n basic.showLeds(`\r\n . . . . .\r\n . . . . .\r\n . . . . .\r\n . . . . .\r\n . . . . .\r\n `)\r\n})\r\n", - "README.md": "" - } - }, - "tsprj": { - "id": "tsprj", - "config": { - "name": "{0} bit", - "dependencies": { - "core": "*", - "radio": "*" - }, - "description": "", - "files": [ - "main.ts", - "README.md" - ] - }, - "files": { - "main.ts": "basic.showLeds(`\r\n . . . . .\r\n . # . # .\r\n . . . . .\r\n # . . . #\r\n . # # # .\r\n `);", - "README.md": "" - } - }, "compile": { "isNative": false, "hasHex": true,