",
15 | "license": "MIT",
16 | "repository": {
17 | "type": "git",
18 | "url": "git@github.com:Igmat/baset.git"
19 | },
20 | "bin": {
21 | "baset": "./bin/index.js"
22 | },
23 | "scripts": {
24 | "prepublish": "node ./scripts/prepublish.js"
25 | },
26 | "dependencies": {
27 | "baset-baseliner-json": "^0.14.8",
28 | "baset-cli": "^0.14.7"
29 | },
30 | "devDependencies": {
31 | "@types/node": "^10.10.0"
32 | },
33 | "yargs": {
34 | "dot-notation": false
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/packages/baset/scripts/prepublish.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const fs = require('fs');
3 |
4 | const rootReadme = path.resolve(__dirname, './../../../README.md');
5 | const currentReadme = path.resolve(__dirname, './../README.md');
6 | fs.writeFileSync(currentReadme, fs.readFileSync(rootReadme));
7 |
--------------------------------------------------------------------------------
/scripts/createBinSymlinks.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const path = require('path');
3 | const utils = require('util');
4 | const resolve = require('@lerna/resolve-symlink');
5 | const symlink = require('@lerna/create-symlink');
6 |
7 | const ls = utils.promisify(fs.readdir);
8 | const lstat = utils.promisify(fs.lstat);
9 | async function isExists(filename) {
10 | try {
11 | const stats = await lstat(filename);
12 | return stats.isSymbolicLink() || stats.isFile();
13 | } catch (err) {
14 | return false;
15 | }
16 | }
17 |
18 | const binFolder = './node_modules/.bin/';
19 | const packagesFolder = './packages';
20 |
21 | async function createBinSymlinks() {
22 | const binaries = (await ls(binFolder))
23 | .filter(binary => !/\.cmd$/.test(binary))
24 | .map(binary => ({
25 | name: binary,
26 | path: path.resolve(binFolder, binary)
27 | }));
28 | const packages = (await ls(packagesFolder))
29 | .map(package => path.resolve(packagesFolder, package))
30 | .filter(package => fs.statSync(package).isDirectory());
31 | return Promise.all(packages.map(package =>
32 | Promise.all(binaries.map(async (binary) => {
33 | const symlinkPath = path.resolve(package, binFolder, binary.name);
34 | if (await isExists(symlinkPath)) return;
35 | return symlink(resolve(binary.path), symlinkPath, 'exec');
36 | }))));
37 | }
38 |
39 | createBinSymlinks();
40 |
--------------------------------------------------------------------------------
/tests/accept.spec.ts:
--------------------------------------------------------------------------------
1 | import { sync as spawnSync } from 'cross-spawn';
2 | import fs from 'fs';
3 | import path from 'path';
4 |
5 | export = fs.readdirSync(__dirname)
6 | .filter(source => fs.lstatSync(path.join(__dirname, source)).isDirectory())
7 | .filter(project => project !== 'scaffolded-project')
8 | .map(project => {
9 | const cwd = path.resolve(__dirname, `./${project}`);
10 | const testProccess = spawnSync('npm', ['test'], { cwd, encoding: 'utf8' });
11 | const acceptProccess = spawnSync('npm', ['run', 'accept'], { cwd, encoding: 'utf8' });
12 |
13 | return {
14 | project,
15 | test: {
16 | stdout: testProccess.stdout.split('\n')
17 | // we don't need to check npm tasks output (like `> baset` or `> path/to/node.exe index.js`)
18 | .filter(line => !line.startsWith('>'))
19 | .filter(line => !line.startsWith('PixiJS'))
20 | .map(line => line
21 | .replace(/\(.*m?s\)/, '') // we don't need timing output from `tap-diff` here
22 | .replace(/(✔|√)/, ' ')), // `tap-diff` has different signs on win and *nix
23 | stderr: testProccess.stderr.split('\n')
24 | // we don't need to check npm warn about node version used in script
25 | .filter(line => !line.search('`--scripts-prepend-node-path`')),
26 | },
27 | accept: {
28 | stdout: acceptProccess.stdout.split('\n')
29 | // we don't need to check npm tasks output (like `> baset` or `> path/to/node.exe index.js`)
30 | .filter(line => !line.startsWith('>'))
31 | .filter(line => !line.startsWith('PixiJS'))
32 | .map(line => line
33 | .replace(/\(.*m?s\)/, '') // we don't need timing output from `tap-diff` here
34 | .replace(/(✔|√)/, ' ')), // `tap-diff` has different signs on win and *nix
35 | stderr: acceptProccess.stderr.split('\n')
36 | // we don't need to check npm warn about node version used in script
37 | .filter(line => !line.search('`--scripts-prepend-node-path`')),
38 | },
39 | };
40 | });
41 |
--------------------------------------------------------------------------------
/tests/babel-project/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015",
4 | "react"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/tests/babel-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.jsx",
3 | "bases": "**/*.spec.base.md",
4 | "plugins": {
5 | ".spec.jsx?$": {
6 | "readers": ["baset-reader-babel"],
7 | "resolvers": "baset-resolver-react",
8 | "baseliner": "baset-baseliner-md"
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/babel-project/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const jsxFn = (a, b) => ({a + b}
);
4 |
--------------------------------------------------------------------------------
/tests/babel-project/index.spec.base.md:
--------------------------------------------------------------------------------
1 | `exports.default.value1:`
2 |
3 | ```HTML
4 |
7 | 2
8 |
9 | ```
10 |
11 |
12 | `exports.default.value2:`
13 |
14 | ```HTML
15 |
18 | qq
19 |
20 | ```
21 |
22 |
23 | `exports.value:`
24 |
25 | ```HTML
26 |
27 |
30 | ss
31 |
32 |
35 | abccba
36 |
37 |
40 | sabc
41 |
42 |
45 | abcs
46 |
47 |
48 | ```
--------------------------------------------------------------------------------
/tests/babel-project/index.spec.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { jsxFn } from './index';
3 |
4 | export const value = (
5 |
6 | {jsxFn('s', 's')}
7 | {jsxFn('abc', 'cba')}
8 | {jsxFn('s', 'abc')}
9 | {jsxFn('abc', 's')}
10 |
11 | );
12 |
13 | export default {
14 | 'value1': jsxFn(1, 1),
15 | 'value2': jsxFn('q', 'q'),
16 | };
17 |
--------------------------------------------------------------------------------
/tests/babel-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "babel-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "dependencies": {
14 | "react": "^16.5.1",
15 | "react-dom": "^16.5.1"
16 | },
17 | "devDependencies": {
18 | "babel-cli": "^6.26.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-preset-react": "^6.24.1",
21 | "baset": "^0.14.8",
22 | "baset-baseliner-md": "^0.14.8",
23 | "baset-env-browser": "^0.14.7",
24 | "baset-reader-babel": "^0.14.7",
25 | "baset-resolver-react": "^0.14.7"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tests/canvas-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts",
3 | "bases": "**/*.spec.base.md",
4 | "plugins": {
5 | ".spec.ts$": {
6 | "environment": "baset-env-browser",
7 | "readers": "baset-reader-ts",
8 | "resolvers": "baset-resolver-pixi",
9 | "baseliner": "baset-baseliner-md"
10 | }
11 | },
12 | "options": {
13 | "baset-env-browser": {
14 | "serverPort": 3000
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/canvas-project/assets/abstract-baset.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Igmat/baset/a1ac7e9ca45a23846b01dd977f1951948f29d652/tests/canvas-project/assets/abstract-baset.jpg
--------------------------------------------------------------------------------
/tests/canvas-project/assets/assets.json:
--------------------------------------------------------------------------------
1 | {"frames": {
2 |
3 | "Light_green":
4 | {
5 | "frame": {"x":4,"y":132,"w":108,"h":108},
6 | "rotated": false,
7 | "trimmed": false,
8 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
9 | "sourceSize": {"w":108,"h":105}
10 | },
11 | "Light_orange":
12 | {
13 | "frame": {"x":4,"y":244,"w":108,"h":108},
14 | "rotated": false,
15 | "trimmed": false,
16 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
17 | "sourceSize": {"w":108,"h":105}
18 | },
19 | "Light_red":
20 | {
21 | "frame": {"x":4,"y":356,"w":108,"h":108},
22 | "rotated": false,
23 | "trimmed": false,
24 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
25 | "sourceSize": {"w":108,"h":105}
26 | },
27 | "Light_yellow":
28 | {
29 | "frame": {"x":116,"y":132,"w":108,"h":108},
30 | "rotated": false,
31 | "trimmed": false,
32 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
33 | "sourceSize": {"w":108,"h":105}
34 | },
35 | "Point_green":
36 | {
37 | "frame": {"x":4,"y":468,"w":20,"h":20},
38 | "rotated": false,
39 | "trimmed": false,
40 | "spriteSourceSize": {"x":0,"y":0,"w":20,"h":20},
41 | "sourceSize": {"w":20,"h":20}
42 | },
43 | "Point_orange":
44 | {
45 | "frame": {"x":28,"y":468,"w":20,"h":20},
46 | "rotated": false,
47 | "trimmed": false,
48 | "spriteSourceSize": {"x":0,"y":0,"w":20,"h":20},
49 | "sourceSize": {"w":20,"h":20}
50 | },
51 | "Point_red":
52 | {
53 | "frame": {"x":52,"y":468,"w":20,"h":20},
54 | "rotated": false,
55 | "trimmed": false,
56 | "spriteSourceSize": {"x":0,"y":0,"w":20,"h":20},
57 | "sourceSize": {"w":20,"h":20}
58 | },
59 | "Point_yellow":
60 | {
61 | "frame": {"x":76,"y":468,"w":20,"h":20},
62 | "rotated": false,
63 | "trimmed": false,
64 | "spriteSourceSize": {"x":0,"y":0,"w":20,"h":20},
65 | "sourceSize": {"w":20,"h":20}
66 | },
67 | "Radar_circle":
68 | {
69 | "frame": {"x":4,"y":4,"w":124,"h":124},
70 | "rotated": false,
71 | "trimmed": false,
72 | "spriteSourceSize": {"x":0,"y":0,"w":124,"h":124},
73 | "sourceSize": {"w":122,"h":122}
74 | },
75 | "Radar_monitor_green":
76 | {
77 | "frame": {"x":132,"y":4,"w":108,"h":108},
78 | "rotated": false,
79 | "trimmed": false,
80 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
81 | "sourceSize": {"w":108,"h":108}
82 | },
83 | "Radar_monitor_orange":
84 | {
85 | "frame": {"x":116,"y":244,"w":108,"h":108},
86 | "rotated": false,
87 | "trimmed": false,
88 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
89 | "sourceSize": {"w":108,"h":108}
90 | },
91 | "Radar_monitor_red":
92 | {
93 | "frame": {"x":116,"y":356,"w":108,"h":108},
94 | "rotated": false,
95 | "trimmed": false,
96 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
97 | "sourceSize": {"w":108,"h":108}
98 | },
99 | "Radar_monitor_red_glow":
100 | {
101 | "frame": {"x":244,"y":4,"w":108,"h":108},
102 | "rotated": false,
103 | "trimmed": false,
104 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
105 | "sourceSize": {"w":108,"h":108}
106 | },
107 | "Radar_monitor_yellow":
108 | {
109 | "frame": {"x":356,"y":4,"w":108,"h":108},
110 | "rotated": false,
111 | "trimmed": false,
112 | "spriteSourceSize": {"x":0,"y":0,"w":108,"h":108},
113 | "sourceSize": {"w":108,"h":108}
114 | }},
115 | "meta": {
116 | "app": "http://www.codeandweb.com/texturepacker",
117 | "version": "1.0",
118 | "image": "assets.png",
119 | "format": "RGBA8888",
120 | "size": {"w":512,"h":512},
121 | "scale": "1",
122 | "smartupdate": "$TexturePacker:SmartUpdate:a77bec91ef728b89ff42870105b598ed:e821754604ff56291107fc37d344d6df:54f404a1f943b3ebab0b1705c0120670$"
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/tests/canvas-project/assets/assets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Igmat/baset/a1ac7e9ca45a23846b01dd977f1951948f29d652/tests/canvas-project/assets/assets.png
--------------------------------------------------------------------------------
/tests/canvas-project/graphics.spec.ts:
--------------------------------------------------------------------------------
1 | export * from './graphics';
2 |
--------------------------------------------------------------------------------
/tests/canvas-project/graphics.ts:
--------------------------------------------------------------------------------
1 | import 'pixi.js';
2 | export const graphics = new PIXI.Graphics();
3 | // set a fill and line style
4 | graphics.beginFill(0xFF3300);
5 | graphics.lineStyle(4, 0xFFD900, 1);
6 |
7 | // draw a shape
8 | graphics.moveTo(50, 50);
9 | graphics.lineTo(250, 50);
10 | graphics.lineTo(100, 100);
11 | graphics.lineTo(50, 50);
12 | graphics.endFill();
13 |
14 | // set a fill and a line style again and draw a rectangle
15 | graphics.lineStyle(2, 0x0000FF, 1);
16 | graphics.beginFill(0xFF700B, 1);
17 | graphics.drawRect(50, 250, 120, 120);
18 |
19 | // draw a rounded rectangle
20 | graphics.lineStyle(2, 0xFF00FF, 1);
21 | graphics.beginFill(0xFF00BB, 0.25);
22 | graphics.drawRoundedRect(150, 450, 300, 100, 15);
23 | graphics.endFill();
24 |
25 | // draw a circle, set the lineStyle to zero so the circle doesn't have an outline
26 | graphics.lineStyle(0);
27 | graphics.beginFill(0xFFFF0B, 0.5);
28 | graphics.drawCircle(470, 90, 60);
29 | graphics.endFill();
30 |
--------------------------------------------------------------------------------
/tests/canvas-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "canvas-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/canvas-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "canvas-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "dependencies": {
14 | "pixi.js": "^4.8.4"
15 | },
16 | "devDependencies": {
17 | "@types/pixi.js": "^4.8.0",
18 | "baset": "^0.14.8",
19 | "baset-baseliner-md": "^0.14.8",
20 | "baset-env-browser": "^0.14.7",
21 | "baset-reader-ts": "^0.14.7",
22 | "baset-resolver-pixi": "^0.14.7",
23 | "typescript": "^3.0.3"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tests/canvas-project/sprite.spec.ts:
--------------------------------------------------------------------------------
1 | export * from './sprite';
2 |
--------------------------------------------------------------------------------
/tests/canvas-project/sprite.ts:
--------------------------------------------------------------------------------
1 | import 'pixi.js';
2 | interface IResourceDictionary {
3 | [index: string]: PIXI.loaders.Resource;
4 | }
5 |
6 | const ASSETS = './assets/assets.json';
7 | const RADAR_GREEN = 'Light_green';
8 |
9 | const getSprite = async () => {
10 | await new Promise(resolve => PIXI.loader
11 | .add(ASSETS)
12 | .load(resolve));
13 |
14 | return new PIXI.Sprite(PIXI.utils.TextureCache[RADAR_GREEN]);
15 | };
16 |
17 | export const sprite = getSprite();
18 |
--------------------------------------------------------------------------------
/tests/canvas-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "moduleResolution": "node",
15 | "baseUrl": ".",
16 | "paths": {
17 | "*": [
18 | "node_modules/*",
19 | "src/types/*",
20 | "lib/*"
21 | ]
22 | },
23 | "experimentalDecorators": true,
24 | "emitDecoratorMetadata": true
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/circular-reference-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts",
3 | "bases": "**/*.base",
4 | "plugins": {
5 | ".spec.js$": "baset-baseliner-json",
6 | ".spec.ts$": ["baset-reader-ts", "baset-baseliner-json"]
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tests/circular-reference-project/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 |
7 | ## [0.14.8](https://github.com/Igmat/baset/compare/v0.14.7...v0.14.8) (2018-10-10)
8 |
9 | **Note:** Version bump only for package circular-reference-project
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## [0.14.7](https://github.com/Igmat/baset/compare/v0.14.6...v0.14.7) (2018-10-10)
17 |
18 | **Note:** Version bump only for package circular-reference-project
19 |
20 |
21 |
22 |
23 |
24 |
25 | ## [0.14.6](https://github.com/Igmat/baset/compare/v0.14.5...v0.14.6) (2018-10-09)
26 |
27 | **Note:** Version bump only for package circular-reference-project
28 |
29 |
30 |
31 |
32 |
33 |
34 | ## [0.14.5](https://github.com/Igmat/baset/compare/v0.14.4...v0.14.5) (2018-10-09)
35 |
36 | **Note:** Version bump only for package circular-reference-project
37 |
38 |
39 |
40 |
41 |
42 |
43 | ## [0.14.4](https://github.com/Igmat/baset/compare/v0.14.3...v0.14.4) (2018-10-07)
44 |
45 | **Note:** Version bump only for package circular-reference-project
46 |
47 |
48 |
49 |
50 |
51 |
52 | ## [0.14.3](https://github.com/Igmat/baset/compare/v0.14.2...v0.14.3) (2018-10-07)
53 |
54 | **Note:** Version bump only for package circular-reference-project
55 |
56 |
57 |
58 |
59 |
60 |
61 | ## [0.14.2](https://github.com/Igmat/baset/compare/v0.14.1...v0.14.2) (2018-09-17)
62 |
63 | **Note:** Version bump only for package circular-reference-project
64 |
65 |
66 |
67 |
68 |
69 |
70 | ## [0.13.7](https://github.com/Igmat/baset/compare/v0.13.6...v0.13.7) (2018-08-30)
71 |
72 |
73 |
74 |
75 | **Note:** Version bump only for package circular-reference-project
76 |
77 |
78 | ## [0.13.6](https://github.com/Igmat/baset/compare/v0.13.5...v0.13.6) (2018-06-10)
79 |
80 |
81 |
82 |
83 | **Note:** Version bump only for package circular-reference-project
84 |
85 |
86 | ## [0.13.5](https://github.com/Igmat/baset/compare/v0.13.4...v0.13.5) (2018-06-08)
87 |
88 |
89 |
90 |
91 | **Note:** Version bump only for package circular-reference-project
92 |
93 |
94 | ## [0.13.4](https://github.com/Igmat/baset/compare/v0.13.3...v0.13.4) (2018-06-08)
95 |
96 |
97 |
98 |
99 | **Note:** Version bump only for package circular-reference-project
100 |
101 |
102 | ## [0.13.1](https://github.com/Igmat/baset/compare/v0.13.0...v0.13.1) (2018-06-02)
103 |
104 |
105 |
106 |
107 | **Note:** Version bump only for package circular-reference-project
108 |
109 |
110 | # [0.13.0](https://github.com/Igmat/baset/compare/v0.12.1...v0.13.0) (2018-05-31)
111 |
112 |
113 |
114 |
115 | **Note:** Version bump only for package circular-reference-project
116 |
117 |
118 | # [0.12.0](https://github.com/Igmat/baset/compare/v0.11.1...v0.12.0) (2018-05-03)
119 |
120 |
121 |
122 |
123 | **Note:** Version bump only for package circular-reference-project
124 |
125 |
126 | ## [0.11.1](https://github.com/Igmat/baset/compare/v0.11.0...v0.11.1) (2018-03-15)
127 |
128 |
129 |
130 |
131 | **Note:** Version bump only for package circular-reference-project
132 |
133 |
134 | # [0.11.0](https://github.com/Igmat/baset/compare/v0.10.0...v0.11.0) (2018-03-08)
135 |
136 |
137 |
138 |
139 | **Note:** Version bump only for package circular-reference-project
140 |
141 |
142 | # [0.10.0](https://github.com/Igmat/baset/compare/v0.9.1...v0.10.0) (2018-03-07)
143 |
144 |
145 |
146 |
147 | **Note:** Version bump only for package circular-reference-project
148 |
149 |
150 | # [0.9.0](https://github.com/Igmat/baset/compare/v0.8.0...v0.9.0) (2018-03-03)
151 |
152 |
153 |
154 |
155 | **Note:** Version bump only for package circular-reference-project
156 |
157 |
158 | # [0.8.0](https://github.com/Igmat/baset/compare/v0.7.5...v0.8.0) (2018-02-28)
159 |
160 |
161 |
162 |
163 | **Note:** Version bump only for package circular-reference-project
164 |
165 |
166 | ## [0.7.4](https://github.com/Igmat/baset/compare/v0.7.3...v0.7.4) (2018-02-26)
167 |
168 |
169 |
170 |
171 | **Note:** Version bump only for package circular-reference-project
172 |
--------------------------------------------------------------------------------
/tests/circular-reference-project/index.spec.base:
--------------------------------------------------------------------------------
1 | {
2 | "sampleObj": {
3 | "a": {
4 | "deepCircularReference": exports.sampleObj
5 | },
6 | "circularReference": exports.sampleObj,
7 | "b": {
8 | "a": exports.sampleObj.a
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/tests/circular-reference-project/index.spec.ts:
--------------------------------------------------------------------------------
1 | export { sampleObj } from './index';
2 |
--------------------------------------------------------------------------------
/tests/circular-reference-project/index.ts:
--------------------------------------------------------------------------------
1 | const sampleObj: { [index: string]: any } = {
2 | a: {},
3 | };
4 | sampleObj.circularReference = sampleObj;
5 | sampleObj.a.deepCircularReference = sampleObj;
6 | sampleObj.b = {
7 | a: sampleObj.a,
8 | };
9 |
10 | export {
11 | sampleObj,
12 | };
13 |
--------------------------------------------------------------------------------
/tests/circular-reference-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "circular-reference-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/circular-reference-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "circular-reference-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "devDependencies": {
14 | "baset": "^0.14.8",
15 | "baset-baseliner-json": "^0.14.8",
16 | "baset-reader-ts": "^0.14.7",
17 | "typescript": "^3.0.3"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/circular-reference-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "moduleResolution": "node",
15 | "baseUrl": ".",
16 | "paths": {
17 | "*": [
18 | "node_modules/*",
19 | "src/types/*",
20 | "lib/*"
21 | ]
22 | },
23 | "experimentalDecorators": true,
24 | "emitDecoratorMetadata": true
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tests/dom-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.js",
3 | "bases": "**/*.base",
4 | "plugins": {
5 | ".spec.js$": ["baset-env-browser", "baset-baseliner-json"]
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/tests/dom-project/index.js:
--------------------------------------------------------------------------------
1 | const body = document.getElementsByTagName('body')[0];
2 | body.appendChild(document.createElement('div'));
3 | body.appendChild(document.createElement('div'));
4 | body.appendChild(document.createElement('div'));
5 |
6 | function sampleFn(a, b) {
7 | const divNumber = document.getElementsByTagName('div').length;
8 | return a + b * divNumber;
9 | }
10 |
11 | module.exports.sampleFn = sampleFn;
12 |
--------------------------------------------------------------------------------
/tests/dom-project/index.spec.base:
--------------------------------------------------------------------------------
1 | {
2 | "values": [
3 | 4,
4 | 4000000,
5 | "abcNaN",
6 | Infinity,
7 | "abc3",
8 | "function call3",
9 | "async value3"
10 | ]
11 | }
--------------------------------------------------------------------------------
/tests/dom-project/index.spec.js:
--------------------------------------------------------------------------------
1 | const { sampleFn } = require('./index');
2 |
3 | module.exports = {
4 | values: [
5 | sampleFn(1, 1),
6 | sampleFn(1000000, 1000000),
7 | sampleFn('abc', 'cba'),
8 | sampleFn(1, 'abc'),
9 | sampleFn('abc', 1),
10 | () => sampleFn('function call', 1),
11 | new Promise(resolve => resolve(sampleFn('async value', 1)))
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/tests/dom-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dom-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "devDependencies": {
14 | "baset": "^0.14.8",
15 | "baset-baseliner-json": "^0.14.8",
16 | "baset-env-browser": "^0.14.7"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/md-specs-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.md",
3 | "files": "**/*.ts",
4 | "bases": "**/*.base.md",
5 | "plugins": {
6 | ".spec.md$": {
7 | "readers": ["baset-reader-md", "baset-reader-ts"],
8 | "baseliner": "baset-baseliner-md"
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/md-specs-project/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 |
7 | ## [0.14.8](https://github.com/Igmat/baset/compare/v0.14.7...v0.14.8) (2018-10-10)
8 |
9 | **Note:** Version bump only for package md-specs-project
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## [0.14.7](https://github.com/Igmat/baset/compare/v0.14.6...v0.14.7) (2018-10-10)
17 |
18 | **Note:** Version bump only for package md-specs-project
19 |
20 |
21 |
22 |
23 |
24 |
25 | ## [0.14.6](https://github.com/Igmat/baset/compare/v0.14.5...v0.14.6) (2018-10-09)
26 |
27 | **Note:** Version bump only for package md-specs-project
28 |
29 |
30 |
31 |
32 |
33 |
34 | ## [0.14.5](https://github.com/Igmat/baset/compare/v0.14.4...v0.14.5) (2018-10-09)
35 |
36 | **Note:** Version bump only for package md-specs-project
37 |
38 |
39 |
40 |
41 |
42 |
43 | ## [0.14.4](https://github.com/Igmat/baset/compare/v0.14.3...v0.14.4) (2018-10-07)
44 |
45 | **Note:** Version bump only for package md-specs-project
46 |
47 |
48 |
49 |
50 |
51 |
52 | ## [0.14.3](https://github.com/Igmat/baset/compare/v0.14.2...v0.14.3) (2018-10-07)
53 |
54 | **Note:** Version bump only for package md-specs-project
55 |
56 |
57 |
58 |
59 |
60 |
61 | ## [0.14.2](https://github.com/Igmat/baset/compare/v0.14.1...v0.14.2) (2018-09-17)
62 |
63 | **Note:** Version bump only for package md-specs-project
64 |
65 |
66 |
67 |
68 |
69 |
70 | # [0.14.0](https://github.com/Igmat/baset/compare/v0.13.7...v0.14.0) (2018-09-04)
71 |
72 |
73 |
74 |
75 | **Note:** Version bump only for package md-specs-project
76 |
77 |
78 | ## [0.13.7](https://github.com/Igmat/baset/compare/v0.13.6...v0.13.7) (2018-08-30)
79 |
80 |
81 |
82 |
83 | **Note:** Version bump only for package md-specs-project
84 |
85 |
86 | ## [0.13.6](https://github.com/Igmat/baset/compare/v0.13.5...v0.13.6) (2018-06-10)
87 |
88 |
89 |
90 |
91 | **Note:** Version bump only for package md-specs-project
92 |
93 |
94 | ## [0.13.5](https://github.com/Igmat/baset/compare/v0.13.4...v0.13.5) (2018-06-08)
95 |
96 |
97 |
98 |
99 | **Note:** Version bump only for package md-specs-project
100 |
101 |
102 | ## [0.13.4](https://github.com/Igmat/baset/compare/v0.13.3...v0.13.4) (2018-06-08)
103 |
104 |
105 |
106 |
107 | **Note:** Version bump only for package md-specs-project
108 |
109 |
110 | ## [0.13.1](https://github.com/Igmat/baset/compare/v0.13.0...v0.13.1) (2018-06-02)
111 |
112 |
113 |
114 |
115 | **Note:** Version bump only for package md-specs-project
116 |
117 |
118 | # [0.13.0](https://github.com/Igmat/baset/compare/v0.12.1...v0.13.0) (2018-05-31)
119 |
120 |
121 |
122 |
123 | **Note:** Version bump only for package md-specs-project
124 |
125 |
126 | ## [0.12.1](https://github.com/Igmat/baset/compare/v0.12.0...v0.12.1) (2018-05-29)
127 |
128 |
129 |
130 |
131 | **Note:** Version bump only for package md-specs-project
132 |
133 |
134 | # [0.12.0](https://github.com/Igmat/baset/compare/v0.11.1...v0.12.0) (2018-05-03)
135 |
136 |
137 |
138 |
139 | **Note:** Version bump only for package md-specs-project
140 |
--------------------------------------------------------------------------------
/tests/md-specs-project/index.spec.base.md:
--------------------------------------------------------------------------------
1 | JSON values:
2 | ```JSON
3 | [
4 | {
5 | "numberValue": 4,
6 | "values": [
7 | "abccbacbaabc",
8 | "1abcabc1"
9 | ]
10 | },
11 | {
12 | "numberValue": 4,
13 | "values": [
14 | "abc11abc"
15 | ]
16 | },
17 | {
18 | "numberValue": 4000000,
19 | "values": [
20 | "abccbacbaabc",
21 | "1abcabc1"
22 | ]
23 | },
24 | {
25 | "numberValue": 4000000,
26 | "values": [
27 | "abc11abc"
28 | ]
29 | },
30 | {
31 | "value": "function call11function call"
32 | },
33 | {
34 | "value": "async value11async value"
35 | },
36 | {
37 | "numberValue": 4,
38 | "values": [
39 | "abccbacbaabc",
40 | "1abcabc1"
41 | ]
42 | },
43 | {
44 | "numberValue": 4,
45 | "values": [
46 | "abc11abc"
47 | ]
48 | },
49 | {
50 | "numberValue": 4000000,
51 | "values": [
52 | "abccbacbaabc",
53 | "1abcabc1"
54 | ]
55 | },
56 | {
57 | "numberValue": 4000000,
58 | "values": [
59 | "abc11abc"
60 | ]
61 | },
62 | {
63 | "value": "function call11function call"
64 | },
65 | {
66 | "value": "async value11async value"
67 | }
68 | ]
69 | ```
--------------------------------------------------------------------------------
/tests/md-specs-project/index.spec.md:
--------------------------------------------------------------------------------
1 | # init
2 | To initialize use:
3 | ```TypeScript
4 | import { sampleFn } from './index';
5 | ```
6 | or
7 | ```TypeScript
8 | const { sampleFn } = require('./index');
9 | ```
10 | ## usage
11 | First example:
12 | ```TypeScript
13 | export const numberValue = sampleFn(1, 1);
14 | ```
15 | Second example and:
16 | ```TypeScript
17 | export const numberValue = sampleFn(1000000, 1000000);
18 | ```
19 | ### specific usage
20 | ```TypeScript
21 | export const values = [
22 | sampleFn('abc', 'cba'),
23 | sampleFn(1, 'abc'),
24 | ]
25 | ```
26 | ### second specific usage
27 | ```TypeScript
28 | export const values = [
29 | sampleFn('abc', 1),
30 | ]
31 | ```
32 | ## corner cases
33 | First example:
34 | ```TypeScript
35 | export const value = () => sampleFn('function call', 1);
36 | ```
37 | Second example
38 | ```TypeScript
39 | export const value = new Promise(resolve => resolve(sampleFn('async value', 1)));
40 | ```
41 |
--------------------------------------------------------------------------------
/tests/md-specs-project/index.ts:
--------------------------------------------------------------------------------
1 | export function sampleFn(a: any, b: any) {
2 | return a + b + b + a;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/md-specs-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "md-specs-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/md-specs-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "md-specs-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept",
10 | "scaffold": "baset scaffold"
11 | },
12 | "author": "",
13 | "license": "MIT",
14 | "devDependencies": {
15 | "baset": "^0.14.8",
16 | "baset-baseliner-md": "^0.14.8",
17 | "baset-reader-md": "^0.14.7",
18 | "baset-reader-ts": "^0.14.7",
19 | "typescript": "^3.0.3"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tests/md-specs-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "importHelpers": true,
15 | "moduleResolution": "node",
16 | "baseUrl": ".",
17 | "lib": [
18 | "dom",
19 | "es7"
20 | ],
21 | "paths": {
22 | "*": [
23 | "node_modules/*",
24 | "src/types/*",
25 | "lib/*"
26 | ]
27 | },
28 | "experimentalDecorators": true,
29 | "emitDecoratorMetadata": true
30 | },
31 | "include": [
32 | "lib/**/*",
33 | "/*.ts"
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/tests/sample-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.js",
3 | "bases": "**/*.base"
4 | }
5 |
--------------------------------------------------------------------------------
/tests/sample-project/index.js:
--------------------------------------------------------------------------------
1 | const fail = require('asn1');
2 |
3 | function sampleFn(a, b) {
4 | return a + b;
5 | }
6 |
7 | module.exports.sampleFn = sampleFn;
8 |
--------------------------------------------------------------------------------
/tests/sample-project/index.spec.base:
--------------------------------------------------------------------------------
1 | {
2 | "values": [
3 | 2,
4 | 2000000,
5 | "abccba",
6 | "1abc",
7 | "abc1",
8 | "function call1",
9 | "async value1"
10 | ]
11 | }
--------------------------------------------------------------------------------
/tests/sample-project/index.spec.js:
--------------------------------------------------------------------------------
1 | const { sampleFn } = require('./index');
2 |
3 | module.exports = {
4 | values: [
5 | sampleFn(1, 1),
6 | sampleFn(1000000, 1000000),
7 | sampleFn('abc', 'cba'),
8 | sampleFn(1, 'abc'),
9 | sampleFn('abc', 1),
10 | () => sampleFn('function call', 1),
11 | new Promise(resolve => resolve(sampleFn('async value', 1)))
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/tests/sample-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sample-project",
3 | "version": "0.13.7",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "asn1.js": {
8 | "version": "5.0.1",
9 | "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.0.1.tgz",
10 | "integrity": "sha512-aO8EaEgbgqq77IEw+1jfx5c9zTbzvkfuRBuZsSsPnTHMkmd5AI4J6OtITLZFa381jReeaQL67J0GBTUu0+ZTVw==",
11 | "requires": {
12 | "bn.js": "^4.0.0",
13 | "inherits": "^2.0.1",
14 | "minimalistic-assert": "^1.0.0"
15 | }
16 | },
17 | "bn.js": {
18 | "version": "4.11.8",
19 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
20 | "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA=="
21 | },
22 | "inherits": {
23 | "version": "2.0.3",
24 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
25 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
26 | },
27 | "minimalistic-assert": {
28 | "version": "1.0.1",
29 | "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
30 | "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/tests/sample-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sample-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "dependencies": {
14 | "asn1.js": "^5.0.1"
15 | },
16 | "devDependencies": {
17 | "baset": "^0.14.8",
18 | "baset-baseliner-json": "^0.14.8"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/tests/scaffold.spec.base:
--------------------------------------------------------------------------------
1 | {
2 | "stdout": [
3 | "",
4 | "",
5 | "Spec \"index.spec.ts\" is scaffolded",
6 | "Spec \"someClass.spec.ts\" is scaffolded",
7 | ""
8 | ],
9 | "stderr": []
10 | }
--------------------------------------------------------------------------------
/tests/scaffold.spec.ts:
--------------------------------------------------------------------------------
1 | import { sync as spawnSync } from 'cross-spawn';
2 | import fs from 'fs';
3 | import path from 'path';
4 |
5 | const cwd = path.resolve(__dirname, './scaffolded-project');
6 | const scaffoldProccess = spawnSync('npm', ['run', 'scaffold'], { cwd, encoding: 'utf8' });
7 | export = {
8 | stdout: scaffoldProccess.stdout.split('\n')
9 | // we don't need to check npm tasks output (like `> baset` or `> path/to/node.exe index.js`)
10 | .filter(line => !line.startsWith('>')),
11 | stderr: scaffoldProccess.stderr.split('\n')
12 | // we don't need to check npm warn about node version used in script
13 | .filter(line => !line.search('`--scripts-prepend-node-path`')),
14 | };
15 |
16 | /// Clean-up file system
17 | ['someClass.spec.ts', 'index.spec.ts']
18 | .map(file => path.resolve(cwd, file))
19 | .forEach(fs.unlinkSync);
20 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts",
3 | "files": "**/*.ts",
4 | "bases": "**/*.base",
5 | "plugins": {
6 | ".spec.js$": "baset-baseliner-json",
7 | ".spec.ts$": {
8 | "readers": "baset-reader-ts",
9 | "baseliner": "baset-baseliner-json",
10 | "imports": "./polyfill"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | **/*/dist
5 | /dist
6 | **/*/build
7 | /build
8 | **/*/tmp
9 | /tmp
10 | **/*/out-tsc
11 | /out-tsc
12 |
13 | # dependencies
14 | **/*/node_modules
15 | /node_modules
16 |
17 | # IDEs and editors
18 | /.idea
19 | .project
20 | .classpath
21 | .c9/
22 | *.launch
23 | .settings/
24 | *.sublime-workspace
25 | /.vs
26 | /iac/.vs
27 |
28 | # IDE - VSCode
29 | .vscode/*
30 | !.vscode/settings.json
31 | !.vscode/tasks.json
32 | !.vscode/launch.json
33 | !.vscode/extensions.json
34 | !.vscode/cSpell.json
35 |
36 | # misc
37 | **/*/.sass-cache
38 | /.sass-cache
39 | **/*/connect.lock
40 | /connect.lock
41 | **/*/coverage
42 | /coverage
43 | **/*/libpeerconnection.log
44 | /libpeerconnection.log
45 | yarn-error.log
46 | *.iml
47 | npm-debug.log
48 | .soliumignore
49 | .soliumrc.json
50 | testem.log
51 | **/*/typings
52 | /typings
53 |
54 | # e2e
55 | **/*/e2e/*.js
56 | /e2e/*.js
57 | **/*/e2e/*.map
58 | /e2e/*.map
59 |
60 | # System Files
61 | .DS_Store
62 | Thumbs.db
63 | lerna-debug.log
64 |
65 | # tmp baseline
66 | **/*.spec.md
67 | **/*.spec.ts
68 | **/*.spec.tmp.md
69 | **/*.spec.tmp.base
70 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 |
7 | ## [0.14.8](https://github.com/Igmat/baset/compare/v0.14.7...v0.14.8) (2018-10-10)
8 |
9 | **Note:** Version bump only for package scaffolded-project
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## [0.14.7](https://github.com/Igmat/baset/compare/v0.14.6...v0.14.7) (2018-10-10)
17 |
18 | **Note:** Version bump only for package scaffolded-project
19 |
20 |
21 |
22 |
23 |
24 |
25 | ## [0.14.6](https://github.com/Igmat/baset/compare/v0.14.5...v0.14.6) (2018-10-09)
26 |
27 | **Note:** Version bump only for package scaffolded-project
28 |
29 |
30 |
31 |
32 |
33 |
34 | ## [0.14.5](https://github.com/Igmat/baset/compare/v0.14.4...v0.14.5) (2018-10-09)
35 |
36 | **Note:** Version bump only for package scaffolded-project
37 |
38 |
39 |
40 |
41 |
42 |
43 | ## [0.14.4](https://github.com/Igmat/baset/compare/v0.14.3...v0.14.4) (2018-10-07)
44 |
45 | **Note:** Version bump only for package scaffolded-project
46 |
47 |
48 |
49 |
50 |
51 |
52 | ## [0.14.3](https://github.com/Igmat/baset/compare/v0.14.2...v0.14.3) (2018-10-07)
53 |
54 | **Note:** Version bump only for package scaffolded-project
55 |
56 |
57 |
58 |
59 |
60 |
61 | ## [0.14.2](https://github.com/Igmat/baset/compare/v0.14.1...v0.14.2) (2018-09-17)
62 |
63 | **Note:** Version bump only for package scaffolded-project
64 |
65 |
66 |
67 |
68 |
69 |
70 | ## [0.13.7](https://github.com/Igmat/baset/compare/v0.13.6...v0.13.7) (2018-08-30)
71 |
72 |
73 |
74 |
75 | **Note:** Version bump only for package scaffolded-project
76 |
77 |
78 | ## [0.13.6](https://github.com/Igmat/baset/compare/v0.13.5...v0.13.6) (2018-06-10)
79 |
80 |
81 |
82 |
83 | **Note:** Version bump only for package scaffolded-project
84 |
85 |
86 | ## [0.13.5](https://github.com/Igmat/baset/compare/v0.13.4...v0.13.5) (2018-06-08)
87 |
88 |
89 |
90 |
91 | **Note:** Version bump only for package scaffolded-project
92 |
93 |
94 | ## [0.13.4](https://github.com/Igmat/baset/compare/v0.13.3...v0.13.4) (2018-06-08)
95 |
96 |
97 |
98 |
99 | **Note:** Version bump only for package scaffolded-project
100 |
101 |
102 | ## [0.13.1](https://github.com/Igmat/baset/compare/v0.13.0...v0.13.1) (2018-06-02)
103 |
104 |
105 |
106 |
107 | **Note:** Version bump only for package scaffolded-project
108 |
109 |
110 | # [0.13.0](https://github.com/Igmat/baset/compare/v0.12.1...v0.13.0) (2018-05-31)
111 |
112 |
113 |
114 |
115 | **Note:** Version bump only for package scaffolded-project
116 |
117 |
118 | # [0.12.0](https://github.com/Igmat/baset/compare/v0.11.1...v0.12.0) (2018-05-03)
119 |
120 |
121 |
122 |
123 | **Note:** Version bump only for package scaffolded-project
124 |
125 |
126 | ## [0.11.1](https://github.com/Igmat/baset/compare/v0.11.0...v0.11.1) (2018-03-15)
127 |
128 |
129 |
130 |
131 | **Note:** Version bump only for package scaffolded-project
132 |
133 |
134 | # [0.11.0](https://github.com/Igmat/baset/compare/v0.10.0...v0.11.0) (2018-03-08)
135 |
136 |
137 |
138 |
139 | **Note:** Version bump only for package scaffolded-project
140 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/index.ts:
--------------------------------------------------------------------------------
1 | export function sampleFn(a: any, b: any) {
2 | return a + b + b + a;
3 | }
4 | export default function sample(a: string, b: string): string;
5 | export default function sample(a: number, b: number): number;
6 | export default function sample(a: any, b: any) {
7 | return a + b;
8 | }
9 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "scaffolded-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "scaffolded-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept",
10 | "scaffold": "baset scaffold"
11 | },
12 | "author": "",
13 | "license": "MIT",
14 | "dependencies": {
15 | "reflect-metadata": "^0.1.12",
16 | "tslib": "^1.9.3"
17 | },
18 | "devDependencies": {
19 | "baset": "^0.14.8",
20 | "baset-baseliner-json": "^0.14.8",
21 | "baset-reader-ts": "^0.14.7",
22 | "typescript": "^3.0.3"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/someClass.ts:
--------------------------------------------------------------------------------
1 | export class SomeClass {
2 | constructor(a: number, b: number, c: number)
3 | constructor(private a = 1, private b = 10, c: number) {
4 | this.b = b * c;
5 | }
6 |
7 | getSum() {
8 | return this.a + this.b;
9 | }
10 |
11 | getMultipliedSum(multiplier: number) {
12 | return this.getSum() * multiplier;
13 | }
14 |
15 | getStringOrNumberSum(a: string, b: string): string;
16 | getStringOrNumberSum(a: number, b: number): number;
17 | getStringOrNumberSum(a: string, b: number): undefined;
18 | getStringOrNumberSum(a: number, b: string): undefined;
19 | getStringOrNumberSum(a: string | number, b: string | number) {
20 | if (typeof a === 'string') {
21 | if (typeof b === 'string') return a + b + this.getSum().toString();
22 |
23 | return;
24 | }
25 | if (typeof b === 'number') return a + b + this.getSum();
26 |
27 | return;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tests/scaffolded-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "importHelpers": true,
15 | "moduleResolution": "node",
16 | "baseUrl": ".",
17 | "lib": [
18 | "dom",
19 | "es7"
20 | ],
21 | "paths": {
22 | "*": [
23 | "node_modules/*",
24 | "src/types/*"
25 | ]
26 | },
27 | "experimentalDecorators": true,
28 | "emitDecoratorMetadata": true
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/tests/test.spec.ts:
--------------------------------------------------------------------------------
1 | import { sync as spawnSync } from 'cross-spawn';
2 | import fs from 'fs';
3 | import path from 'path';
4 |
5 | export = fs.readdirSync(__dirname)
6 | .filter(source => fs.lstatSync(path.join(__dirname, source)).isDirectory())
7 | .filter(project => project !== 'scaffolded-project')
8 | .map(project => {
9 | const cwd = path.resolve(__dirname, `./${project}`);
10 | const testProccess = spawnSync('npm', ['test'], { cwd, encoding: 'utf8' });
11 |
12 | return {
13 | project,
14 | stdout: testProccess.stdout.split('\n')
15 | // we don't need to check npm tasks output (like `> baset` or `> path/to/node.exe index.js`)
16 | .filter(line => !line.startsWith('>'))
17 | .filter(line => !line.startsWith('PixiJS'))
18 | .map(line => line
19 | .replace(/\(.*m?s\)/, '') // we don't need timing output from `tap-diff` here
20 | .replace(/(✔|√)/, ' ')), // `tap-diff` has different signs on win and *nix
21 | stderr: testProccess.stderr.split('\n')
22 | // we don't need to check npm warn about node version used in script
23 | .filter(line => !line.search('`--scripts-prepend-node-path`')),
24 | };
25 | });
26 |
--------------------------------------------------------------------------------
/tests/tsx-babel-project/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015",
4 | "react"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/tests/tsx-babel-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts?(x)",
3 | "bases": "**/*.spec.base.md",
4 | "plugins": {
5 | ".spec.tsx?$": {
6 | "environment": "baset-env-browser",
7 | "readers": ["baset-reader-ts", "baset-reader-babel"],
8 | "resolvers": "baset-resolver-react",
9 | "baseliner": "baset-baseliner-md"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/tests/tsx-babel-project/index.spec.base.md:
--------------------------------------------------------------------------------
1 | `exports.value:`
2 |
3 | ```HTML
4 |
5 |
8 | ss
9 |
10 |
13 | abccba
14 |
15 |
18 | sabc
19 |
20 |
23 | abcs
24 |
25 |
26 | ```
--------------------------------------------------------------------------------
/tests/tsx-babel-project/index.spec.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { jsxFn } from './index';
3 |
4 | export const value = (
5 |
6 | {jsxFn('s', 's')}
7 | {jsxFn('abc', 'cba')}
8 | {jsxFn('s', 'abc')}
9 | {jsxFn('abc', 's')}
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/tests/tsx-babel-project/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export const jsxFn = (a: string, b: string) => ({a + b}
);
4 |
--------------------------------------------------------------------------------
/tests/tsx-babel-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tsx-babel-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/tsx-babel-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tsx-babel-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "dependencies": {
14 | "react": "^16.5.1",
15 | "react-dom": "^16.5.1"
16 | },
17 | "devDependencies": {
18 | "@types/react": "^16.4.14",
19 | "@types/react-dom": "^16.0.7",
20 | "babel-cli": "^6.26.0",
21 | "babel-preset-es2015": "^6.24.1",
22 | "babel-preset-react": "^6.24.1",
23 | "baset": "^0.14.8",
24 | "baset-baseliner-md": "^0.14.8",
25 | "baset-env-browser": "^0.14.7",
26 | "baset-reader-babel": "^0.14.7",
27 | "baset-reader-ts": "^0.14.7",
28 | "baset-resolver-react": "^0.14.7",
29 | "typescript": "^3.0.3"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/tests/tsx-babel-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "moduleResolution": "node",
15 | "baseUrl": ".",
16 | "jsx": "preserve",
17 | "paths": {
18 | "*": [
19 | "node_modules/*",
20 | "src/types/*",
21 | "lib/*"
22 | ]
23 | },
24 | "experimentalDecorators": true,
25 | "emitDecoratorMetadata": true
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tests/tsx-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts?(x)",
3 | "bases": "**/*.spec.base.md",
4 | "plugins": {
5 | ".spec.tsx?$": ["baset-env-browser", "baset-reader-ts", "baset-resolver-react", "baset-baseliner-md"]
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/tests/tsx-project/index.spec.base.md:
--------------------------------------------------------------------------------
1 | `exports.value:`
2 |
3 | ```HTML
4 |
5 |
8 | ss
9 |
10 |
13 | abccba
14 |
15 |
18 | sabc
19 |
20 |
23 | abcs
24 |
25 |
26 | ```
--------------------------------------------------------------------------------
/tests/tsx-project/index.spec.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { jsxFn } from './index';
3 |
4 | export const value = (
5 |
6 | {jsxFn('s', 's')}
7 | {jsxFn('abc', 'cba')}
8 | {jsxFn('s', 'abc')}
9 | {jsxFn('abc', 's')}
10 |
11 | );
12 |
--------------------------------------------------------------------------------
/tests/tsx-project/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export const jsxFn = (a, b) => ({a + b}
);
4 |
--------------------------------------------------------------------------------
/tests/tsx-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tsx-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@types/react": {
8 | "version": "16.4.14",
9 | "resolved": "https://registry.npmjs.org/@types/react/-/react-16.4.14.tgz",
10 | "integrity": "sha512-Gh8irag2dbZ2K6vPn+S8+LNrULuG3zlCgJjVUrvuiUK7waw9d9CFk2A/tZFyGhcMDUyO7tznbx1ZasqlAGjHxA==",
11 | "dev": true,
12 | "requires": {
13 | "@types/prop-types": "*",
14 | "csstype": "^2.2.0"
15 | },
16 | "dependencies": {
17 | "@types/prop-types": {
18 | "version": "15.5.5",
19 | "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.5.5.tgz",
20 | "integrity": "sha512-mOrlCEdwX3seT3n0AXNt4KNPAZZxcsABUHwBgFXOt+nvFUXkxCAO6UBJHPrDxWEa2KDMil86355fjo8jbZ+K0Q==",
21 | "dev": true,
22 | "requires": {
23 | "@types/react": "*"
24 | }
25 | },
26 | "csstype": {
27 | "version": "2.5.7",
28 | "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.5.7.tgz",
29 | "integrity": "sha512-Nt5VDyOTIIV4/nRFswoCKps1R5CD1hkiyjBE9/thNaNZILLEviVw9yWQw15+O+CpNjQKB/uvdcxFFOrSflY3Yw==",
30 | "dev": true
31 | }
32 | }
33 | },
34 | "@types/react-dom": {
35 | "version": "16.0.7",
36 | "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.0.7.tgz",
37 | "integrity": "sha512-vaq4vMaJOaNgFff1t3LnHYr6vRa09vRspMkmLdXtFZmO1fwDI2snP+dpOkwrtlU8UC8qsqemCu4RmVM2OLq/fA==",
38 | "dev": true,
39 | "requires": {
40 | "@types/node": "*",
41 | "@types/react": "*"
42 | },
43 | "dependencies": {
44 | "@types/node": {
45 | "version": "10.10.0",
46 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.10.0.tgz",
47 | "integrity": "sha512-0V36JTaif20jrbTbZeKqnI4R8nLVE8Ah/u9dQT5jIKXjW51/4ipi/B8Xon1ZiEHATYpgLNoBw2LFfdBMoA5Fzg==",
48 | "dev": true
49 | }
50 | }
51 | },
52 | "typescript": {
53 | "version": "3.5.1",
54 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz",
55 | "integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==",
56 | "dev": true
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/tests/tsx-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tsx-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "dependencies": {
14 | "react": "^16.5.1",
15 | "react-dom": "^16.5.1"
16 | },
17 | "devDependencies": {
18 | "@types/react": "^16.0.38",
19 | "@types/react-dom": "^16.0.4",
20 | "baset": "^0.14.8",
21 | "baset-baseliner-md": "^0.14.8",
22 | "baset-env-browser": "^0.14.7",
23 | "baset-reader-ts": "^0.14.7",
24 | "baset-resolver-react": "^0.14.7",
25 | "typescript": "^3.0.3"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tests/tsx-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "moduleResolution": "node",
15 | "baseUrl": ".",
16 | "jsx": "react",
17 | "paths": {
18 | "*": [
19 | "node_modules/*",
20 | "src/types/*",
21 | "lib/*"
22 | ]
23 | },
24 | "experimentalDecorators": true,
25 | "emitDecoratorMetadata": true
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts?(x)",
3 | "bases": "**/*.spec.base.md",
4 | "plugins": {
5 | ".spec.tsx?$": {
6 | "readers": ["./scripts/baset-assets-reader.js", "baset-reader-ts"],
7 | "resolvers": "baset-resolver-react",
8 | "baseliner": "baset-baseliner-md",
9 | "mocks": {
10 | "styled-components": "./src/mocks/styled"
11 | }
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 |
7 | ## [0.14.8](https://github.com/Igmat/baset/compare/v0.14.7...v0.14.8) (2018-10-10)
8 |
9 | **Note:** Version bump only for package tsx-styled-components-project
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## [0.14.7](https://github.com/Igmat/baset/compare/v0.14.6...v0.14.7) (2018-10-10)
17 |
18 | **Note:** Version bump only for package tsx-styled-components-project
19 |
20 |
21 |
22 |
23 |
24 |
25 | ## [0.14.6](https://github.com/Igmat/baset/compare/v0.14.5...v0.14.6) (2018-10-09)
26 |
27 | **Note:** Version bump only for package tsx-styled-components-project
28 |
29 |
30 |
31 |
32 |
33 |
34 | ## [0.14.5](https://github.com/Igmat/baset/compare/v0.14.4...v0.14.5) (2018-10-09)
35 |
36 | **Note:** Version bump only for package tsx-styled-components-project
37 |
38 |
39 |
40 |
41 |
42 |
43 | ## [0.14.4](https://github.com/Igmat/baset/compare/v0.14.3...v0.14.4) (2018-10-07)
44 |
45 | **Note:** Version bump only for package tsx-styled-components-project
46 |
47 |
48 |
49 |
50 |
51 |
52 | ## [0.14.3](https://github.com/Igmat/baset/compare/v0.14.2...v0.14.3) (2018-10-07)
53 |
54 | **Note:** Version bump only for package tsx-styled-components-project
55 |
56 |
57 |
58 |
59 |
60 |
61 | ## [0.14.2](https://github.com/Igmat/baset/compare/v0.14.1...v0.14.2) (2018-09-17)
62 |
63 | **Note:** Version bump only for package tsx-styled-components-project
64 |
65 |
66 |
67 |
68 |
69 |
70 | ## [0.14.1](https://github.com/Igmat/baset/compare/v0.14.0...v0.14.1) (2018-09-04)
71 |
72 |
73 |
74 |
75 | **Note:** Version bump only for package tsx-styled-components-project
76 |
77 |
78 | # [0.14.0](https://github.com/Igmat/baset/compare/v0.13.7...v0.14.0) (2018-09-04)
79 |
80 |
81 |
82 |
83 | **Note:** Version bump only for package tsx-styled-components-project
84 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/images.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.svg'
2 | declare module '*.png'
3 | declare module '*.jpg'
4 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tsx-styled-components-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tsx-styled-components-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.5.1",
7 | "react-dom": "^16.5.1",
8 | "react-scripts-ts": "^2.17.0",
9 | "styled-components": "^3.4.6"
10 | },
11 | "scripts": {
12 | "start": "react-scripts-ts start",
13 | "build": "react-scripts-ts build",
14 | "test": "baset",
15 | "accept": "baset a",
16 | "eject": "react-scripts-ts eject"
17 | },
18 | "devDependencies": {
19 | "@types/jest": "^23.3.2",
20 | "@types/node": "^10.10.0",
21 | "@types/react": "^16.4.14",
22 | "@types/react-dom": "^16.0.7",
23 | "@types/styled-components": "^3.0.1",
24 | "baset": "^0.14.8",
25 | "baset-baseliner-md": "^0.14.8",
26 | "baset-core": "^0.14.7",
27 | "baset-env-browser": "^0.14.7",
28 | "baset-reader-ts": "^0.14.7",
29 | "baset-resolver-react": "^0.14.7",
30 | "typescript": "^3.0.3"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Igmat/baset/a1ac7e9ca45a23846b01dd977f1951948f29d652/tests/tsx-styled-components-project/public/favicon.ico
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
22 | React App
23 |
24 |
25 |
28 |
29 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/scripts/baset-assets-reader.js:
--------------------------------------------------------------------------------
1 | const { AbstractReader } = require('baset-core');
2 |
3 | const mockCode = `
4 | const path = require('path');
5 | module.exports.default = path.relative(process.cwd(), __filename).split(path.sep).join('/');
6 | `
7 | class AssetsReader extends AbstractReader {
8 | constructor(options) {
9 | super(options);
10 | this.exts = ['.css', '.less', '.jpg', '.png', '.svg', '.woff', '.woff2']
11 |
12 | this.read = (filePath, spec) => spec;
13 |
14 | this.registerHook = (addHook, addFileResolver) =>
15 | addHook(
16 | (code, filename) => mockCode,
17 | {
18 | exts: this.exts,
19 | matcher: filename => /\.(css|less|jpg|png|svg|woff|woff2)$/i.test(filename)
20 | });
21 | }
22 | }
23 |
24 | exports.default = AssetsReader;
25 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | animation: App-logo-spin infinite 20s linear;
7 | height: 80px;
8 | }
9 |
10 | .App-header {
11 | background-color: #222;
12 | height: 150px;
13 | padding: 20px;
14 | color: white;
15 | }
16 |
17 | .App-title {
18 | font-size: 1.5em;
19 | }
20 |
21 | .App-intro {
22 | font-size: large;
23 | }
24 |
25 | @keyframes App-logo-spin {
26 | from { transform: rotate(0deg); }
27 | to { transform: rotate(360deg); }
28 | }
29 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/App.spec.base.md:
--------------------------------------------------------------------------------
1 | `exports.default:`
2 |
3 | ```HTML
4 |
7 |
10 |
15 |
18 | Welcome to React
19 |
20 |
21 |
24 | hi from mock
25 | To get started, edit
26 |
27 | src/App.tsx
28 |
29 | and save to reload.
30 |
31 |
32 | ```
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/App.spec.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import App from "./App";
3 |
4 | export default
5 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/App.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import styled, { injectGlobal } from 'styled-components';
3 | import './App.css';
4 |
5 | import logo from './logo.svg';
6 |
7 | const Introduction = styled.p`
8 | font-weight: 900;
9 | font-size: large;
10 | `;
11 |
12 | class App extends React.Component {
13 | public render() {
14 | return (
15 |
16 |
17 |
18 | Welcome to React
19 |
20 |
21 | { injectGlobal`` }
22 | To get started, edit src/App.tsx
and save to reload.
23 |
24 |
25 | );
26 | }
27 | }
28 |
29 | export default App;
30 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | }
6 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import * as ReactDOM from 'react-dom';
3 | import App from './App';
4 | import './index.css';
5 | import registerServiceWorker from './registerServiceWorker';
6 |
7 | ReactDOM.render(
8 | ,
9 | document.getElementById('root') as HTMLElement
10 | );
11 | registerServiceWorker();
12 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/logo.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/src/mocks/styled.ts:
--------------------------------------------------------------------------------
1 | import * as styled from 'styled-components';
2 |
3 | export = {
4 | ...styled,
5 | injectGlobal: () => 'hi from mock',
6 | }
7 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "outDir": "build/dist",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "lib": ["es6", "dom"],
8 | "sourceMap": true,
9 | "allowJs": true,
10 | "jsx": "react",
11 | "moduleResolution": "node",
12 | "rootDir": "src",
13 | "forceConsistentCasingInFileNames": true,
14 | "noImplicitReturns": true,
15 | "noImplicitThis": true,
16 | "noImplicitAny": true,
17 | "strictNullChecks": true,
18 | "suppressImplicitAnyIndexErrors": true,
19 | "noUnusedLocals": true
20 | },
21 | "exclude": [
22 | "node_modules",
23 | "build",
24 | "scripts",
25 | "acceptance-tests",
26 | "webpack",
27 | "jest",
28 | "src/setupTests.ts"
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json"
3 | }
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/tsconfig.test.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs"
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/tsx-styled-components-project/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"],
3 | "linterOptions": {
4 | "exclude": [
5 | "config/**/*.js",
6 | "node_modules/**/*.ts",
7 | "coverage/lcov-report/*.js"
8 | ]
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/tests/typescript-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts",
3 | "files": "**/*.ts",
4 | "bases": "**/*.base",
5 | "plugins": {
6 | ".spec.js$": "baset-baseliner-json",
7 | ".spec.ts$": {
8 | "readers": "baset-reader-ts",
9 | "baseliner": "baset-baseliner-json",
10 | "imports": "./polyfill"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/typescript-project/index.spec.base:
--------------------------------------------------------------------------------
1 | {
2 | "values": [
3 | 4,
4 | 4000000,
5 | "abccbacbaabc",
6 | "1abcabc1",
7 | "abc11abc",
8 | "function call11function call",
9 | "async value11async value"
10 | ]
11 | }
--------------------------------------------------------------------------------
/tests/typescript-project/index.spec.ts:
--------------------------------------------------------------------------------
1 | import { sampleFn } from './index';
2 |
3 | export = {
4 | values: [
5 | sampleFn(1, 1),
6 | sampleFn(1000000, 1000000),
7 | sampleFn('abc', 'cba'),
8 | sampleFn(1, 'abc'),
9 | sampleFn('abc', 1),
10 | () => sampleFn('function call', 1),
11 | new Promise(resolve => resolve(sampleFn('async value', 1))),
12 | ],
13 | };
14 |
--------------------------------------------------------------------------------
/tests/typescript-project/index.ts:
--------------------------------------------------------------------------------
1 | export function sampleFn(a: any, b: any) {
2 | return a + b + b + a;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/typescript-project/lib/someCoolClass.ts:
--------------------------------------------------------------------------------
1 | function logParamTypes(target: any, key: string) {
2 | const types = Reflect.getMetadata('design:paramtypes', target, key);
3 | const s = types.map((a: any) => a.name).join();
4 | }
5 |
6 | export class SomeCoolClass {
7 | private a = 1000;
8 | private b = 300;
9 |
10 | @logParamTypes
11 | getSum() {
12 | return this.a + this.b;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/typescript-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "typescript-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/typescript-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "typescript-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept",
10 | "scaffold": "baset scaffold"
11 | },
12 | "author": "",
13 | "license": "MIT",
14 | "dependencies": {
15 | "reflect-metadata": "^0.1.12",
16 | "tslib": "^1.9.3"
17 | },
18 | "devDependencies": {
19 | "baset": "^0.14.8",
20 | "baset-baseliner-json": "^0.14.8",
21 | "baset-reader-ts": "^0.14.7",
22 | "typescript": "^3.0.3"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/tests/typescript-project/pathImport.spec.base:
--------------------------------------------------------------------------------
1 | { "sum": 1300 }
--------------------------------------------------------------------------------
/tests/typescript-project/pathImport.spec.ts:
--------------------------------------------------------------------------------
1 | import { SomeCoolClass } from 'someCoolClass';
2 |
3 | export const sum = new SomeCoolClass().getSum();
4 |
--------------------------------------------------------------------------------
/tests/typescript-project/polyfill.ts:
--------------------------------------------------------------------------------
1 | import 'reflect-metadata';
2 |
--------------------------------------------------------------------------------
/tests/typescript-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "importHelpers": true,
15 | "moduleResolution": "node",
16 | "baseUrl": ".",
17 | "lib": [
18 | "dom",
19 | "es7"
20 | ],
21 | "paths": {
22 | "*": [
23 | "node_modules/*",
24 | "src/types/*",
25 | "lib/*"
26 | ]
27 | },
28 | "experimentalDecorators": true,
29 | "emitDecoratorMetadata": true
30 | },
31 | "include": [
32 | "lib/**/*",
33 | "/*.ts"
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/.basetrc:
--------------------------------------------------------------------------------
1 | {
2 | "specs": "**/*.spec.ts",
3 | "bases": "**/*.base",
4 | "plugins": {
5 | ".spec.ts$": ["baset-env-browser", "baset-reader-ts", "baset-baseliner-json"]
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 |
7 | ## [0.14.8](https://github.com/Igmat/baset/compare/v0.14.7...v0.14.8) (2018-10-10)
8 |
9 | **Note:** Version bump only for package umd-like-dep-project
10 |
11 |
12 |
13 |
14 |
15 |
16 | ## [0.14.7](https://github.com/Igmat/baset/compare/v0.14.6...v0.14.7) (2018-10-10)
17 |
18 | **Note:** Version bump only for package umd-like-dep-project
19 |
20 |
21 |
22 |
23 |
24 |
25 | ## [0.14.6](https://github.com/Igmat/baset/compare/v0.14.5...v0.14.6) (2018-10-09)
26 |
27 | **Note:** Version bump only for package umd-like-dep-project
28 |
29 |
30 |
31 |
32 |
33 |
34 | ## [0.14.5](https://github.com/Igmat/baset/compare/v0.14.4...v0.14.5) (2018-10-09)
35 |
36 | **Note:** Version bump only for package umd-like-dep-project
37 |
38 |
39 |
40 |
41 |
42 |
43 | ## [0.14.4](https://github.com/Igmat/baset/compare/v0.14.3...v0.14.4) (2018-10-07)
44 |
45 | **Note:** Version bump only for package umd-like-dep-project
46 |
47 |
48 |
49 |
50 |
51 |
52 | ## [0.14.3](https://github.com/Igmat/baset/compare/v0.14.2...v0.14.3) (2018-10-07)
53 |
54 | **Note:** Version bump only for package umd-like-dep-project
55 |
56 |
57 |
58 |
59 |
60 |
61 | ## [0.14.2](https://github.com/Igmat/baset/compare/v0.14.1...v0.14.2) (2018-09-17)
62 |
63 | **Note:** Version bump only for package umd-like-dep-project
64 |
65 |
66 |
67 |
68 |
69 |
70 | ## [0.13.7](https://github.com/Igmat/baset/compare/v0.13.6...v0.13.7) (2018-08-30)
71 |
72 |
73 |
74 |
75 | **Note:** Version bump only for package umd-like-dep-project
76 |
77 |
78 | ## [0.13.6](https://github.com/Igmat/baset/compare/v0.13.5...v0.13.6) (2018-06-10)
79 |
80 |
81 |
82 |
83 | **Note:** Version bump only for package umd-like-dep-project
84 |
85 |
86 | ## [0.13.5](https://github.com/Igmat/baset/compare/v0.13.4...v0.13.5) (2018-06-08)
87 |
88 |
89 |
90 |
91 | **Note:** Version bump only for package umd-like-dep-project
92 |
93 |
94 | ## [0.13.4](https://github.com/Igmat/baset/compare/v0.13.3...v0.13.4) (2018-06-08)
95 |
96 |
97 |
98 |
99 | **Note:** Version bump only for package umd-like-dep-project
100 |
101 |
102 | ## [0.13.2](https://github.com/Igmat/baset/compare/v0.13.1...v0.13.2) (2018-06-07)
103 |
104 |
105 |
106 |
107 | **Note:** Version bump only for package umd-like-dep-project
108 |
109 |
110 | ## [0.13.1](https://github.com/Igmat/baset/compare/v0.13.0...v0.13.1) (2018-06-02)
111 |
112 |
113 |
114 |
115 | **Note:** Version bump only for package umd-like-dep-project
116 |
117 |
118 | # [0.13.0](https://github.com/Igmat/baset/compare/v0.12.1...v0.13.0) (2018-05-31)
119 |
120 |
121 |
122 |
123 | **Note:** Version bump only for package umd-like-dep-project
124 |
125 |
126 | # [0.12.0](https://github.com/Igmat/baset/compare/v0.11.1...v0.12.0) (2018-05-03)
127 |
128 |
129 |
130 |
131 | **Note:** Version bump only for package umd-like-dep-project
132 |
133 |
134 | ## [0.11.1](https://github.com/Igmat/baset/compare/v0.11.0...v0.11.1) (2018-03-15)
135 |
136 |
137 |
138 |
139 | **Note:** Version bump only for package umd-like-dep-project
140 |
141 |
142 | # [0.11.0](https://github.com/Igmat/baset/compare/v0.10.0...v0.11.0) (2018-03-08)
143 |
144 |
145 |
146 |
147 | **Note:** Version bump only for package umd-like-dep-project
148 |
149 |
150 | # [0.10.0](https://github.com/Igmat/baset/compare/v0.9.1...v0.10.0) (2018-03-07)
151 |
152 |
153 |
154 |
155 | **Note:** Version bump only for package umd-like-dep-project
156 |
157 |
158 | # [0.9.0](https://github.com/Igmat/baset/compare/v0.8.0...v0.9.0) (2018-03-03)
159 |
160 |
161 |
162 |
163 | **Note:** Version bump only for package umd-like-dep-project
164 |
165 |
166 | # [0.8.0](https://github.com/Igmat/baset/compare/v0.7.5...v0.8.0) (2018-02-28)
167 |
168 |
169 |
170 |
171 | **Note:** Version bump only for package umd-like-dep-project
172 |
173 |
174 | ## [0.7.5](https://github.com/Igmat/baset/compare/v0.7.4...v0.7.5) (2018-02-27)
175 |
176 |
177 |
178 |
179 | **Note:** Version bump only for package umd-like-dep-project
180 |
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/index.spec.base:
--------------------------------------------------------------------------------
1 | {
2 | "values": [
3 | 4,
4 | 4000000,
5 | "abccbacbaabc",
6 | "1abcabc1",
7 | "abc11abc",
8 | "function call11function call",
9 | "async value11async value"
10 | ]
11 | }
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/index.spec.ts:
--------------------------------------------------------------------------------
1 | import { sampleFn } from './index';
2 |
3 | export = {
4 | values: [
5 | sampleFn(1, 1),
6 | sampleFn(1000000, 1000000),
7 | sampleFn('abc', 'cba'),
8 | sampleFn(1, 'abc'),
9 | sampleFn('abc', 1),
10 | () => sampleFn('function call', 1),
11 | new Promise(resolve => resolve(sampleFn('async value', 1))),
12 | ],
13 | };
14 |
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/index.ts:
--------------------------------------------------------------------------------
1 | import { Howl } from 'howler';
2 |
3 | const sound = new Howl({ src: '' });
4 | export function sampleFn(a: any, b: any) {
5 | return a + b + b + a;
6 | }
7 |
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "umd-like-dep-project",
3 | "version": "0.14.8",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "typescript": {
8 | "version": "3.0.3",
9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz",
10 | "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==",
11 | "dev": true
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "umd-like-dep-project",
3 | "version": "0.14.8",
4 | "private": true,
5 | "description": "",
6 | "main": "index.js",
7 | "scripts": {
8 | "test": "baset",
9 | "accept": "baset accept"
10 | },
11 | "author": "",
12 | "license": "MIT",
13 | "dependencies": {
14 | "howler": "^2.0.15"
15 | },
16 | "devDependencies": {
17 | "@types/howler": "^2.0.5",
18 | "baset": "^0.14.8",
19 | "baset-baseliner-json": "^0.14.8",
20 | "baset-env-browser": "^0.14.7",
21 | "baset-reader-ts": "^0.14.7",
22 | "typescript": "^3.0.3"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/tests/umd-like-dep-project/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "outDir": "dist",
8 | "strict": true,
9 | "noImplicitAny": true,
10 | "strictNullChecks": true,
11 | "noImplicitThis": true,
12 | "noImplicitReturns": true,
13 | "noFallthroughCasesInSwitch": true,
14 | "moduleResolution": "node",
15 | "baseUrl": ".",
16 | "paths": {
17 | "*": [
18 | "node_modules/*",
19 | "src/types/*",
20 | "lib/*"
21 | ]
22 | },
23 | "experimentalDecorators": true,
24 | "emitDecoratorMetadata": true
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "declaration": true,
7 | "strict": true,
8 | "noImplicitAny": true,
9 | "strictNullChecks": true,
10 | "noImplicitThis": true,
11 | "noImplicitReturns": true,
12 | "noFallthroughCasesInSwitch": true,
13 | "moduleResolution": "node",
14 | "experimentalDecorators": true,
15 | "emitDecoratorMetadata": true,
16 | "pretty": true,
17 | "esModuleInterop": true
18 | }
19 | }
20 |
--------------------------------------------------------------------------------