Skip to content

DavidGriswoldTeacher/p5ts-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Required setup steps BEFORE using the project

  1. Install yarn using the MSI OR chocolatey/homebrew, e.g cinst yarn
  2. yarn global add typescript (optional, can also install locally below)

Steps to create this folder

  1. Made directory p5ts
  2. cd p5ts
  3. yarn add @types/p5 --dev // if you want to do local typescript, add that here
  4. mkdir dist
  5. touch dist/index.html
  6. mkdir src
  7. touch src/index.ts
  8. tsc --init
  9. Open tsconfig.json in editor and change module to es6, flag on allowJs and set outDir to ./dist
  10. git init
  11. touch .gitignore
  12. open .gitignore and add node_modules
  13. touch src/global.d.ts
  14. Open global.d.ts and include text:
    import module = require('p5');
    import * as p5Global from 'p5/global' 
    
    export = module;
    export as namespace p5;
    declare global {
        interface Window {
            p5: typeof module,
        }
    }
    (code retreived from https://github.com/Gaweph/p5-typescript-starter/blob/master/global.d.ts)

About

A starter project for using p5js with typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published