Skip to content

Commit

Permalink
Implement @modular-scripts/workspace-resolver (#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgb-io authored Aug 3, 2022
1 parent 603b149 commit b2c9f74
Show file tree
Hide file tree
Showing 75 changed files with 1,156 additions and 69 deletions.
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": [],
"updateInternalDependents": "always"
}
7 changes: 7 additions & 0 deletions .changeset/unlucky-guests-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modular-scripts/modular-types': major
'@modular-scripts/workspace-resolver': major
'modular-scripts': patch
---

Introduce @modular-scripts/modular-types and @modular-scripts/workspace-resolver
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ yarn-error.log*

# Used by typescript for incremental builds
.tsbuildinfo
*.tsbuildinfo
*.tsbuildinfo

# Top level test fixtures
/__fixtures__
2 changes: 1 addition & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Run Windows tests
run: yarn test esmView.test.ts
run: yarn test esmView.test.ts workspace-resolver
16 changes: 16 additions & 0 deletions __fixtures__/clean-workspace-1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "clean-workspace-1",
"version": "1.0.0",
"author": "App Frameworks team",
"license": "MIT",
"private": true,
"workspaces": [
"packages/**"
],
"modular": {
"type": "root"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
12 changes: 12 additions & 0 deletions __fixtures__/clean-workspace-1/packages/app-one/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "app-one",
"private": true,
"modular": {
"type": "app"
},
"dependencies": {
"package-one": "1.0.0",
"package-two": "1.0.0"
},
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-one",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-two",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
21 changes: 21 additions & 0 deletions __fixtures__/clean-workspace-2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "clean-workspace-2",
"version": "1.0.0",
"author": "App Frameworks team",
"license": "MIT",
"private": true,
"workspaces": {
"packages": [
"packages/**"
],
"nohoist": [
"foo"
]
},
"modular": {
"type": "root"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
12 changes: 12 additions & 0 deletions __fixtures__/clean-workspace-2/packages/app-one/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "app-one",
"private": true,
"modular": {
"type": "app"
},
"dependencies": {
"package-one": "1.0.0",
"package-two": "1.0.0"
},
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-one",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-two",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
16 changes: 16 additions & 0 deletions __fixtures__/clean-workspace-3/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "clean-workspace-3",
"version": "1.0.0",
"author": "App Frameworks team",
"license": "MIT",
"private": true,
"workspaces": [
"packages/**"
],
"modular": {
"type": "root"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
14 changes: 14 additions & 0 deletions __fixtures__/clean-workspace-3/packages/app-one/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "app-one",
"private": true,
"modular": {
"type": "app"
},
"dependencies": {
"package-one": "workspace:*",
"package-two": "workspace:^",
"package-three": "workspace:~",
"package-four": "workspace:^1.0.0"
},
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-four",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-one",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-three",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-two",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
16 changes: 16 additions & 0 deletions __fixtures__/invalid-workspace-1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "invalid-workspace-1",
"version": "1.0.0",
"author": "App Frameworks team",
"license": "MIT",
"private": true,
"workspaces": [
"packages/**"
],
"modular": {
"type": "root"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
12 changes: 12 additions & 0 deletions __fixtures__/invalid-workspace-1/packages/app-one/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "app-one",
"private": true,
"modular": {
"type": "root"
},
"dependencies": {
"package-one": "1.0.0",
"package-two": "1.0.0"
},
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-one",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-two",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
16 changes: 16 additions & 0 deletions __fixtures__/invalid-workspace-2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "invalid-workspace-2",
"version": "1.0.0",
"author": "App Frameworks team",
"license": "MIT",
"private": true,
"workspaces": [
"packages/**"
],
"modular": {
"type": "root"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
16 changes: 16 additions & 0 deletions __fixtures__/invalid-workspace-2/packages/app-one/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "app-one",
"private": true,
"modular": {
"type": "app"
},
"workspaces": [
"foo",
"bar"
],
"dependencies": {
"package-one": "1.0.0",
"package-two": "1.0.0"
},
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-one",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-two",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
16 changes: 16 additions & 0 deletions __fixtures__/invalid-workspace-3/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "invalid-workspace-3",
"version": "1.0.0",
"author": "App Frameworks team",
"license": "MIT",
"private": true,
"workspaces": [
"packages/**"
],
"modular": {
"type": "root"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
18 changes: 18 additions & 0 deletions __fixtures__/invalid-workspace-3/packages/app-one/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "app-one",
"private": true,
"modular": {
"type": "app"
},
"workspaces": {
"packages": [
"foo",
"bar"
]
},
"dependencies": {
"package-one": "1.0.0",
"package-two": "1.0.0"
},
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-one",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "package-two",
"private": true,
"modular": {
"type": "package"
},
"main": "./src/index.ts",
"version": "1.0.0"
}
16 changes: 16 additions & 0 deletions __fixtures__/invalid-workspace-4/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "invalid-workspace-3",
"version": "1.0.0",
"author": "App Frameworks team",
"license": "MIT",
"private": true,
"workspaces": [
"packages/**"
],
"modular": {
"type": "root"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
11 changes: 11 additions & 0 deletions __fixtures__/invalid-workspace-4/packages/app-one/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"private": true,
"modular": {
"type": "app"
},
"dependencies": {
"package-one": "1.0.0",
"package-two": "1.0.0"
},
"version": "1.0.0"
}
Loading

0 comments on commit b2c9f74

Please sign in to comment.