From 6f08e5c4de5e438eb7afae01ba27c4526034e476 Mon Sep 17 00:00:00 2001 From: Joseph Muller Date: Mon, 29 Jan 2024 10:55:24 +0000 Subject: [PATCH] Add package.json file in starter files for objects --- workshops/objects/index-easier.md | 0 workshops/objects/index.md | 15 +++++++++++---- workshops/objects/starter-files/package.json | 3 +++ workshops/objects/starter-files/shapes.js | 19 +++++++------------ 4 files changed, 21 insertions(+), 16 deletions(-) delete mode 100644 workshops/objects/index-easier.md create mode 100644 workshops/objects/starter-files/package.json diff --git a/workshops/objects/index-easier.md b/workshops/objects/index-easier.md deleted file mode 100644 index e69de29..0000000 diff --git a/workshops/objects/index.md b/workshops/objects/index.md index fae0160..3112149 100644 --- a/workshops/objects/index.md +++ b/workshops/objects/index.md @@ -2,10 +2,13 @@ ## Part 1: Practical -The practical part of today’s workshop is contained in two files, -“shapes.js” and “extraColors.js”. Download both files or copy-paste into -your own versions to get started. Then follow the instructions in -“shapes.js”. +The practical part of today’s workshop is mostly in one file, “shapes.js”. +Download it to get started. + +There are some optional steps at the end that also require two other files: +“extraColors.js” and “package.json”. Download both files or +copy-paste into your own versions to get started. Then follow the +instructions in “shapes.js”. [Download shapes.js](https://github.com/Birkbeck2/web-development/blob/main/workshops/objects/starter-files/shapes.js) @@ -15,6 +18,10 @@ your own versions to get started. Then follow the instructions in <<< @/workshops/objects/starter-files/extraColors.js{js} +[Download package.json](https://github.com/Birkbeck2/web-development/blob/main/workshops/objects/starter-files/package.json) + +<<< @/workshops/objects/starter-files/package.json{json} + ## Part 2: Creative Choose one of the three options below. diff --git a/workshops/objects/starter-files/package.json b/workshops/objects/starter-files/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/workshops/objects/starter-files/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/workshops/objects/starter-files/shapes.js b/workshops/objects/starter-files/shapes.js index 0e9a8fd..65906fb 100644 --- a/workshops/objects/starter-files/shapes.js +++ b/workshops/objects/starter-files/shapes.js @@ -54,21 +54,16 @@ // 11b. OPTIONAL // The next two steps involve exporting and importing with a pattern from ES // modules. We did not cover all the steps in class, so they are optional. -// Create a file called 'package.json' and paste in this code (without the -// forward slashes.) -// -// { -// "type": "module" -// } -// -// Here is a one minute video explanation: +// Make sure you've downloaded the file package.json and saved it in the same +// folder as this one. +// Here is a one minute video demo of "type":"module" in package.json: // https://www.youtube.com/watch?v=I4gR-1qMjk0 // 12. OPTIONAL -// Make sure you've downloaded the file extraColors.js and saved it in the same -// folder as this one. Modify the line where the pinkAndYellow object is -// defined, so that it is exported. Then import it below, in this file, and log -// it to the console. +// Make sure you've downloaded the file extraColors.js and saved +// it in the same folder as this one. Modify the line where the pinkAndYellow +// object is defined, so that it is exported. Then import it below, in this +// file, and log it to the console. // 13. OPTIONAL