Skip to content

Commit 56dc1c4

Browse files
authored
Fix test setup (#2)
* Fix test setup * Update tsconfig target to ES2021
1 parent ce189dc commit 56dc1c4

File tree

11 files changed

+18528
-29
lines changed

11 files changed

+18528
-29
lines changed

config/tsconfig.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"module": "ES2020",
4-
"target": "ES2019",
4+
"target": "ES2021",
55
"importHelpers": true,
66
"sourceMap": true,
77
"declaration": true,

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@
146146
"yeoman-generator": "4"
147147
},
148148
"devDependencies": {
149-
"@types/yargs": "^17.0.10",
150-
"install-local-dependencies": "^0.2.3"
149+
"@types/yargs": "^17.0.10"
151150
},
152151
"peerDependencies": {
153152
"@types/react": "^16.9.23",

tests/workspace.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ describe('workspace', () => {
1919
};
2020

2121
beforeAll(() => {
22-
// Install dependencies via install-local-dependencies as npm does not install transitive deps properly if it is a relative path: https://github.com/pnpm/pnpm/issues/3102
22+
// Install dependencies
2323
if (!fs.existsSync(resolve(templateDir, 'node_modules'))) {
2424
// eslint-disable-next-line no-console
2525
console.log('Installing local dependencies in the template folder');
26-
execSync('install-local-dependencies', {
26+
execSync('yarn install', {
2727
cwd: templateDir,
2828
stdio: 'inherit',
2929
});
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
node_modules/
22
bundles/
3-
package-lock.json
3+
package-lock.json
4+
5+
# yarn
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/sdks
12+
!.yarn/versions

tests_fixtures/workspace_template/.localdependenciesrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests_fixtures/workspace_template/.yarn/releases/yarn-3.2.2.cjs

Lines changed: 783 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"defaultApp": "demo",
3-
"modules": []
2+
"defaultApp": "demo"
43
}

tests_fixtures/workspace_template/demo/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,13 @@ node_modules/
2828
/tests/**/*.map
2929
*.css
3030
package-lock.json
31+
32+
33+
# yarn
34+
.pnp.*
35+
.yarn/*
36+
!.yarn/patches
37+
!.yarn/plugins
38+
!.yarn/releases
39+
!.yarn/sdks
40+
!.yarn/versions

tests_fixtures/workspace_template/demo/package.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,37 @@
1515
"url": "[email protected]:datavisyn/visyn_scripts.git"
1616
},
1717
"scripts": {
18-
"build": "npm run clean && npm run compile",
19-
"clean": "rimraf build dist lib",
18+
"all": "yarn run lint:fix && yarn run test && yarn run build && yarn run dist",
19+
"build": "yarn run clean && yarn run compile && yarn run copy",
20+
"clean": "visyn_scripts clean build dist lib",
2021
"compile:watch": "visyn_scripts compile --watch",
2122
"compile": "visyn_scripts compile",
2223
"copy": "visyn_scripts copy",
24+
"cy:open": "cypress open",
25+
"cy:run": "cypress run",
26+
"delete-dependencies": "visyn_scripts clean node_modules",
27+
"predist": "yarn run lint && yarn run test && yarn run build",
28+
"dist": "mkdir lib && cd dist && tar cvzf ../lib/marketplace360.tar.gz *",
2329
"docs": "visyn_scripts docs",
2430
"lint:fix": "visyn_scripts lint --fix",
2531
"lint": "visyn_scripts lint",
26-
"postcompile": "npm run copy",
27-
"posttest": "npm run lint",
28-
"prebuild": "npm run test",
29-
"test:watch": "visyn_scripts test --watch",
30-
"test": "visyn_scripts test"
32+
"prepack": "yarn run build",
33+
"start": "visyn_scripts start --env workspace_mode=single",
34+
"storybook:build": "NODE_OPTIONS=--max_old_space_size=4096 build-storybook",
35+
"storybook": "NODE_OPTIONS=--max_old_space_size=4096 start-storybook -p 6006",
36+
"test": "visyn_scripts test",
37+
"webpack:dev": "visyn_scripts build --mode development --env workspace_mode=single",
38+
"webpack:prod": "visyn_scripts build --mode production --env workspace_mode=single"
3139
},
3240
"dependencies": {
33-
"tdp_core": "git+ssh://[email protected]:datavisyn/tdp_core#visyn_scripts",
34-
"visyn_scripts": "git+ssh://[email protected]:datavisyn/visyn_scripts#develop"
41+
"tdp_core": "git+ssh://[email protected]:datavisyn/tdp_core#develop"
3542
},
36-
"devDependencies": {},
3743
"visyn": {
3844
"entries": {
3945
"app": {
40-
"js": "dist/index.initialize.js",
46+
"js": "src/index.initialize.tsx",
4147
"html": "index.html",
42-
"template": "dist/index.template.ejs",
48+
"template": "src/index.template.ejs",
4349
"chunkName": "app",
4450
"excludeChunks": []
4551
}

tests_fixtures/workspace_template/package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@
88
"url": "https://www.datavisyn.io"
99
},
1010
"scripts": {
11-
"build": "visyn_scripts build --mode production",
1211
"build:demo": "cd demo && npm run build",
13-
"copy:demo": "cd demo && npm run copy"
12+
"copy:demo": "cd demo && npm run copy",
13+
"delete-dependencies:demo": "cd demo && npm run delete-dependencies",
14+
"postinstall": "npm-run-all --parallel 'delete-dependencies:*'",
15+
"start": "visyn_scripts start",
16+
"build": "npm run webpack:prod",
17+
"webpack:dev": "visyn_scripts build --mode development",
18+
"webpack:prod": "visyn_scripts build --mode production"
1419
},
1520
"dependencies": {
1621
"demo": "file:./demo"
1722
},
1823
"devDependencies": {
24+
"npm-run-all": "^4.1.5",
1925
"visyn_scripts": "file:../../"
2026
}
2127
}

0 commit comments

Comments
 (0)