From 38904081f6641488b2e74c99b8f4c46e69c5ed34 Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Wed, 8 May 2024 18:38:46 +0200 Subject: [PATCH 1/8] :truck: - Move tests into own folder --- .github/workflows/test.yml | 2 +- README.md | 2 +- benches/base_bench.rs | 8 ++++---- tests/compile.sh | 4 ++-- tests/lock.sh | 2 +- tests/suffix.sh | 2 +- tests/suite-ci.sh | 8 ++++---- {testrepo => tests/testrepo_yarn}/.gitignore | 0 .../testrepo_yarn}/bsconfig.json | 18 +++++++++--------- {testrepo => tests/testrepo_yarn}/package.json | 2 +- .../testrepo_yarn}/packages/dep01/README.md | 0 .../packages/dep01}/bsconfig.json | 4 ++-- .../testrepo_yarn}/packages/dep01/package.json | 4 ++-- .../packages/dep01/src/Demo.bs.js | 0 .../packages/dep01/src/Dep01.mjs | 2 +- .../packages/dep01/src/Dep01.res | 0 .../testrepo_yarn}/packages/dep02/README.md | 0 .../packages/dep02}/bsconfig.json | 4 ++-- .../testrepo_yarn}/packages/dep02/package.json | 2 +- .../packages/dep02/src/Array.mjs | 0 .../packages/dep02/src/Array.res | 0 .../packages/dep02/src/Dep02.mjs | 2 +- .../packages/dep02/src/Dep02.res | 0 .../testrepo_yarn}/packages/main/README.md | 0 .../testrepo_yarn}/packages/main/bsconfig.json | 4 ++-- .../testrepo_yarn}/packages/main/package.json | 4 ++-- .../packages/main/src/Demo.bs.js | 0 .../testrepo_yarn}/packages/main/src/Main.mjs | 2 +- .../testrepo_yarn}/packages/main/src/Main.res | 0 .../packages/main/src/ModuleWithInterface.mjs | 0 .../packages/main/src/ModuleWithInterface.res | 0 .../packages/main/src/ModuleWithInterface.resi | 0 .../packages/main/src/output.txt | 0 .../packages/new-namespace/bsconfig.json | 4 ++-- .../packages/new-namespace/package.json | 2 +- .../packages/new-namespace/src/NS.mjs | 0 .../packages/new-namespace/src/NS.res | 0 .../packages/new-namespace/src/NS_alias.mjs | 0 .../packages/new-namespace/src/NS_alias.res | 0 .../new-namespace/src/Other_module.mjs | 0 .../new-namespace/src/Other_module.res | 0 {testrepo => tests/testrepo_yarn}/src/Test.mjs | 0 {testrepo => tests/testrepo_yarn}/src/Test.res | 0 {testrepo => tests/testrepo_yarn}/yarn.lock | 0 tests/watch.sh | 2 +- 45 files changed, 42 insertions(+), 42 deletions(-) rename {testrepo => tests/testrepo_yarn}/.gitignore (100%) rename {testrepo => tests/testrepo_yarn}/bsconfig.json (53%) rename {testrepo => tests/testrepo_yarn}/package.json (94%) rename {testrepo => tests/testrepo_yarn}/packages/dep01/README.md (100%) rename {testrepo/packages/dep02 => tests/testrepo_yarn/packages/dep01}/bsconfig.json (65%) rename {testrepo => tests/testrepo_yarn}/packages/dep01/package.json (79%) rename {testrepo => tests/testrepo_yarn}/packages/dep01/src/Demo.bs.js (100%) rename {testrepo => tests/testrepo_yarn}/packages/dep01/src/Dep01.mjs (71%) rename {testrepo => tests/testrepo_yarn}/packages/dep01/src/Dep01.res (100%) rename {testrepo => tests/testrepo_yarn}/packages/dep02/README.md (100%) rename {testrepo/packages/dep01 => tests/testrepo_yarn/packages/dep02}/bsconfig.json (63%) rename {testrepo => tests/testrepo_yarn}/packages/dep02/package.json (88%) rename {testrepo => tests/testrepo_yarn}/packages/dep02/src/Array.mjs (100%) rename {testrepo => tests/testrepo_yarn}/packages/dep02/src/Array.res (100%) rename {testrepo => tests/testrepo_yarn}/packages/dep02/src/Dep02.mjs (78%) rename {testrepo => tests/testrepo_yarn}/packages/dep02/src/Dep02.res (100%) rename {testrepo => tests/testrepo_yarn}/packages/main/README.md (100%) rename {testrepo => tests/testrepo_yarn}/packages/main/bsconfig.json (73%) rename {testrepo => tests/testrepo_yarn}/packages/main/package.json (79%) rename {testrepo => tests/testrepo_yarn}/packages/main/src/Demo.bs.js (100%) rename {testrepo => tests/testrepo_yarn}/packages/main/src/Main.mjs (74%) rename {testrepo => tests/testrepo_yarn}/packages/main/src/Main.res (100%) rename {testrepo => tests/testrepo_yarn}/packages/main/src/ModuleWithInterface.mjs (100%) rename {testrepo => tests/testrepo_yarn}/packages/main/src/ModuleWithInterface.res (100%) rename {testrepo => tests/testrepo_yarn}/packages/main/src/ModuleWithInterface.resi (100%) rename {testrepo => tests/testrepo_yarn}/packages/main/src/output.txt (100%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/bsconfig.json (70%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/package.json (77%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/src/NS.mjs (100%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/src/NS.res (100%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/src/NS_alias.mjs (100%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/src/NS_alias.res (100%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/src/Other_module.mjs (100%) rename {testrepo => tests/testrepo_yarn}/packages/new-namespace/src/Other_module.res (100%) rename {testrepo => tests/testrepo_yarn}/src/Test.mjs (100%) rename {testrepo => tests/testrepo_yarn}/src/Test.res (100%) rename {testrepo => tests/testrepo_yarn}/yarn.lock (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 67e02fd..3f30072 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,6 @@ jobs: - name: Run unit test run: cargo test - name: Install Yarn Dependencies - run: cd ./testrepo && yarn install + run: cd ./tests/testrepo && yarn install - name: Run Test run: ./tests/suite-ci.sh diff --git a/README.md b/README.md index f0c4b72..a1fe365 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Options: - [NodeJS](https://nodejs.org/en/) - For running testscripts only - [Yarn](https://yarnpkg.com/) or [Npm](https://www.npmjs.com/) - Npm probably comes with your node installation - 1. `cd testrepo && yarn` (install dependencies for submodule) + 1. `cd testrepo_yarn && yarn` (install dependencies for submodule) 2. `cargo run` Running tests: diff --git a/benches/base_bench.rs b/benches/base_bench.rs index 8b781a0..f5c4051 100644 --- a/benches/base_bench.rs +++ b/benches/base_bench.rs @@ -9,7 +9,7 @@ use std::io::prelude::*; fn criterion_benchmark(c: &mut Criterion) { c.bench_function("build-package-tree", |b| { - // Folder for the testrepo + // Folder for the testrepo_yarn let folder = "walnut_monorepo"; let project_root = helpers::get_abs_path(folder); @@ -19,9 +19,9 @@ fn criterion_benchmark(c: &mut Criterion) { }); c.bench_function("clean-build-change-build", |b| { - // Folder for the testrepo - let folder = "testrepo"; - let filename = "testrepo/packages/dep02/src/Dep02.res"; + // Folder for the testrepo_yarn + let folder = "testrepo_yarn"; + let filename = "testrepo_yarn/packages/dep02/src/Dep02.res"; // Clean the build clean::clean(folder); // Read the file we'll be mutating diff --git a/tests/compile.sh b/tests/compile.sh index 2b7173e..1b36bfb 100755 --- a/tests/compile.sh +++ b/tests/compile.sh @@ -1,7 +1,7 @@ #!/bin/bash cd $(dirname $0) source "./utils.sh" -cd ../testrepo +cd ../testrepo_yarn bold "Test: It should compile" @@ -24,7 +24,7 @@ fi if git diff --exit-code ./; then - success "Testrepo has no changes" + success "testrepo_yarn has no changes" else error "Build has changed" exit 1 diff --git a/tests/lock.sh b/tests/lock.sh index 65d48cb..c84093f 100755 --- a/tests/lock.sh +++ b/tests/lock.sh @@ -1,5 +1,5 @@ source "./utils.sh" -cd ../testrepo +cd ../testrepo_yarn bold "Test: It should lock - when watching" diff --git a/tests/suffix.sh b/tests/suffix.sh index a7fe978..24cdd7f 100755 --- a/tests/suffix.sh +++ b/tests/suffix.sh @@ -1,5 +1,5 @@ source "./utils.sh" -cd ../testrepo +cd ../testrepo_yarn bold "Test: It should support custom suffixes" diff --git a/tests/suite-ci.sh b/tests/suite-ci.sh index bcec567..3ee7168 100755 --- a/tests/suite-ci.sh +++ b/tests/suite-ci.sh @@ -13,12 +13,12 @@ else exit 1 fi -bold "Make sure the testrepo is clean" -if git diff --exit-code ../testrepo &> /dev/null; +bold "Make sure the testrepo_yarn is clean" +if git diff --exit-code ../testrepo_yarn &> /dev/null; then - success "Testrepo has no changes" + success "testrepo_yarn has no changes" else - error "Testrepo is not clean to start with" + error "testrepo_yarn is not clean to start with" exit 1 fi diff --git a/testrepo/.gitignore b/tests/testrepo_yarn/.gitignore similarity index 100% rename from testrepo/.gitignore rename to tests/testrepo_yarn/.gitignore diff --git a/testrepo/bsconfig.json b/tests/testrepo_yarn/bsconfig.json similarity index 53% rename from testrepo/bsconfig.json rename to tests/testrepo_yarn/bsconfig.json index 53fc846..f53e97a 100644 --- a/testrepo/bsconfig.json +++ b/tests/testrepo_yarn/bsconfig.json @@ -1,5 +1,5 @@ { - "name": "testrepo", + "name": "testrepo_yarn", "sources": { "dir": "src", "subdirs": true @@ -15,16 +15,16 @@ }, "suffix": ".mjs", "pinned-dependencies": [ - "@testrepo/main", - "@testrepo/dep01", - "@testrepo/dep02", - "@testrepo/new-namespace" + "@testrepo_yarn/main", + "@testrepo_yarn/dep01", + "@testrepo_yarn/dep02", + "@testrepo_yarn/new-namespace" ], "bs-dependencies": [ - "@testrepo/main", - "@testrepo/dep01", - "@testrepo/dep02", - "@testrepo/new-namespace" + "@testrepo_yarn/main", + "@testrepo_yarn/dep01", + "@testrepo_yarn/dep02", + "@testrepo_yarn/new-namespace" ], "reason": { "react-jsx": 3 diff --git a/testrepo/package.json b/tests/testrepo_yarn/package.json similarity index 94% rename from testrepo/package.json rename to tests/testrepo_yarn/package.json index ae81646..a331960 100644 --- a/testrepo/package.json +++ b/tests/testrepo_yarn/package.json @@ -1,5 +1,5 @@ { - "name": "testrepo", + "name": "testrepo_yarn", "private": true, "workspaces": { "packages": [ diff --git a/testrepo/packages/dep01/README.md b/tests/testrepo_yarn/packages/dep01/README.md similarity index 100% rename from testrepo/packages/dep01/README.md rename to tests/testrepo_yarn/packages/dep01/README.md diff --git a/testrepo/packages/dep02/bsconfig.json b/tests/testrepo_yarn/packages/dep01/bsconfig.json similarity index 65% rename from testrepo/packages/dep02/bsconfig.json rename to tests/testrepo_yarn/packages/dep01/bsconfig.json index 0355169..6ecfd27 100644 --- a/testrepo/packages/dep02/bsconfig.json +++ b/tests/testrepo_yarn/packages/dep01/bsconfig.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/dep02", + "name": "@testrepo_yarn/dep01", "sources": { "dir": "src", "subdirs": true @@ -9,5 +9,5 @@ "in-source": true }, "suffix": ".bs.js", - "bs-dependencies": ["@testrepo/new-namespace"] + "bs-dependencies": ["@testrepo_yarn/dep02"] } diff --git a/testrepo/packages/dep01/package.json b/tests/testrepo_yarn/packages/dep01/package.json similarity index 79% rename from testrepo/packages/dep01/package.json rename to tests/testrepo_yarn/packages/dep01/package.json index e60d809..e53c7d6 100644 --- a/testrepo/packages/dep01/package.json +++ b/tests/testrepo_yarn/packages/dep01/package.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/dep01", + "name": "@testrepo_yarn/dep01", "version": "0.0.1", "scripts": { "res:build": "rescript", @@ -12,7 +12,7 @@ "author": "", "license": "MIT", "dependencies": { - "@testrepo/dep02": "*", + "@testrepo_yarn/dep02": "*", "rescript": "*" } } diff --git a/testrepo/packages/dep01/src/Demo.bs.js b/tests/testrepo_yarn/packages/dep01/src/Demo.bs.js similarity index 100% rename from testrepo/packages/dep01/src/Demo.bs.js rename to tests/testrepo_yarn/packages/dep01/src/Demo.bs.js diff --git a/testrepo/packages/dep01/src/Dep01.mjs b/tests/testrepo_yarn/packages/dep01/src/Dep01.mjs similarity index 71% rename from testrepo/packages/dep01/src/Dep01.mjs rename to tests/testrepo_yarn/packages/dep01/src/Dep01.mjs index 97bd864..6bea24f 100644 --- a/testrepo/packages/dep01/src/Dep01.mjs +++ b/tests/testrepo_yarn/packages/dep01/src/Dep01.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Dep02 from "@testrepo/dep02/src/Dep02.mjs"; +import * as Dep02 from "@testrepo_yarn/dep02/src/Dep02.mjs"; function log() { console.log("02"); diff --git a/testrepo/packages/dep01/src/Dep01.res b/tests/testrepo_yarn/packages/dep01/src/Dep01.res similarity index 100% rename from testrepo/packages/dep01/src/Dep01.res rename to tests/testrepo_yarn/packages/dep01/src/Dep01.res diff --git a/testrepo/packages/dep02/README.md b/tests/testrepo_yarn/packages/dep02/README.md similarity index 100% rename from testrepo/packages/dep02/README.md rename to tests/testrepo_yarn/packages/dep02/README.md diff --git a/testrepo/packages/dep01/bsconfig.json b/tests/testrepo_yarn/packages/dep02/bsconfig.json similarity index 63% rename from testrepo/packages/dep01/bsconfig.json rename to tests/testrepo_yarn/packages/dep02/bsconfig.json index 106a46f..203c306 100644 --- a/testrepo/packages/dep01/bsconfig.json +++ b/tests/testrepo_yarn/packages/dep02/bsconfig.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/dep01", + "name": "@testrepo_yarn/dep02", "sources": { "dir": "src", "subdirs": true @@ -9,5 +9,5 @@ "in-source": true }, "suffix": ".bs.js", - "bs-dependencies": ["@testrepo/dep02"] + "bs-dependencies": ["@testrepo_yarn/new-namespace"] } diff --git a/testrepo/packages/dep02/package.json b/tests/testrepo_yarn/packages/dep02/package.json similarity index 88% rename from testrepo/packages/dep02/package.json rename to tests/testrepo_yarn/packages/dep02/package.json index 8dc05ab..a57034a 100644 --- a/testrepo/packages/dep02/package.json +++ b/tests/testrepo_yarn/packages/dep02/package.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/dep02", + "name": "@testrepo_yarn/dep02", "version": "0.0.1", "scripts": { "res:build": "rescript", diff --git a/testrepo/packages/dep02/src/Array.mjs b/tests/testrepo_yarn/packages/dep02/src/Array.mjs similarity index 100% rename from testrepo/packages/dep02/src/Array.mjs rename to tests/testrepo_yarn/packages/dep02/src/Array.mjs diff --git a/testrepo/packages/dep02/src/Array.res b/tests/testrepo_yarn/packages/dep02/src/Array.res similarity index 100% rename from testrepo/packages/dep02/src/Array.res rename to tests/testrepo_yarn/packages/dep02/src/Array.res diff --git a/testrepo/packages/dep02/src/Dep02.mjs b/tests/testrepo_yarn/packages/dep02/src/Dep02.mjs similarity index 78% rename from testrepo/packages/dep02/src/Dep02.mjs rename to tests/testrepo_yarn/packages/dep02/src/Dep02.mjs index 86cea08..a4ca914 100644 --- a/testrepo/packages/dep02/src/Dep02.mjs +++ b/tests/testrepo_yarn/packages/dep02/src/Dep02.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as $$Array from "./Array.mjs"; -import * as NS_alias$$atNewNamespace from "@testrepo/new-namespace/src/NS_alias.mjs"; +import * as NS_alias$$atNewNamespace from "@testrepo_yarn/new-namespace/src/NS_alias.mjs"; function log() { $$Array.forEach([ diff --git a/testrepo/packages/dep02/src/Dep02.res b/tests/testrepo_yarn/packages/dep02/src/Dep02.res similarity index 100% rename from testrepo/packages/dep02/src/Dep02.res rename to tests/testrepo_yarn/packages/dep02/src/Dep02.res diff --git a/testrepo/packages/main/README.md b/tests/testrepo_yarn/packages/main/README.md similarity index 100% rename from testrepo/packages/main/README.md rename to tests/testrepo_yarn/packages/main/README.md diff --git a/testrepo/packages/main/bsconfig.json b/tests/testrepo_yarn/packages/main/bsconfig.json similarity index 73% rename from testrepo/packages/main/bsconfig.json rename to tests/testrepo_yarn/packages/main/bsconfig.json index f169104..27d928d 100644 --- a/testrepo/packages/main/bsconfig.json +++ b/tests/testrepo_yarn/packages/main/bsconfig.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/main", + "name": "@testrepo_yarn/main", "sources": { "dir": "src", "subdirs": true @@ -10,6 +10,6 @@ }, "suffix": ".bs.js", "bs-dependencies": [ - "@testrepo/dep01" + "@testrepo_yarn/dep01" ] } diff --git a/testrepo/packages/main/package.json b/tests/testrepo_yarn/packages/main/package.json similarity index 79% rename from testrepo/packages/main/package.json rename to tests/testrepo_yarn/packages/main/package.json index 5bf3dca..1d49ba8 100644 --- a/testrepo/packages/main/package.json +++ b/tests/testrepo_yarn/packages/main/package.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/main", + "name": "@testrepo_yarn/main", "version": "0.0.1", "scripts": { "res:build": "rescript", @@ -12,7 +12,7 @@ "author": "", "license": "MIT", "dependencies": { - "@testrepo/dep01": "*", + "@testrepo_yarn/dep01": "*", "rescript": "*" } } diff --git a/testrepo/packages/main/src/Demo.bs.js b/tests/testrepo_yarn/packages/main/src/Demo.bs.js similarity index 100% rename from testrepo/packages/main/src/Demo.bs.js rename to tests/testrepo_yarn/packages/main/src/Demo.bs.js diff --git a/testrepo/packages/main/src/Main.mjs b/tests/testrepo_yarn/packages/main/src/Main.mjs similarity index 74% rename from testrepo/packages/main/src/Main.mjs rename to tests/testrepo_yarn/packages/main/src/Main.mjs index 887a8e6..399a38b 100644 --- a/testrepo/packages/main/src/Main.mjs +++ b/tests/testrepo_yarn/packages/main/src/Main.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Dep01 from "@testrepo/dep01/src/Dep01.mjs"; +import * as Dep01 from "@testrepo_yarn/dep01/src/Dep01.mjs"; console.log("01"); diff --git a/testrepo/packages/main/src/Main.res b/tests/testrepo_yarn/packages/main/src/Main.res similarity index 100% rename from testrepo/packages/main/src/Main.res rename to tests/testrepo_yarn/packages/main/src/Main.res diff --git a/testrepo/packages/main/src/ModuleWithInterface.mjs b/tests/testrepo_yarn/packages/main/src/ModuleWithInterface.mjs similarity index 100% rename from testrepo/packages/main/src/ModuleWithInterface.mjs rename to tests/testrepo_yarn/packages/main/src/ModuleWithInterface.mjs diff --git a/testrepo/packages/main/src/ModuleWithInterface.res b/tests/testrepo_yarn/packages/main/src/ModuleWithInterface.res similarity index 100% rename from testrepo/packages/main/src/ModuleWithInterface.res rename to tests/testrepo_yarn/packages/main/src/ModuleWithInterface.res diff --git a/testrepo/packages/main/src/ModuleWithInterface.resi b/tests/testrepo_yarn/packages/main/src/ModuleWithInterface.resi similarity index 100% rename from testrepo/packages/main/src/ModuleWithInterface.resi rename to tests/testrepo_yarn/packages/main/src/ModuleWithInterface.resi diff --git a/testrepo/packages/main/src/output.txt b/tests/testrepo_yarn/packages/main/src/output.txt similarity index 100% rename from testrepo/packages/main/src/output.txt rename to tests/testrepo_yarn/packages/main/src/output.txt diff --git a/testrepo/packages/new-namespace/bsconfig.json b/tests/testrepo_yarn/packages/new-namespace/bsconfig.json similarity index 70% rename from testrepo/packages/new-namespace/bsconfig.json rename to tests/testrepo_yarn/packages/new-namespace/bsconfig.json index 3b796b9..4341b95 100644 --- a/testrepo/packages/new-namespace/bsconfig.json +++ b/tests/testrepo_yarn/packages/new-namespace/bsconfig.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/new-namespace", + "name": "@testrepo_yarn/new-namespace", "namespace": "NewNamespace", "namespace-entry": "NS", "sources": { @@ -10,6 +10,6 @@ "module": "es6", "in-source": true }, - "bs-dependencies": ["@testrepo/dep01"], + "bs-dependencies": ["@testrepo_yarn/dep01"], "suffix": ".bs.js" } diff --git a/testrepo/packages/new-namespace/package.json b/tests/testrepo_yarn/packages/new-namespace/package.json similarity index 77% rename from testrepo/packages/new-namespace/package.json rename to tests/testrepo_yarn/packages/new-namespace/package.json index 1fb4e26..0c01062 100644 --- a/testrepo/packages/new-namespace/package.json +++ b/tests/testrepo_yarn/packages/new-namespace/package.json @@ -1,5 +1,5 @@ { - "name": "@testrepo/new-namespace", + "name": "@testrepo_yarn/new-namespace", "version": "0.0.1", "keywords": [ "rescript" diff --git a/testrepo/packages/new-namespace/src/NS.mjs b/tests/testrepo_yarn/packages/new-namespace/src/NS.mjs similarity index 100% rename from testrepo/packages/new-namespace/src/NS.mjs rename to tests/testrepo_yarn/packages/new-namespace/src/NS.mjs diff --git a/testrepo/packages/new-namespace/src/NS.res b/tests/testrepo_yarn/packages/new-namespace/src/NS.res similarity index 100% rename from testrepo/packages/new-namespace/src/NS.res rename to tests/testrepo_yarn/packages/new-namespace/src/NS.res diff --git a/testrepo/packages/new-namespace/src/NS_alias.mjs b/tests/testrepo_yarn/packages/new-namespace/src/NS_alias.mjs similarity index 100% rename from testrepo/packages/new-namespace/src/NS_alias.mjs rename to tests/testrepo_yarn/packages/new-namespace/src/NS_alias.mjs diff --git a/testrepo/packages/new-namespace/src/NS_alias.res b/tests/testrepo_yarn/packages/new-namespace/src/NS_alias.res similarity index 100% rename from testrepo/packages/new-namespace/src/NS_alias.res rename to tests/testrepo_yarn/packages/new-namespace/src/NS_alias.res diff --git a/testrepo/packages/new-namespace/src/Other_module.mjs b/tests/testrepo_yarn/packages/new-namespace/src/Other_module.mjs similarity index 100% rename from testrepo/packages/new-namespace/src/Other_module.mjs rename to tests/testrepo_yarn/packages/new-namespace/src/Other_module.mjs diff --git a/testrepo/packages/new-namespace/src/Other_module.res b/tests/testrepo_yarn/packages/new-namespace/src/Other_module.res similarity index 100% rename from testrepo/packages/new-namespace/src/Other_module.res rename to tests/testrepo_yarn/packages/new-namespace/src/Other_module.res diff --git a/testrepo/src/Test.mjs b/tests/testrepo_yarn/src/Test.mjs similarity index 100% rename from testrepo/src/Test.mjs rename to tests/testrepo_yarn/src/Test.mjs diff --git a/testrepo/src/Test.res b/tests/testrepo_yarn/src/Test.res similarity index 100% rename from testrepo/src/Test.res rename to tests/testrepo_yarn/src/Test.res diff --git a/testrepo/yarn.lock b/tests/testrepo_yarn/yarn.lock similarity index 100% rename from testrepo/yarn.lock rename to tests/testrepo_yarn/yarn.lock diff --git a/tests/watch.sh b/tests/watch.sh index 20546d8..2316d1e 100755 --- a/tests/watch.sh +++ b/tests/watch.sh @@ -1,5 +1,5 @@ source "./utils.sh" -cd ../testrepo +cd ../testrepo_yarn bold "Test: It should watch" From e5e1147bad9a371e5f3e6168f641064c07549279 Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Wed, 8 May 2024 18:45:59 +0200 Subject: [PATCH 2/8] :white_check_mark: - Update tests to work with the new path --- tests/compile.sh | 28 ++++++++++++++-------------- tests/lib/rewatch.lock | 2 +- tests/lock.sh | 4 ++-- tests/suffix.sh | 2 +- tests/suite-ci.sh | 2 +- tests/utils.sh | 2 +- tests/watch.sh | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/compile.sh b/tests/compile.sh index 1b36bfb..e9c7b57 100755 --- a/tests/compile.sh +++ b/tests/compile.sh @@ -1,7 +1,7 @@ #!/bin/bash -cd $(dirname $0) +cd $(dirname $0) || exit source "./utils.sh" -cd ../testrepo_yarn +cd ./testrepo_yarn || exit bold "Test: It should compile" @@ -13,7 +13,7 @@ else exit 1 fi -if rewatch &> /dev/null; +if rewatch build &> /dev/null then success "Repo Built" else @@ -33,29 +33,29 @@ fi node ./packages/main/src/Main.mjs > ./packages/main/src/output.txt mv ./packages/main/src/Main.res ./packages/main/src/Main2.res -rewatch build --no-timing=true &> ../tests/snapshots/rename-file.txt +rewatch build --no-timing=true &> ../snapshots/rename-file.txt mv ./packages/main/src/Main2.res ./packages/main/src/Main.res rewatch build &> /dev/null mv ./packages/main/src/ModuleWithInterface.resi ./packages/main/src/ModuleWithInterface2.resi -rewatch build --no-timing=true &> ../tests/snapshots/rename-interface-file.txt +rewatch build --no-timing=true &> ../snapshots/rename-interface-file.txt mv ./packages/main/src/ModuleWithInterface2.resi ./packages/main/src/ModuleWithInterface.resi rewatch build &> /dev/null mv ./packages/main/src/ModuleWithInterface.res ./packages/main/src/ModuleWithInterface2.res -rewatch build --no-timing=true &> ../tests/snapshots/rename-file-with-interface.txt +rewatch build --no-timing=true &> ../snapshots/rename-file-with-interface.txt mv ./packages/main/src/ModuleWithInterface2.res ./packages/main/src/ModuleWithInterface.res rewatch build &> /dev/null # when deleting a file that other files depend on, the compile should fail rm packages/dep02/src/Dep02.res -rewatch build --no-timing=true &> ../tests/snapshots/remove-file.txt +rewatch build --no-timing=true &> ../snapshots/remove-file.txt # replace the absolute path so the snapshot is the same on all machines -replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../tests/snapshots/remove-file.txt +replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../snapshots/remove-file.txt git checkout -- packages/dep02/src/Dep02.res rewatch build &> /dev/null # it should show an error when we have a dependency cycle echo 'Dep01.log()' >> packages/new-namespace/src/NS_alias.res -rewatch build --no-timing=true &> ../tests/snapshots/dependency-cycle.txt +rewatch build --no-timing=true &> ../snapshots/dependency-cycle.txt git checkout -- packages/new-namespace/src/NS_alias.res rewatch build &> /dev/null @@ -88,8 +88,8 @@ else fi # see if the snapshots have changed -changed_snapshots=$(git ls-files --modified ../tests/snapshots) -if git diff --exit-code ../tests/snapshots &> /dev/null; +changed_snapshots=$(git ls-files --modified ../snapshots) +if git diff --exit-code ../snapshots &> /dev/null; then success "Snapshots are correct" else @@ -98,11 +98,11 @@ else # and then cat their contents printf "\n\n" for file in $changed_snapshots; do - bold $file + bold "$file" # show diff of file vs contents in git - git diff $file $file + git diff "$file" "$file" printf "\n\n" done exit 1 -fi \ No newline at end of file +fi diff --git a/tests/lib/rewatch.lock b/tests/lib/rewatch.lock index da27e6c..60341df 100644 --- a/tests/lib/rewatch.lock +++ b/tests/lib/rewatch.lock @@ -1 +1 @@ -57150 \ No newline at end of file +80735 \ No newline at end of file diff --git a/tests/lock.sh b/tests/lock.sh index c84093f..dd2dd10 100755 --- a/tests/lock.sh +++ b/tests/lock.sh @@ -1,5 +1,5 @@ source "./utils.sh" -cd ../testrepo_yarn +cd ./testrepo_yarn || exit bold "Test: It should lock - when watching" @@ -41,7 +41,7 @@ success "Watcher Started" sleep 1 -if cat tmp.txt | grep 'Error while trying to get lock:' &> /dev/null; +if grep 'Error while trying to get lock:' tmp.txt &> /dev/null; then error "Lock not removed correctly" exit_watcher diff --git a/tests/suffix.sh b/tests/suffix.sh index 24cdd7f..39fd794 100755 --- a/tests/suffix.sh +++ b/tests/suffix.sh @@ -1,5 +1,5 @@ source "./utils.sh" -cd ../testrepo_yarn +cd ./testrepo_yarn bold "Test: It should support custom suffixes" diff --git a/tests/suite-ci.sh b/tests/suite-ci.sh index 3ee7168..ad9b8e9 100755 --- a/tests/suite-ci.sh +++ b/tests/suite-ci.sh @@ -14,7 +14,7 @@ else fi bold "Make sure the testrepo_yarn is clean" -if git diff --exit-code ../testrepo_yarn &> /dev/null; +if git diff --exit-code ./testrepo_yarn &> /dev/null; then success "testrepo_yarn has no changes" else diff --git a/tests/utils.sh b/tests/utils.sh index 3f6218d..ef7b5a3 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -3,7 +3,7 @@ overwrite() { echo -e "\r\033[1A\033[0K$@"; } success() { echo -e "- โœ… \033[32m$1\033[0m"; } error() { echo -e "- ๐Ÿ›‘ \033[31m$1\033[0m"; } bold() { echo -e "\033[1m$1\033[0m"; } -rewatch() { RUST_BACKTRACE=1 ../target/release/rewatch --no-timing=true $1; } +rewatch() { RUST_BACKTRACE=1 ../../target/release/rewatch --no-timing=true "$1"; } replace() { if [[ $OSTYPE == 'darwin'* ]]; diff --git a/tests/watch.sh b/tests/watch.sh index 2316d1e..79c276c 100755 --- a/tests/watch.sh +++ b/tests/watch.sh @@ -1,5 +1,5 @@ source "./utils.sh" -cd ../testrepo_yarn +cd ./testrepo_yarn || exit bold "Test: It should watch" @@ -47,4 +47,4 @@ else exit 1 fi -exit_watcher \ No newline at end of file +exit_watcher From 4738d2b37c1152a97d4fbe1a1dd31e551275b746 Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Wed, 8 May 2024 18:55:41 +0200 Subject: [PATCH 3/8] :white_check_mark: - Parameterize Folder --- tests/compile.sh | 7 ++++--- tests/lib/rewatch.lock | 2 +- tests/lock.sh | 7 ++++--- tests/suffix.sh | 7 +++++-- tests/suite-ci.sh | 5 ++++- tests/suite.sh | 1 + tests/watch.sh | 6 +++++- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/tests/compile.sh b/tests/compile.sh index e9c7b57..51a3109 100755 --- a/tests/compile.sh +++ b/tests/compile.sh @@ -1,11 +1,12 @@ #!/bin/bash -cd $(dirname $0) || exit + +cd $(dirname $0) source "./utils.sh" -cd ./testrepo_yarn || exit +cd "$1" || exit bold "Test: It should compile" -if rewatch clean &> /dev/null; +if rewatch clean then success "Repo Cleaned" else diff --git a/tests/lib/rewatch.lock b/tests/lib/rewatch.lock index 60341df..d77f243 100644 --- a/tests/lib/rewatch.lock +++ b/tests/lib/rewatch.lock @@ -1 +1 @@ -80735 \ No newline at end of file +89511 \ No newline at end of file diff --git a/tests/lock.sh b/tests/lock.sh index dd2dd10..9f5bb11 100755 --- a/tests/lock.sh +++ b/tests/lock.sh @@ -1,10 +1,11 @@ +#!/bin/bash + +cd $(dirname $0) source "./utils.sh" -cd ./testrepo_yarn || exit +cd "$1" || exit bold "Test: It should lock - when watching" -sleep 1 - if rewatch clean &> /dev/null; then success "Repo Cleaned" diff --git a/tests/suffix.sh b/tests/suffix.sh index 39fd794..15f6449 100755 --- a/tests/suffix.sh +++ b/tests/suffix.sh @@ -1,10 +1,13 @@ +#!/bin/bash + +cd $(dirname $0) source "./utils.sh" -cd ./testrepo_yarn +cd "$1" || exit +source "./utils.sh" bold "Test: It should support custom suffixes" # Clean Repo -sleep 1 if rewatch clean &> /dev/null; then success "Repo Cleaned" diff --git a/tests/suite-ci.sh b/tests/suite-ci.sh index ad9b8e9..9654393 100755 --- a/tests/suite-ci.sh +++ b/tests/suite-ci.sh @@ -22,4 +22,7 @@ else exit 1 fi -./compile.sh && ./watch.sh && ./lock.sh && ./suffix.sh +./compile.sh "testrepo_yarn" \ + && ../watch.sh "testrepo_yarn" \ + && ../lock.sh "testrepo_yarn" \ + && ../suffix.sh "testrepo_yarn" diff --git a/tests/suite.sh b/tests/suite.sh index 8241a09..497f5ff 100755 --- a/tests/suite.sh +++ b/tests/suite.sh @@ -1,3 +1,4 @@ #!/bin/bash +# cd $(dirname $0) ./suite-ci.sh diff --git a/tests/watch.sh b/tests/watch.sh index 79c276c..2e512ee 100755 --- a/tests/watch.sh +++ b/tests/watch.sh @@ -1,6 +1,10 @@ +#!/bin/bash + +cd $(dirname $0) source "./utils.sh" -cd ./testrepo_yarn || exit +cd "$1" || exit +source "./utils.sh" bold "Test: It should watch" if rewatch clean &> /dev/null; From 4d8ea205c80ff827fde3511785db168decca6223 Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Wed, 8 May 2024 18:58:47 +0200 Subject: [PATCH 4/8] :white_check_mark: - Add PNPM test files --- .github/workflows/test.yml | 4 +- tests/suite-ci.sh | 14 + tests/testrepo_pnpm/.gitignore | 11 + tests/testrepo_pnpm/bsconfig.json | 32 + tests/testrepo_pnpm/package.json | 20 + tests/testrepo_pnpm/packages/dep01/README.md | 21 + .../packages/dep01/bsconfig.json | 13 + .../testrepo_pnpm/packages/dep01/package.json | 18 + .../packages/dep01/src/Demo.bs.js | 7 + .../packages/dep01/src/Dep01.mjs | 13 + .../packages/dep01/src/Dep01.res | 4 + tests/testrepo_pnpm/packages/dep02/README.md | 21 + .../packages/dep02/bsconfig.json | 13 + .../testrepo_pnpm/packages/dep02/package.json | 17 + .../packages/dep02/src/Array.mjs | 555 ++++++++++++++++++ .../packages/dep02/src/Array.res | 176 ++++++ .../packages/dep02/src/Dep02.mjs | 20 + .../packages/dep02/src/Dep02.res | 3 + tests/testrepo_pnpm/packages/main/README.md | 21 + .../testrepo_pnpm/packages/main/bsconfig.json | 15 + .../testrepo_pnpm/packages/main/package.json | 18 + .../packages/main/src/Demo.bs.js | 7 + .../testrepo_pnpm/packages/main/src/Main.mjs | 17 + .../testrepo_pnpm/packages/main/src/Main.res | 5 + .../packages/main/src/ModuleWithInterface.mjs | 9 + .../packages/main/src/ModuleWithInterface.res | 2 + .../main/src/ModuleWithInterface.resi | 2 + .../packages/main/src/output.txt | 6 + .../packages/new-namespace/bsconfig.json | 15 + .../packages/new-namespace/package.json | 12 + .../packages/new-namespace/src/NS.mjs | 9 + .../packages/new-namespace/src/NS.res | 1 + .../packages/new-namespace/src/NS_alias.mjs | 14 + .../packages/new-namespace/src/NS_alias.res | 2 + .../new-namespace/src/Other_module.mjs | 11 + .../new-namespace/src/Other_module.res | 1 + tests/testrepo_pnpm/pnpm-lock.yaml | 75 +++ tests/testrepo_pnpm/pnpm-workspace.yaml | 2 + tests/testrepo_pnpm/src/Test.mjs | 9 + tests/testrepo_pnpm/src/Test.res | 1 + 40 files changed, 1215 insertions(+), 1 deletion(-) create mode 100644 tests/testrepo_pnpm/.gitignore create mode 100644 tests/testrepo_pnpm/bsconfig.json create mode 100644 tests/testrepo_pnpm/package.json create mode 100644 tests/testrepo_pnpm/packages/dep01/README.md create mode 100644 tests/testrepo_pnpm/packages/dep01/bsconfig.json create mode 100644 tests/testrepo_pnpm/packages/dep01/package.json create mode 100644 tests/testrepo_pnpm/packages/dep01/src/Demo.bs.js create mode 100644 tests/testrepo_pnpm/packages/dep01/src/Dep01.mjs create mode 100644 tests/testrepo_pnpm/packages/dep01/src/Dep01.res create mode 100644 tests/testrepo_pnpm/packages/dep02/README.md create mode 100644 tests/testrepo_pnpm/packages/dep02/bsconfig.json create mode 100644 tests/testrepo_pnpm/packages/dep02/package.json create mode 100644 tests/testrepo_pnpm/packages/dep02/src/Array.mjs create mode 100644 tests/testrepo_pnpm/packages/dep02/src/Array.res create mode 100644 tests/testrepo_pnpm/packages/dep02/src/Dep02.mjs create mode 100644 tests/testrepo_pnpm/packages/dep02/src/Dep02.res create mode 100644 tests/testrepo_pnpm/packages/main/README.md create mode 100644 tests/testrepo_pnpm/packages/main/bsconfig.json create mode 100644 tests/testrepo_pnpm/packages/main/package.json create mode 100644 tests/testrepo_pnpm/packages/main/src/Demo.bs.js create mode 100644 tests/testrepo_pnpm/packages/main/src/Main.mjs create mode 100644 tests/testrepo_pnpm/packages/main/src/Main.res create mode 100644 tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.mjs create mode 100644 tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.res create mode 100644 tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.resi create mode 100644 tests/testrepo_pnpm/packages/main/src/output.txt create mode 100644 tests/testrepo_pnpm/packages/new-namespace/bsconfig.json create mode 100644 tests/testrepo_pnpm/packages/new-namespace/package.json create mode 100644 tests/testrepo_pnpm/packages/new-namespace/src/NS.mjs create mode 100644 tests/testrepo_pnpm/packages/new-namespace/src/NS.res create mode 100644 tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.mjs create mode 100644 tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.res create mode 100644 tests/testrepo_pnpm/packages/new-namespace/src/Other_module.mjs create mode 100644 tests/testrepo_pnpm/packages/new-namespace/src/Other_module.res create mode 100644 tests/testrepo_pnpm/pnpm-lock.yaml create mode 100644 tests/testrepo_pnpm/pnpm-workspace.yaml create mode 100644 tests/testrepo_pnpm/src/Test.mjs create mode 100644 tests/testrepo_pnpm/src/Test.res diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f30072..312ebef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,8 @@ jobs: - name: Run unit test run: cargo test - name: Install Yarn Dependencies - run: cd ./tests/testrepo && yarn install + run: cd ./tests/testrepo_yarn && yarn install + - name: Install Pnpm Dependencies + run: cd ./tests/testrepo_pnpm && pnpm install - name: Run Test run: ./tests/suite-ci.sh diff --git a/tests/suite-ci.sh b/tests/suite-ci.sh index 9654393..aeb451c 100755 --- a/tests/suite-ci.sh +++ b/tests/suite-ci.sh @@ -22,7 +22,21 @@ else exit 1 fi +bold "Make sure the testrepo_pnpm is clean" +if git diff --exit-code ./testrepo_pnpm &> /dev/null; +then + success "testrepo_pnpm has no changes" +else + error "testrepo_pnpm is not clean to start with" + exit 1 +fi + ./compile.sh "testrepo_yarn" \ && ../watch.sh "testrepo_yarn" \ && ../lock.sh "testrepo_yarn" \ && ../suffix.sh "testrepo_yarn" + +./compile.sh "testrepo_pnpm" \ + && ../watch.sh "testrepo_pnpm" \ + && ../lock.sh "testrepo_pnpm" \ + && ../suffix.sh "testrepo_pnpm" diff --git a/tests/testrepo_pnpm/.gitignore b/tests/testrepo_pnpm/.gitignore new file mode 100644 index 0000000..687450d --- /dev/null +++ b/tests/testrepo_pnpm/.gitignore @@ -0,0 +1,11 @@ +.DS_Store +**/node_modules/ +**/lib/ +.bsb.lock +.merlin +.DS_Store +.cmi +.cmt +.cmj +.ast +.asti diff --git a/tests/testrepo_pnpm/bsconfig.json b/tests/testrepo_pnpm/bsconfig.json new file mode 100644 index 0000000..09022f2 --- /dev/null +++ b/tests/testrepo_pnpm/bsconfig.json @@ -0,0 +1,32 @@ +{ + "name": "testrepo_pnpm", + "sources": { + "dir": "src", + "subdirs": true + }, + "package-specs": [ + { + "module": "es6", + "in-source": true + } + ], + "warnings": { + "error": false + }, + "suffix": ".mjs", + "pinned-dependencies": [ + "@testrepo_pnpm/main", + "@testrepo_pnpm/dep01", + "@testrepo_pnpm/dep02", + "@testrepo_pnpm/new-namespace" + ], + "bs-dependencies": [ + "@testrepo_pnpm/main", + "@testrepo_pnpm/dep01", + "@testrepo_pnpm/dep02", + "@testrepo_pnpm/new-namespace" + ], + "reason": { + "react-jsx": 3 + } +} diff --git a/tests/testrepo_pnpm/package.json b/tests/testrepo_pnpm/package.json new file mode 100644 index 0000000..b31c154 --- /dev/null +++ b/tests/testrepo_pnpm/package.json @@ -0,0 +1,20 @@ +{ + "name": "testrepo_pnpm", + "private": true, + "scripts": { + "build": "../target/release/rewatch build .", + "build:rescript": "rescript build -with-deps", + "watch": "../target/release/rewatch watch .", + "watch:rescript": "rescript watch -with-deps", + "clean": "../target/release/rewatch clean .", + "clean:rescript": "rescript clean" + }, + "devDependencies": { + "@testrepo_pnpm/main": "workspace:*", + "@testrepo_pnpm/dep01": "workspace:*", + "@testrepo_pnpm/dep02": "workspace:*", + "@testrepo_pnpm/new-namespace": "workspace:*", + "@rolandpeelen/rewatch": "^1.0.1", + "rescript": "^11.1.0-rc.7" + } +} diff --git a/tests/testrepo_pnpm/packages/dep01/README.md b/tests/testrepo_pnpm/packages/dep01/README.md new file mode 100644 index 0000000..78ee1da --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep01/README.md @@ -0,0 +1,21 @@ +# ReScript Project Template + +The only official ReScript starter template. + +## Installation + +```sh +npm install +``` + +## Build + +- Build: `npm run res:build` +- Clean: `npm run res:clean` +- Build & watch: `npm run res:dev` + +## Run + +```sh +node src/Demo.bs.js +``` diff --git a/tests/testrepo_pnpm/packages/dep01/bsconfig.json b/tests/testrepo_pnpm/packages/dep01/bsconfig.json new file mode 100644 index 0000000..a2bf9c2 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep01/bsconfig.json @@ -0,0 +1,13 @@ +{ + "name": "@testrepo_pnpm/dep01", + "sources": { + "dir": "src", + "subdirs": true + }, + "package-specs": { + "module": "es6", + "in-source": true + }, + "suffix": ".bs.js", + "bs-dependencies": ["@testrepo_pnpm/dep02"] +} diff --git a/tests/testrepo_pnpm/packages/dep01/package.json b/tests/testrepo_pnpm/packages/dep01/package.json new file mode 100644 index 0000000..baebc29 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep01/package.json @@ -0,0 +1,18 @@ +{ + "name": "@testrepo_pnpm/dep01", + "version": "0.0.1", + "scripts": { + "res:build": "rescript", + "res:clean": "rescript clean", + "res:dev": "rescript build -w" + }, + "keywords": [ + "rescript" + ], + "author": "", + "license": "MIT", + "dependencies": { + "@testrepo_pnpm/dep02": "workspace:*", + "rescript": "*" + } +} diff --git a/tests/testrepo_pnpm/packages/dep01/src/Demo.bs.js b/tests/testrepo_pnpm/packages/dep01/src/Demo.bs.js new file mode 100644 index 0000000..7002a36 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep01/src/Demo.bs.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE +'use strict'; + + +console.log("Hello, World!"); + +/* Not a pure module */ diff --git a/tests/testrepo_pnpm/packages/dep01/src/Dep01.mjs b/tests/testrepo_pnpm/packages/dep01/src/Dep01.mjs new file mode 100644 index 0000000..6cd7d39 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep01/src/Dep01.mjs @@ -0,0 +1,13 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as Dep02 from "@testrepo_pnpm/dep02/src/Dep02.mjs"; + +function log() { + console.log("02"); + Dep02.log(); +} + +export { + log , +} +/* Dep02 Not a pure module */ diff --git a/tests/testrepo_pnpm/packages/dep01/src/Dep01.res b/tests/testrepo_pnpm/packages/dep01/src/Dep01.res new file mode 100644 index 0000000..f3b8414 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep01/src/Dep01.res @@ -0,0 +1,4 @@ +let log = () => { + Js.log("02") + Dep02.log() +} diff --git a/tests/testrepo_pnpm/packages/dep02/README.md b/tests/testrepo_pnpm/packages/dep02/README.md new file mode 100644 index 0000000..78ee1da --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep02/README.md @@ -0,0 +1,21 @@ +# ReScript Project Template + +The only official ReScript starter template. + +## Installation + +```sh +npm install +``` + +## Build + +- Build: `npm run res:build` +- Clean: `npm run res:clean` +- Build & watch: `npm run res:dev` + +## Run + +```sh +node src/Demo.bs.js +``` diff --git a/tests/testrepo_pnpm/packages/dep02/bsconfig.json b/tests/testrepo_pnpm/packages/dep02/bsconfig.json new file mode 100644 index 0000000..81bc3bd --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep02/bsconfig.json @@ -0,0 +1,13 @@ +{ + "name": "@testrepo_pnpm/dep02", + "sources": { + "dir": "src", + "subdirs": true + }, + "package-specs": { + "module": "es6", + "in-source": true + }, + "suffix": ".bs.js", + "bs-dependencies": ["@testrepo_pnpm/new-namespace"] +} diff --git a/tests/testrepo_pnpm/packages/dep02/package.json b/tests/testrepo_pnpm/packages/dep02/package.json new file mode 100644 index 0000000..225ecfe --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep02/package.json @@ -0,0 +1,17 @@ +{ + "name": "@testrepo_pnpm/dep02", + "version": "0.0.1", + "scripts": { + "res:build": "rescript", + "res:clean": "rescript clean", + "res:dev": "rescript build -w" + }, + "keywords": [ + "rescript" + ], + "author": "", + "license": "MIT", + "dependencies": { + "rescript": "*" + } +} diff --git a/tests/testrepo_pnpm/packages/dep02/src/Array.mjs b/tests/testrepo_pnpm/packages/dep02/src/Array.mjs new file mode 100644 index 0000000..8d4a3f1 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep02/src/Array.mjs @@ -0,0 +1,555 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as Curry from "rescript/lib/es6/curry.js"; +import * as Js_array from "rescript/lib/es6/js_array.js"; +import * as Belt_Array from "rescript/lib/es6/belt_Array.js"; +import * as Caml_option from "rescript/lib/es6/caml_option.js"; +import * as Belt_SortArray from "rescript/lib/es6/belt_SortArray.js"; + +function includes(prim0, prim1) { + return prim0.includes(prim1); +} + +function head(t) { + return Belt_Array.get(t, 0); +} + +function take(t, n) { + return Belt_Array.slice(t, 0, n); +} + +function last(t) { + return Belt_Array.get(t, t.length - 1 | 0); +} + +function isEmpty(t) { + return t.length === 0; +} + +function isNotEmpty(t) { + return t.length !== 0; +} + +function append(t, v) { + return Belt_Array.concat(t, [v]); +} + +function prepend(t, v) { + return Belt_Array.concat([v], t); +} + +function mapi(prim0, prim1) { + return prim0.map(Curry.__2(prim1)); +} + +function flatten(t) { + return Belt_Array.concatMany(Belt_Array.map(t, (function (x) { + return x; + }))); +} + +function find(t, fn) { + return Js_array.find(fn, t); +} + +function findIndex(t, fn) { + return Js_array.findIndex(fn, t); +} + +function filter(prim0, prim1) { + return prim0.filter(Curry.__1(prim1)); +} + +function reject(t, fn) { + return t.filter(function (el) { + return !fn(el); + }); +} + +function sortBy(t, fn) { + return Belt_SortArray.stableSortBy(t, (function (a, b) { + var match = fn(a, b); + if (match === "greater_than") { + return 1; + } else if (match === "less_than") { + return -1; + } else { + return 0; + } + })); +} + +function joinWith(prim0, prim1) { + return prim0.join(prim1); +} + +function join(__x) { + return __x.join(""); +} + +var $$String = { + joinWith: joinWith, + join: join +}; + +function eqBy(_xs, _ys, fn) { + while(true) { + var ys = _ys; + var xs = _xs; + var match = Belt_Array.get(xs, 0); + var match$1 = Belt_Array.get(ys, 0); + if (match === undefined) { + return match$1 === undefined; + } + if (match$1 === undefined) { + return false; + } + if (!fn(Caml_option.valFromOption(match), Caml_option.valFromOption(match$1))) { + return false; + } + _ys = Belt_Array.sliceToEnd(ys, 1); + _xs = Belt_Array.sliceToEnd(xs, 1); + continue ; + }; +} + +function takeWhile(t, fn) { + var a = { + contents: [] + }; + var maxLength = t.length - 1 | 0; + var iter = function (_idx) { + while(true) { + var idx = _idx; + if (idx >= maxLength) { + return ; + } + var item = t[idx]; + if (!fn(item)) { + return ; + } + a.contents = Belt_Array.concat(a.contents, [item]); + _idx = idx + 1 | 0; + continue ; + }; + }; + iter(0); + return a.contents; +} + +function distinct(t, eq) { + var maxIdx = t.length; + var _acc = []; + var _idx = 0; + while(true) { + var idx = _idx; + var acc = _acc; + if (idx >= maxIdx) { + return acc; + } + var y = t[idx]; + var acc$1 = Belt_Array.some(acc, (function(y){ + return function (x) { + return eq(x, y); + } + }(y))) ? acc : Belt_Array.concat(acc, [y]); + _idx = idx + 1 | 0; + _acc = acc$1; + continue ; + }; +} + +function partition(t, fn) { + var maxLength = t.length; + var _a = []; + var _b = []; + var _idx = 0; + while(true) { + var idx = _idx; + var b = _b; + var a = _a; + if (idx >= maxLength) { + return [ + a, + b + ]; + } + var item = t[idx]; + var idx$1 = idx + 1 | 0; + if (fn(item)) { + _idx = idx$1; + _a = Belt_Array.concat(a, [item]); + continue ; + } + _idx = idx$1; + _b = Belt_Array.concat(b, [item]); + continue ; + }; +} + +function replaceAt(t, idx, item) { + return Belt_Array.mapWithIndex(t, (function (idx$p, el) { + if (idx === idx$p) { + return item; + } else { + return el; + } + })); +} + +function indexOfBy(t, fn, value) { + var _idx = 0; + while(true) { + var idx = _idx; + var value$p = Belt_Array.get(t, idx); + if (value$p === undefined) { + return ; + } + if (fn(value, Caml_option.valFromOption(value$p))) { + return idx; + } + _idx = idx + 1 | 0; + continue ; + }; +} + +function swapAt(t, i, j) { + var match = Belt_Array.get(t, i); + var match$1 = Belt_Array.get(t, j); + if (match === undefined) { + return t; + } + if (match$1 === undefined) { + return t; + } + var b = Caml_option.valFromOption(match$1); + var a = Caml_option.valFromOption(match); + return Belt_Array.mapWithIndex(t, (function (k, x) { + if (i === k) { + return b; + } else if (j === k) { + return a; + } else { + return x; + } + })); +} + +function splitAt(t, i) { + if (i < 0 || i > t.length) { + return ; + } + var a = Belt_Array.slice(t, 0, i); + var b = Belt_Array.sliceToEnd(t, i); + return [ + a, + b + ]; +} + +function insertAt(t, idx, x) { + var match = splitAt(t, idx); + if (match !== undefined) { + return Belt_Array.concat(match[0], Belt_Array.concat([x], match[1])); + } else { + return t; + } +} + +function flatMap(t, fn) { + return Belt_Array.concatMany(Belt_Array.map(t, fn)); +} + +function removeAt(t, idx) { + return Belt_Array.keepWithIndex(t, (function (param, i) { + return i !== idx; + })); +} + +function drop(t, i) { + var l = t.length; + var start = i < 0 ? 0 : ( + l < i ? l : i + ); + return Belt_Array.sliceToEnd(t, start); +} + +function unsafePop(prim) { + return Caml_option.undefined_to_opt(prim.pop()); +} + +function sum(xs) { + return Belt_Array.reduce(xs, 0, (function (a, b) { + return a + b | 0; + })); +} + +var Int = { + sum: sum +}; + +function sum$1(xs) { + return Belt_Array.reduce(xs, 0, (function (a, b) { + return a + b; + })); +} + +var Float = { + sum: sum$1 +}; + +function clear(t) { + t.length = 0; +} + +var get = Belt_Array.get; + +var getExn = Belt_Array.getExn; + +var set = Belt_Array.set; + +var setExn = Belt_Array.setExn; + +var shuffleInPlace = Belt_Array.shuffleInPlace; + +var shuffle = Belt_Array.shuffle; + +var reverseInPlace = Belt_Array.reverseInPlace; + +var reverse = Belt_Array.reverse; + +var make = Belt_Array.make; + +var range = Belt_Array.range; + +var rangeBy = Belt_Array.rangeBy; + +var makeByU = Belt_Array.makeByU; + +var makeBy = Belt_Array.makeBy; + +var makeByAndShuffleU = Belt_Array.makeByAndShuffleU; + +var makeByAndShuffle = Belt_Array.makeByAndShuffle; + +var zip = Belt_Array.zip; + +var zipByU = Belt_Array.zipByU; + +var zipBy = Belt_Array.zipBy; + +var unzip = Belt_Array.unzip; + +var concat = Belt_Array.concat; + +var concatMany = Belt_Array.concatMany; + +var slice = Belt_Array.slice; + +var sliceToEnd = Belt_Array.sliceToEnd; + +var fill = Belt_Array.fill; + +var blit = Belt_Array.blit; + +var blitUnsafe = Belt_Array.blitUnsafe; + +var forEachU = Belt_Array.forEachU; + +var forEach = Belt_Array.forEach; + +var mapU = Belt_Array.mapU; + +var map = Belt_Array.map; + +var flatMapU = Belt_Array.flatMapU; + +var getByU = Belt_Array.getByU; + +var getBy = Belt_Array.getBy; + +var getIndexByU = Belt_Array.getIndexByU; + +var getIndexBy = Belt_Array.getIndexBy; + +var keepU = Belt_Array.keepU; + +var keep = Belt_Array.keep; + +var keepWithIndexU = Belt_Array.keepWithIndexU; + +var keepWithIndex = Belt_Array.keepWithIndex; + +var keepMapU = Belt_Array.keepMapU; + +var keepMap = Belt_Array.keepMap; + +var forEachWithIndexU = Belt_Array.forEachWithIndexU; + +var forEachWithIndex = Belt_Array.forEachWithIndex; + +var mapWithIndexU = Belt_Array.mapWithIndexU; + +var mapWithIndex = Belt_Array.mapWithIndex; + +var partitionU = Belt_Array.partitionU; + +var reduceU = Belt_Array.reduceU; + +var reduce = Belt_Array.reduce; + +var reduceReverseU = Belt_Array.reduceReverseU; + +var reduceReverse = Belt_Array.reduceReverse; + +var reduceReverse2U = Belt_Array.reduceReverse2U; + +var reduceReverse2 = Belt_Array.reduceReverse2; + +var reduceWithIndexU = Belt_Array.reduceWithIndexU; + +var reduceWithIndex = Belt_Array.reduceWithIndex; + +var joinWithU = Belt_Array.joinWithU; + +var joinWith$1 = Belt_Array.joinWith; + +var someU = Belt_Array.someU; + +var some = Belt_Array.some; + +var everyU = Belt_Array.everyU; + +var every = Belt_Array.every; + +var every2U = Belt_Array.every2U; + +var every2 = Belt_Array.every2; + +var some2U = Belt_Array.some2U; + +var some2 = Belt_Array.some2; + +var cmpU = Belt_Array.cmpU; + +var cmp = Belt_Array.cmp; + +var eqU = Belt_Array.eqU; + +var eq = Belt_Array.eq; + +var initU = Belt_Array.initU; + +var init = Belt_Array.init; + +var at = Belt_Array.get; + +var sortByRaw = Belt_SortArray.stableSortBy; + +export { + get , + getExn , + set , + setExn , + shuffleInPlace , + shuffle , + reverseInPlace , + reverse , + make , + range , + rangeBy , + makeByU , + makeBy , + makeByAndShuffleU , + makeByAndShuffle , + zip , + zipByU , + zipBy , + unzip , + concat , + concatMany , + slice , + sliceToEnd , + fill , + blit , + blitUnsafe , + forEachU , + forEach , + mapU , + map , + flatMapU , + getByU , + getBy , + getIndexByU , + getIndexBy , + keepU , + keep , + keepWithIndexU , + keepWithIndex , + keepMapU , + keepMap , + forEachWithIndexU , + forEachWithIndex , + mapWithIndexU , + mapWithIndex , + partitionU , + reduceU , + reduce , + reduceReverseU , + reduceReverse , + reduceReverse2U , + reduceReverse2 , + reduceWithIndexU , + reduceWithIndex , + joinWithU , + joinWith$1 as joinWith, + someU , + some , + everyU , + every , + every2U , + every2 , + some2U , + some2 , + cmpU , + cmp , + eqU , + eq , + initU , + init , + at , + includes , + head , + take , + last , + isEmpty , + isNotEmpty , + append , + prepend , + mapi , + flatten , + find , + findIndex , + filter , + reject , + sortBy , + sortByRaw , + $$String , + eqBy , + takeWhile , + distinct , + partition , + replaceAt , + indexOfBy , + swapAt , + splitAt , + insertAt , + flatMap , + removeAt , + drop , + unsafePop , + Int , + Float , + clear , +} +/* No side effect */ diff --git a/tests/testrepo_pnpm/packages/dep02/src/Array.res b/tests/testrepo_pnpm/packages/dep02/src/Array.res new file mode 100644 index 0000000..60e6fe5 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep02/src/Array.res @@ -0,0 +1,176 @@ +// Array module +include Belt.Array + +let at = get + +let includes = Js.Array2.includes + +let head = t => t->get(0) + +let take = (t, n) => slice(~offset=0, ~len=n, t) + +let last = t => t->at(length(t) - 1) + +let isEmpty = t => t->length == 0 + +let isNotEmpty = t => t->length > 0 + +let append = (t, v) => t->concat([v]) + +let prepend = (t, v) => [v]->concat(t) + +let flatMap = (t, fn) => t->map(fn)->concatMany + +let mapi = Js.Array2.mapi + +let flatten = t => t->flatMap(x => x) + +let find = (t, fn) => Js.Array.find(fn, t) + +let findIndex = (t, fn) => Js.Array.findIndex(fn, t) + +let filter = Js.Array2.filter + +let reject = (t, fn) => t->filter(el => !fn(el)) + +let sortBy = (t, fn) => + Belt.SortArray.stableSortBy(t, (a, b) => { + switch fn(a, b) { + | #less_than => -1 + | #equal_to => 0 + | #greater_than => 1 + } + }) + +let sortByRaw = Belt.SortArray.stableSortBy + +module String = { + let joinWith = Js.Array2.joinWith + let join = joinWith(_, "") +} + +let rec eqBy = (xs, ys, ~fn) => { + let tailOrEmpty = sliceToEnd(_, 1) + switch (head(xs), head(ys)) { + | (None, None) => true + | (Some(x), Some(y)) if fn(x, y) => eqBy(tailOrEmpty(xs), tailOrEmpty(ys), ~fn) + | _ => false + } +} + +let takeWhile = (t, fn) => { + let a = ref([]) + + let maxLength = t->length - 1 + let rec iter = idx => { + if idx < maxLength { + let item = t->getUnsafe(idx) + if fn(item) { + a := concat(a.contents, [item]) + iter(idx + 1) + } + } + } + iter(0) + + a.contents +} + +let distinct = (t, eq) => { + let maxIdx = t->length + let rec aux = (acc, idx) => { + if idx < maxIdx { + let y = t->getUnsafe(idx) + let acc = if !(acc->some(x => eq(x, y))) { + acc->concat([y]) + } else { + acc + } + aux(acc, idx + 1) + } else { + acc + } + } + aux([], 0) +} + +let partition = (t, fn) => { + let maxLength = t->length + let rec iter = (a, b, idx) => { + if idx < maxLength { + let item = t->getUnsafe(idx) + let idx = idx + 1 + if fn(item) { + iter(concat(a, [item]), b, idx) + } else { + iter(a, concat(b, [item]), idx) + } + } else { + (a, b) + } + } + iter([], [], 0) +} + +let replaceAt = (t: array<'a>, idx: int, item: 'a) => + t->mapWithIndex((idx', el) => + if idx == idx' { + item + } else { + el + } + ) + +let indexOfBy = (t, fn, value) => { + let rec aux = idx => { + switch at(t, idx) { + | None => None + | Some(value') if fn(value, value') => Some(idx) + | _ => aux(idx + 1) + } + } + aux(0) +} + +let swapAt = (t, i, j) => { + switch (at(t, i), at(t, j)) { + | (Some(a), Some(b)) => t->mapWithIndex((k, x) => i == k ? b : j == k ? a : x) + | _ => t + } +} + +let splitAt = (t, i) => + if i < 0 || i > length(t) { + None + } else { + let a = t->slice(~offset=0, ~len=i) + let b = t->sliceToEnd(i) + Some((a, b)) + } + +let insertAt = (t, idx, x) => + switch t->splitAt(idx) { + | Some((before, after)) => before->concat([x]->concat(after)) + | None => t + } + +let flatMap = (t, fn) => t->map(fn)->concatMany + +let removeAt = (t, idx) => t->keepWithIndex((_, i) => i != idx) + +let drop = (t, i) => { + let l = t->length + let start = i < 0 ? 0 : l < i ? l : i + t->sliceToEnd(start) +} + +let unsafePop = Js.Array.pop + +module Int = { + let sum = xs => reduce(xs, 0, (a, b) => a + b) +} + +module Float = { + let sum = xs => reduce(xs, 0., (a, b) => a +. b) +} +let clear = t => truncateToLengthUnsafe(t, 0) diff --git a/tests/testrepo_pnpm/packages/dep02/src/Dep02.mjs b/tests/testrepo_pnpm/packages/dep02/src/Dep02.mjs new file mode 100644 index 0000000..5fb85d4 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep02/src/Dep02.mjs @@ -0,0 +1,20 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as $$Array from "./Array.mjs"; +import * as NS_alias$$atNewNamespace from "@testrepo_pnpm/new-namespace/src/NS_alias.mjs"; + +function log() { + $$Array.forEach([ + "a", + "b" + ], (function (prim) { + console.log(prim); + })); +} + +console.log(NS_alias$$atNewNamespace.hello_world()); + +export { + log , +} +/* Not a pure module */ diff --git a/tests/testrepo_pnpm/packages/dep02/src/Dep02.res b/tests/testrepo_pnpm/packages/dep02/src/Dep02.res new file mode 100644 index 0000000..e832615 --- /dev/null +++ b/tests/testrepo_pnpm/packages/dep02/src/Dep02.res @@ -0,0 +1,3 @@ +open Array +let log = () => ["a", "b"]->forEach(Js.log) +Js.log(NS.Alias.hello_world()) diff --git a/tests/testrepo_pnpm/packages/main/README.md b/tests/testrepo_pnpm/packages/main/README.md new file mode 100644 index 0000000..78ee1da --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/README.md @@ -0,0 +1,21 @@ +# ReScript Project Template + +The only official ReScript starter template. + +## Installation + +```sh +npm install +``` + +## Build + +- Build: `npm run res:build` +- Clean: `npm run res:clean` +- Build & watch: `npm run res:dev` + +## Run + +```sh +node src/Demo.bs.js +``` diff --git a/tests/testrepo_pnpm/packages/main/bsconfig.json b/tests/testrepo_pnpm/packages/main/bsconfig.json new file mode 100644 index 0000000..33b78d0 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/bsconfig.json @@ -0,0 +1,15 @@ +{ + "name": "@testrepo_pnpm/main", + "sources": { + "dir": "src", + "subdirs": true + }, + "package-specs": { + "module": "commonjs", + "in-source": true + }, + "suffix": ".bs.js", + "bs-dependencies": [ + "@testrepo_pnpm/dep01" + ] +} diff --git a/tests/testrepo_pnpm/packages/main/package.json b/tests/testrepo_pnpm/packages/main/package.json new file mode 100644 index 0000000..09c3259 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/package.json @@ -0,0 +1,18 @@ +{ + "name": "@testrepo_pnpm/main", + "version": "0.0.1", + "scripts": { + "res:build": "rescript", + "res:clean": "rescript clean", + "res:dev": "rescript build -w" + }, + "keywords": [ + "rescript" + ], + "author": "", + "license": "MIT", + "dependencies": { + "@testrepo_pnpm/dep01": "workspace:*", + "rescript": "*" + } +} diff --git a/tests/testrepo_pnpm/packages/main/src/Demo.bs.js b/tests/testrepo_pnpm/packages/main/src/Demo.bs.js new file mode 100644 index 0000000..7002a36 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/src/Demo.bs.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE +'use strict'; + + +console.log("Hello, World!"); + +/* Not a pure module */ diff --git a/tests/testrepo_pnpm/packages/main/src/Main.mjs b/tests/testrepo_pnpm/packages/main/src/Main.mjs new file mode 100644 index 0000000..996d7af --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/src/Main.mjs @@ -0,0 +1,17 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as Dep01 from "@testrepo_pnpm/dep01/src/Dep01.mjs"; + +console.log("01"); + +Dep01.log(); + +var $$Array; + +var $$String; + +export { + $$Array , + $$String , +} +/* Not a pure module */ diff --git a/tests/testrepo_pnpm/packages/main/src/Main.res b/tests/testrepo_pnpm/packages/main/src/Main.res new file mode 100644 index 0000000..6b435d9 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/src/Main.res @@ -0,0 +1,5 @@ +Js.log("01") +Dep01.log() + +module Array = Belt.Array +module String = Js.String diff --git a/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.mjs b/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.mjs new file mode 100644 index 0000000..d60faa7 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.mjs @@ -0,0 +1,9 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + + +var hello = "world"; + +export { + hello , +} +/* No side effect */ diff --git a/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.res b/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.res new file mode 100644 index 0000000..1ca4d44 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.res @@ -0,0 +1,2 @@ +type hello = string +let hello = "world" diff --git a/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.resi b/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.resi new file mode 100644 index 0000000..42a1f84 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/src/ModuleWithInterface.resi @@ -0,0 +1,2 @@ +type hello +let hello: hello diff --git a/tests/testrepo_pnpm/packages/main/src/output.txt b/tests/testrepo_pnpm/packages/main/src/output.txt new file mode 100644 index 0000000..7571496 --- /dev/null +++ b/tests/testrepo_pnpm/packages/main/src/output.txt @@ -0,0 +1,6 @@ +bla +Hello world +01 +02 +a +b diff --git a/tests/testrepo_pnpm/packages/new-namespace/bsconfig.json b/tests/testrepo_pnpm/packages/new-namespace/bsconfig.json new file mode 100644 index 0000000..07632df --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/bsconfig.json @@ -0,0 +1,15 @@ +{ + "name": "@testrepo_pnpm/new-namespace", + "namespace": "NewNamespace", + "namespace-entry": "NS", + "sources": { + "dir": "src", + "subdirs": true + }, + "package-specs": { + "module": "es6", + "in-source": true + }, + "bs-dependencies": ["@testrepo_pnpm/dep01"], + "suffix": ".bs.js" +} diff --git a/tests/testrepo_pnpm/packages/new-namespace/package.json b/tests/testrepo_pnpm/packages/new-namespace/package.json new file mode 100644 index 0000000..d5ca8e7 --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/package.json @@ -0,0 +1,12 @@ +{ + "name": "@testrepo_pnpm/new-namespace", + "version": "0.0.1", + "keywords": [ + "rescript" + ], + "author": "", + "license": "MIT", + "dependencies": { + "rescript": "*" + } +} diff --git a/tests/testrepo_pnpm/packages/new-namespace/src/NS.mjs b/tests/testrepo_pnpm/packages/new-namespace/src/NS.mjs new file mode 100644 index 0000000..a9b226f --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/src/NS.mjs @@ -0,0 +1,9 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + + +var Alias; + +export { + Alias , +} +/* No side effect */ diff --git a/tests/testrepo_pnpm/packages/new-namespace/src/NS.res b/tests/testrepo_pnpm/packages/new-namespace/src/NS.res new file mode 100644 index 0000000..75421b4 --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/src/NS.res @@ -0,0 +1 @@ +module Alias = NS_alias diff --git a/tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.mjs b/tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.mjs new file mode 100644 index 0000000..6ab210f --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.mjs @@ -0,0 +1,14 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as Other_module$$atNewNamespace from "./Other_module.mjs"; + +function hello_world() { + return "Hello world"; +} + +Other_module$$atNewNamespace.bla(); + +export { + hello_world , +} +/* Not a pure module */ diff --git a/tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.res b/tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.res new file mode 100644 index 0000000..27a251d --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/src/NS_alias.res @@ -0,0 +1,2 @@ +let hello_world = () => "Hello world" +Other_module.bla() diff --git a/tests/testrepo_pnpm/packages/new-namespace/src/Other_module.mjs b/tests/testrepo_pnpm/packages/new-namespace/src/Other_module.mjs new file mode 100644 index 0000000..c4e5f16 --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/src/Other_module.mjs @@ -0,0 +1,11 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + + +function bla() { + console.log("bla"); +} + +export { + bla , +} +/* No side effect */ diff --git a/tests/testrepo_pnpm/packages/new-namespace/src/Other_module.res b/tests/testrepo_pnpm/packages/new-namespace/src/Other_module.res new file mode 100644 index 0000000..b265646 --- /dev/null +++ b/tests/testrepo_pnpm/packages/new-namespace/src/Other_module.res @@ -0,0 +1 @@ +let bla = () => Js.log("bla") diff --git a/tests/testrepo_pnpm/pnpm-lock.yaml b/tests/testrepo_pnpm/pnpm-lock.yaml new file mode 100644 index 0000000..260b52f --- /dev/null +++ b/tests/testrepo_pnpm/pnpm-lock.yaml @@ -0,0 +1,75 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@rolandpeelen/rewatch': + specifier: ^1.0.1 + version: 1.0.6 + '@testrepo_pnpm/dep01': + specifier: workspace:* + version: link:packages/dep01 + '@testrepo_pnpm/dep02': + specifier: workspace:* + version: link:packages/dep02 + '@testrepo_pnpm/main': + specifier: workspace:* + version: link:packages/main + '@testrepo_pnpm/new-namespace': + specifier: workspace:* + version: link:packages/new-namespace + rescript: + specifier: ^11.1.0-rc.7 + version: 11.1.0 + + packages/dep01: + dependencies: + '@testrepo_pnpm/dep02': + specifier: workspace:* + version: link:../dep02 + rescript: + specifier: '*' + version: 11.1.0 + + packages/dep02: + dependencies: + rescript: + specifier: '*' + version: 11.1.0 + + packages/main: + dependencies: + '@testrepo_pnpm/dep01': + specifier: workspace:* + version: link:../dep01 + rescript: + specifier: '*' + version: 11.1.0 + + packages/new-namespace: + dependencies: + rescript: + specifier: '*' + version: 11.1.0 + +packages: + + '@rolandpeelen/rewatch@1.0.6': + resolution: {integrity: sha512-i5On4uY6oHTIxFrcrpIU8Zsq3+MCB9D9DTD/9vY62pKlVyQbz0aKoAhXoceSK+rZ5xzIabdRlsmUKv8M7zWdgQ==} + hasBin: true + + rescript@11.1.0: + resolution: {integrity: sha512-9la2Dv+ACylQ77I8s4spPu1JnLZXbH5WgxcLHLLUBWgFFSiv0wXqgzWztrBIZqwFgVX5BYcwldUqUVcEzdCyHg==} + engines: {node: '>=10'} + hasBin: true + +snapshots: + + '@rolandpeelen/rewatch@1.0.6': {} + + rescript@11.1.0: {} diff --git a/tests/testrepo_pnpm/pnpm-workspace.yaml b/tests/testrepo_pnpm/pnpm-workspace.yaml new file mode 100644 index 0000000..18ec407 --- /dev/null +++ b/tests/testrepo_pnpm/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'packages/*' diff --git a/tests/testrepo_pnpm/src/Test.mjs b/tests/testrepo_pnpm/src/Test.mjs new file mode 100644 index 0000000..d60faa7 --- /dev/null +++ b/tests/testrepo_pnpm/src/Test.mjs @@ -0,0 +1,9 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + + +var hello = "world"; + +export { + hello , +} +/* No side effect */ diff --git a/tests/testrepo_pnpm/src/Test.res b/tests/testrepo_pnpm/src/Test.res new file mode 100644 index 0000000..cab7902 --- /dev/null +++ b/tests/testrepo_pnpm/src/Test.res @@ -0,0 +1 @@ +let hello = "world" From cb35cfce5b5f23010dc2e514a9dfd21029d77d0b Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Wed, 8 May 2024 19:48:47 +0200 Subject: [PATCH 5/8] :white_check_mark: - Run tests on PNPM --- tests/compile.sh | 2 +- tests/suffix.sh | 1 - tests/suite-ci.sh | 14 ++++++++------ tests/watch.sh | 1 - 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/compile.sh b/tests/compile.sh index 51a3109..b42b1ba 100755 --- a/tests/compile.sh +++ b/tests/compile.sh @@ -25,7 +25,7 @@ fi if git diff --exit-code ./; then - success "testrepo_yarn has no changes" + success "testrepo has no changes" else error "Build has changed" exit 1 diff --git a/tests/suffix.sh b/tests/suffix.sh index 15f6449..ecfbad9 100755 --- a/tests/suffix.sh +++ b/tests/suffix.sh @@ -4,7 +4,6 @@ cd $(dirname $0) source "./utils.sh" cd "$1" || exit -source "./utils.sh" bold "Test: It should support custom suffixes" # Clean Repo diff --git a/tests/suite-ci.sh b/tests/suite-ci.sh index aeb451c..2742556 100755 --- a/tests/suite-ci.sh +++ b/tests/suite-ci.sh @@ -31,12 +31,14 @@ else exit 1 fi +bold "Yarn Tests" ./compile.sh "testrepo_yarn" \ - && ../watch.sh "testrepo_yarn" \ - && ../lock.sh "testrepo_yarn" \ - && ../suffix.sh "testrepo_yarn" + && ./watch.sh "testrepo_yarn" \ + && ./lock.sh "testrepo_yarn" \ + && ./suffix.sh "testrepo_yarn" +bold "PNPM Tests" ./compile.sh "testrepo_pnpm" \ - && ../watch.sh "testrepo_pnpm" \ - && ../lock.sh "testrepo_pnpm" \ - && ../suffix.sh "testrepo_pnpm" + && ./watch.sh "testrepo_pnpm" \ + && ./lock.sh "testrepo_pnpm" \ + && ./suffix.sh "testrepo_pnpm" diff --git a/tests/watch.sh b/tests/watch.sh index 2e512ee..5ec99c8 100755 --- a/tests/watch.sh +++ b/tests/watch.sh @@ -4,7 +4,6 @@ cd $(dirname $0) source "./utils.sh" cd "$1" || exit -source "./utils.sh" bold "Test: It should watch" if rewatch clean &> /dev/null; From 7149c5ecb4276e502490bcd21cb12289ea5dcea7 Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Wed, 8 May 2024 19:52:51 +0200 Subject: [PATCH 6/8] :white_check_mark: - Install PNPM in CI --- .github/workflows/test.yml | 4 +++- tests/suite-ci.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 312ebef..58dd8f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,9 +23,11 @@ jobs: run: cargo build --release - name: Run unit test run: cargo test + - name: Install PNPM + run: npm i -g pnpm - name: Install Yarn Dependencies run: cd ./tests/testrepo_yarn && yarn install - - name: Install Pnpm Dependencies + - name: Install PNPM Dependencies run: cd ./tests/testrepo_pnpm && pnpm install - name: Run Test run: ./tests/suite-ci.sh diff --git a/tests/suite-ci.sh b/tests/suite-ci.sh index 2742556..9c4a603 100755 --- a/tests/suite-ci.sh +++ b/tests/suite-ci.sh @@ -35,10 +35,10 @@ bold "Yarn Tests" ./compile.sh "testrepo_yarn" \ && ./watch.sh "testrepo_yarn" \ && ./lock.sh "testrepo_yarn" \ - && ./suffix.sh "testrepo_yarn" + && ./suffix.sh "testrepo_yarn"; bold "PNPM Tests" ./compile.sh "testrepo_pnpm" \ && ./watch.sh "testrepo_pnpm" \ && ./lock.sh "testrepo_pnpm" \ - && ./suffix.sh "testrepo_pnpm" + && ./suffix.sh "testrepo_pnpm"; From db9001bbf240d464745bcc1625def56842326086 Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Thu, 9 May 2024 13:27:28 +0200 Subject: [PATCH 7/8] :camera_flash: - Update snapshots. --- tests/compile.sh | 12 +++++----- ...txt => dependency-cycle-testrepo_pnpm.txt} | 0 .../dependency-cycle-testrepo_yarn.txt | 11 +++++++++ ...file.txt => remove-file-testrepo_pnpm.txt} | 0 tests/snapshots/remove-file-testrepo_yarn.txt | 24 +++++++++++++++++++ ...file.txt => rename-file-testrepo_pnpm.txt} | 0 tests/snapshots/rename-file-testrepo_yarn.txt | 9 +++++++ ...ame-file-with-interface-testrepo_pnpm.txt} | 0 ...name-file-with-interface-testrepo_yarn.txt | 10 ++++++++ ...> rename-interface-file-testrepo_pnpm.txt} | 0 .../rename-interface-file-testrepo_yarn.txt | 10 ++++++++ 11 files changed, 70 insertions(+), 6 deletions(-) rename tests/snapshots/{dependency-cycle.txt => dependency-cycle-testrepo_pnpm.txt} (100%) create mode 100644 tests/snapshots/dependency-cycle-testrepo_yarn.txt rename tests/snapshots/{remove-file.txt => remove-file-testrepo_pnpm.txt} (100%) create mode 100644 tests/snapshots/remove-file-testrepo_yarn.txt rename tests/snapshots/{rename-file.txt => rename-file-testrepo_pnpm.txt} (100%) create mode 100644 tests/snapshots/rename-file-testrepo_yarn.txt rename tests/snapshots/{rename-file-with-interface.txt => rename-file-with-interface-testrepo_pnpm.txt} (100%) create mode 100644 tests/snapshots/rename-file-with-interface-testrepo_yarn.txt rename tests/snapshots/{rename-interface-file.txt => rename-interface-file-testrepo_pnpm.txt} (100%) create mode 100644 tests/snapshots/rename-interface-file-testrepo_yarn.txt diff --git a/tests/compile.sh b/tests/compile.sh index b42b1ba..bcf26ce 100755 --- a/tests/compile.sh +++ b/tests/compile.sh @@ -34,29 +34,29 @@ fi node ./packages/main/src/Main.mjs > ./packages/main/src/output.txt mv ./packages/main/src/Main.res ./packages/main/src/Main2.res -rewatch build --no-timing=true &> ../snapshots/rename-file.txt +rewatch build --no-timing=true &> ../snapshots/rename-file-"$1".txt mv ./packages/main/src/Main2.res ./packages/main/src/Main.res rewatch build &> /dev/null mv ./packages/main/src/ModuleWithInterface.resi ./packages/main/src/ModuleWithInterface2.resi -rewatch build --no-timing=true &> ../snapshots/rename-interface-file.txt +rewatch build --no-timing=true &> ../snapshots/rename-interface-file-"$1".txt mv ./packages/main/src/ModuleWithInterface2.resi ./packages/main/src/ModuleWithInterface.resi rewatch build &> /dev/null mv ./packages/main/src/ModuleWithInterface.res ./packages/main/src/ModuleWithInterface2.res -rewatch build --no-timing=true &> ../snapshots/rename-file-with-interface.txt +rewatch build --no-timing=true &> ../snapshots/rename-file-with-interface-"$1".txt mv ./packages/main/src/ModuleWithInterface2.res ./packages/main/src/ModuleWithInterface.res rewatch build &> /dev/null # when deleting a file that other files depend on, the compile should fail rm packages/dep02/src/Dep02.res -rewatch build --no-timing=true &> ../snapshots/remove-file.txt +rewatch build --no-timing=true &> ../snapshots/remove-file-"$1".txt # replace the absolute path so the snapshot is the same on all machines -replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../snapshots/remove-file.txt +replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../snapshots/remove-file-"$1".txt git checkout -- packages/dep02/src/Dep02.res rewatch build &> /dev/null # it should show an error when we have a dependency cycle echo 'Dep01.log()' >> packages/new-namespace/src/NS_alias.res -rewatch build --no-timing=true &> ../snapshots/dependency-cycle.txt +rewatch build --no-timing=true &> ../snapshots/dependency-cycle-"$1".txt git checkout -- packages/new-namespace/src/NS_alias.res rewatch build &> /dev/null diff --git a/tests/snapshots/dependency-cycle.txt b/tests/snapshots/dependency-cycle-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/dependency-cycle.txt rename to tests/snapshots/dependency-cycle-testrepo_pnpm.txt diff --git a/tests/snapshots/dependency-cycle-testrepo_yarn.txt b/tests/snapshots/dependency-cycle-testrepo_yarn.txt new file mode 100644 index 0000000..10c4e55 --- /dev/null +++ b/tests/snapshots/dependency-cycle-testrepo_yarn.txt @@ -0,0 +1,11 @@ +[1/7]๐Ÿ“ฆ Building package tree... [1/7] ๐Ÿ“ฆ Built package tree in 0.00s +[2/7] ๐Ÿ•ต๏ธ Finding source files... [2/7] ๐Ÿ•ต๏ธ Found source files in 0.00s +[3/7] ๐Ÿ“ Reading compile state... [3/7] ๐Ÿ“ Read compile state 0.00s +[4/7] ๐Ÿงน Cleaning up previous build... [4/7] ๐Ÿงน Cleaned 0/10 0.00s + [5/7] ๐Ÿงฑ Parsed 1 source files in 0.00s + [6/7] ๏ธ๐ŸŒด Collected deps in 0.00s + [7/7] ๏ธ๐Ÿ›‘ Compiled 0 modules in 0.00s + +Can't continue... Found a circular dependency in your code: +NewNamespace.NS_alias -> Dep01 -> Dep02 -> NS -> NewNamespace.NS_alias +Error Building:  ๏ธ๐Ÿ›‘ Error Running Incremental Build:  ๏ธ๐Ÿ›‘ Failed to Compile. See Errors Above diff --git a/tests/snapshots/remove-file.txt b/tests/snapshots/remove-file-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/remove-file.txt rename to tests/snapshots/remove-file-testrepo_pnpm.txt diff --git a/tests/snapshots/remove-file-testrepo_yarn.txt b/tests/snapshots/remove-file-testrepo_yarn.txt new file mode 100644 index 0000000..228ef79 --- /dev/null +++ b/tests/snapshots/remove-file-testrepo_yarn.txt @@ -0,0 +1,24 @@ +[1/7]๐Ÿ“ฆ Building package tree... [1/7] ๐Ÿ“ฆ Built package tree in 0.00s +[2/7] ๐Ÿ•ต๏ธ Finding source files... [2/7] ๐Ÿ•ต๏ธ Found source files in 0.00s +[3/7] ๐Ÿ“ Reading compile state... [3/7] ๐Ÿ“ Read compile state 0.00s +[4/7] ๐Ÿงน Cleaning up previous build... [4/7] ๐Ÿงน Cleaned 1/10 0.00s + [5/7] ๐Ÿงฑ Parsed 0 source files in 0.00s + [6/7] ๏ธ๐ŸŒด Collected deps in 0.00s + [7/7] ๏ธ๐Ÿ›‘ Compiled 1 modules in 0.00s + + We've found a bug for you! + /packages/dep01/src/Dep01.res:3:9-17 + + 1 โ”‚ let log = () => { + 2 โ”‚ Js.log("02") + 3 โ”‚ Dep02.log() + 4 โ”‚ } + 5 โ”‚ + + The module or file Dep02 can't be found. + - If it's a third-party dependency: + - Did you add it to the "bs-dependencies" or "bs-dev-dependencies" in bsconfig.json? + - Did you include the file's directory to the "sources" in bsconfig.json? + + +Error Building:  ๏ธ๐Ÿ›‘ Error Running Incremental Build:  ๏ธ๐Ÿ›‘ Failed to Compile. See Errors Above diff --git a/tests/snapshots/rename-file.txt b/tests/snapshots/rename-file-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/rename-file.txt rename to tests/snapshots/rename-file-testrepo_pnpm.txt diff --git a/tests/snapshots/rename-file-testrepo_yarn.txt b/tests/snapshots/rename-file-testrepo_yarn.txt new file mode 100644 index 0000000..68d3ebf --- /dev/null +++ b/tests/snapshots/rename-file-testrepo_yarn.txt @@ -0,0 +1,9 @@ +[1/7]๐Ÿ“ฆ Building package tree... [1/7] ๐Ÿ“ฆ Built package tree in 0.00s +[2/7] ๐Ÿ•ต๏ธ Finding source files... [2/7] ๐Ÿ•ต๏ธ Found source files in 0.00s +[3/7] ๐Ÿ“ Reading compile state... [3/7] ๐Ÿ“ Read compile state 0.00s +[4/7] ๐Ÿงน Cleaning up previous build... [4/7] ๐Ÿงน Cleaned 1/10 0.00s + [5/7] ๐Ÿงฑ Parsed 1 source files in 0.00s + [6/7] ๏ธ๐ŸŒด Collected deps in 0.00s + [7/7] ๐Ÿคบ ๏ธCompiled 1 modules in 0.00s + + โœจ Finished Compilation in 0.00s diff --git a/tests/snapshots/rename-file-with-interface.txt b/tests/snapshots/rename-file-with-interface-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/rename-file-with-interface.txt rename to tests/snapshots/rename-file-with-interface-testrepo_pnpm.txt diff --git a/tests/snapshots/rename-file-with-interface-testrepo_yarn.txt b/tests/snapshots/rename-file-with-interface-testrepo_yarn.txt new file mode 100644 index 0000000..e16ce55 --- /dev/null +++ b/tests/snapshots/rename-file-with-interface-testrepo_yarn.txt @@ -0,0 +1,10 @@ +[1/7]๐Ÿ“ฆ Building package tree... [1/7] ๐Ÿ“ฆ Built package tree in 0.00s +[2/7] ๐Ÿ•ต๏ธ Finding source files... Warning: No implementation file found for interface file (skipping): src/ModuleWithInterface.resi + [2/7] ๐Ÿ•ต๏ธ Found source files in 0.00s +[3/7] ๐Ÿ“ Reading compile state... [3/7] ๐Ÿ“ Read compile state 0.00s +[4/7] ๐Ÿงน Cleaning up previous build... [4/7] ๐Ÿงน Cleaned 2/10 0.00s + [5/7] ๐Ÿงฑ Parsed 1 source files in 0.00s + [6/7] ๏ธ๐ŸŒด Collected deps in 0.00s + [7/7] ๐Ÿคบ ๏ธCompiled 1 modules in 0.00s + + โœจ Finished Compilation in 0.00s diff --git a/tests/snapshots/rename-interface-file.txt b/tests/snapshots/rename-interface-file-testrepo_pnpm.txt similarity index 100% rename from tests/snapshots/rename-interface-file.txt rename to tests/snapshots/rename-interface-file-testrepo_pnpm.txt diff --git a/tests/snapshots/rename-interface-file-testrepo_yarn.txt b/tests/snapshots/rename-interface-file-testrepo_yarn.txt new file mode 100644 index 0000000..d980584 --- /dev/null +++ b/tests/snapshots/rename-interface-file-testrepo_yarn.txt @@ -0,0 +1,10 @@ +[1/7]๐Ÿ“ฆ Building package tree... [1/7] ๐Ÿ“ฆ Built package tree in 0.00s +[2/7] ๐Ÿ•ต๏ธ Finding source files... Warning: No implementation file found for interface file (skipping): src/ModuleWithInterface2.resi + [2/7] ๐Ÿ•ต๏ธ Found source files in 0.00s +[3/7] ๐Ÿ“ Reading compile state... [3/7] ๐Ÿ“ Read compile state 0.00s +[4/7] ๐Ÿงน Cleaning up previous build... [4/7] ๐Ÿงน Cleaned 1/10 0.00s + [5/7] ๐Ÿงฑ Parsed 1 source files in 0.00s + [6/7] ๏ธ๐ŸŒด Collected deps in 0.00s + [7/7] ๐Ÿคบ ๏ธCompiled 1 modules in 0.00s + + โœจ Finished Compilation in 0.00s From 32e96ab7b5f0fd8456a653d01a5739f2fe49fd5f Mon Sep 17 00:00:00 2001 From: Roland Peelen Date: Thu, 9 May 2024 13:33:29 +0200 Subject: [PATCH 8/8] :white_check_mark: - Include time to kill Rewatch after every test --- tests/suite-ci.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/suite-ci.sh b/tests/suite-ci.sh index 9c4a603..076f8e0 100755 --- a/tests/suite-ci.sh +++ b/tests/suite-ci.sh @@ -33,12 +33,18 @@ fi bold "Yarn Tests" ./compile.sh "testrepo_yarn" \ + && sleep 1 \ && ./watch.sh "testrepo_yarn" \ + && sleep 1 \ && ./lock.sh "testrepo_yarn" \ + && sleep 1 \ && ./suffix.sh "testrepo_yarn"; bold "PNPM Tests" ./compile.sh "testrepo_pnpm" \ + && sleep 1 \ && ./watch.sh "testrepo_pnpm" \ + && sleep 1 \ && ./lock.sh "testrepo_pnpm" \ + && sleep 1 \ && ./suffix.sh "testrepo_pnpm";