Skip to content

Instantly share code, notes, and snippets.

@lorenzofox3
Last active January 24, 2020 11:36
Show Gist options
  • Save lorenzofox3/a8fe20b726038f4cb4519c8c224a8163 to your computer and use it in GitHub Desktop.
Save lorenzofox3/a8fe20b726038f4cb4519c8c224a8163 to your computer and use it in GitHub Desktop.

Revisions

  1. lorenzofox3 revised this gist Oct 8, 2019. 1 changed file with 0 additions and 10 deletions.
    10 changes: 0 additions & 10 deletions rollup.js
    Original file line number Diff line number Diff line change
    @@ -1,10 +0,0 @@
    export default {
    input: './spec.js',
    output: {
    file: './debug.js',
    format: 'iife',
    sourcemap: true,
    name: 'Test'
    },
    plugins:[]
    };
  2. lorenzofox3 revised this gist Oct 8, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,6 @@
    "license": "ISC",
    "devDependencies": {
    "esm": "^3.2.25",
    "rollup": "^1.23.1",
    "typescript": "^3.6.3",
    "zora": "^3.0.3"
    }
  3. lorenzofox3 revised this gist Oct 8, 2019. 2 changed files with 0 additions and 57 deletions.
    2 changes: 0 additions & 2 deletions .gitignore
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    .idea
    node_modules
    55 changes: 0 additions & 55 deletions package-lock.json
    Original file line number Diff line number Diff line change
    @@ -1,55 +0,0 @@
    {
    "name": "typescript-setup",
    "version": "1.0.0",
    "lockfileVersion": 1,
    "requires": true,
    "dependencies": {
    "@types/estree": {
    "version": "0.0.39",
    "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
    "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
    "dev": true
    },
    "@types/node": {
    "version": "12.7.11",
    "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.11.tgz",
    "integrity": "sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw==",
    "dev": true
    },
    "acorn": {
    "version": "7.1.0",
    "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
    "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
    "dev": true
    },
    "esm": {
    "version": "3.2.25",
    "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
    "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
    "dev": true
    },
    "rollup": {
    "version": "1.23.1",
    "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.23.1.tgz",
    "integrity": "sha512-95C1GZQpr/NIA0kMUQmSjuMDQ45oZfPgDBcN0yZwBG7Kee//m7H68vgIyg+SPuyrTZ5PrXfyLK80OzXeKG5dAA==",
    "dev": true,
    "requires": {
    "@types/estree": "*",
    "@types/node": "*",
    "acorn": "^7.1.0"
    }
    },
    "typescript": {
    "version": "3.6.3",
    "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
    "integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==",
    "dev": true
    },
    "zora": {
    "version": "3.0.3",
    "resolved": "https://registry.npmjs.org/zora/-/zora-3.0.3.tgz",
    "integrity": "sha512-eQe9oYOTi7Q3+Wp6FwzdBXPZYTS+7vIpgdhStFT/9TBLtufjR9dzMPxF++87brkEyACzTYjOfTUB6JRLCfhGMg==",
    "dev": true
    }
    }
    }
  4. lorenzofox3 created this gist Oct 8, 2019.
    2 changes: 2 additions & 0 deletions .gitignore
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    .idea
    node_modules
    55 changes: 55 additions & 0 deletions package-lock.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    {
    "name": "typescript-setup",
    "version": "1.0.0",
    "lockfileVersion": 1,
    "requires": true,
    "dependencies": {
    "@types/estree": {
    "version": "0.0.39",
    "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
    "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
    "dev": true
    },
    "@types/node": {
    "version": "12.7.11",
    "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.11.tgz",
    "integrity": "sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw==",
    "dev": true
    },
    "acorn": {
    "version": "7.1.0",
    "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
    "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
    "dev": true
    },
    "esm": {
    "version": "3.2.25",
    "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
    "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
    "dev": true
    },
    "rollup": {
    "version": "1.23.1",
    "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.23.1.tgz",
    "integrity": "sha512-95C1GZQpr/NIA0kMUQmSjuMDQ45oZfPgDBcN0yZwBG7Kee//m7H68vgIyg+SPuyrTZ5PrXfyLK80OzXeKG5dAA==",
    "dev": true,
    "requires": {
    "@types/estree": "*",
    "@types/node": "*",
    "acorn": "^7.1.0"
    }
    },
    "typescript": {
    "version": "3.6.3",
    "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
    "integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==",
    "dev": true
    },
    "zora": {
    "version": "3.0.3",
    "resolved": "https://registry.npmjs.org/zora/-/zora-3.0.3.tgz",
    "integrity": "sha512-eQe9oYOTi7Q3+Wp6FwzdBXPZYTS+7vIpgdhStFT/9TBLtufjR9dzMPxF++87brkEyACzTYjOfTUB6JRLCfhGMg==",
    "dev": true
    }
    }
    }
    19 changes: 19 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    {
    "name": "typescript-setup",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
    "compile": "tsc",
    "test": "node -r esm ./spec.js",
    "dev": "npm run compile -- -w"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
    "esm": "^3.2.25",
    "rollup": "^1.23.1",
    "typescript": "^3.6.3",
    "zora": "^3.0.3"
    }
    }
    10 changes: 10 additions & 0 deletions rollup.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    export default {
    input: './spec.js',
    output: {
    file: './debug.js',
    format: 'iife',
    sourcemap: true,
    name: 'Test'
    },
    plugins:[]
    };
    10 changes: 10 additions & 0 deletions spec.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    import {test} from 'zora';
    import square from './square';

    test(`some test passing test`, t => {
    t.eq(square(2), 4, `2 * 2 = 4`);
    });

    test(`some failing test`, t => {
    t.eq(square(3), 8, `3 * 3 = 9`);
    });
    1 change: 1 addition & 0 deletions square.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    export default (x: number): number => x ** 2;
    16 changes: 16 additions & 0 deletions tsconfig.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    {
    "compilerOptions": {
    "lib": [
    "esnext",
    "dom"
    ],
    "module": "esnext",
    "moduleResolution": "node",
    "target": "esnext",
    "sourceMap": true,
    "esModuleInterop": true
    },
    "exclude": [
    "./node_modules"
    ]
    }