Skip to content

Commit e61e287

Browse files
committed
Remove useless workspaces and modify templates to include all scripts
1 parent 1315c90 commit e61e287

File tree

10 files changed

+21
-69
lines changed

10 files changed

+21
-69
lines changed

.github/actions/src/info/index.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ export function processRawPackages(topoOrder: string[], packages: Record<string,
113113
packageInfo.package.devDependencies !== undefined &&
114114
'playwright' in packageInfo.package.devDependencies;
115115

116-
if (
117-
packageName !== '@sourceacademy/modules' &&
118-
packageName !== '@sourceacademy/bundles' &&
119-
packageName !== '@sourceacademy/tabs'
120-
) {
116+
if (packageName !== '@sourceacademy/modules') {
121117
const match = packageNameRE.exec(packageName);
122118
if (!match) throw new Error(`Unknown package ${packageName}`);
123119

@@ -183,10 +179,6 @@ export async function getAllPackages(gitRoot: string) {
183179
...tabs,
184180
...libs
185181
};
186-
// Remove the root packages from the bundles and tabs collection
187-
// of packages cause they're not supposed be used like that
188-
delete bundles['@sourceacademy/bundles'];
189-
delete tabs['@sourceacademy/tabs'];
190182

191183
const sort = topoSortPackages(packages);
192184
const processed = processRawPackages(sort, packages);

lib/buildtools/src/commands/prebuild.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pathlib from 'path';
22
import { Command } from '@commander-js/extra-typings';
3+
import { outDir } from '@sourceacademy/modules-repotools/getGitRoot';
34
import { resolveEitherBundleOrTab } from '@sourceacademy/modules-repotools/manifest';
45
import { divideAndRound } from '@sourceacademy/modules-repotools/utils';
56
import chalk from 'chalk';
@@ -64,6 +65,11 @@ export const getLintGlobalCommand = () => new Command('lintglobal')
6465

6566
console.log(logs.join('\n'));
6667

68+
if (stats) {
69+
const statPath = pathlib.join(outDir, 'lintstats.csv');
70+
console.log(chalk.greenBright(`Stats written to ${statPath}`));
71+
}
72+
6773
switch (result.severity) {
6874
case 'warn': {
6975
if (!ci) return;

lib/buildtools/src/templates/bundle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export async function addNew(bundlesDir: string, rl: Interface) {
4949
scripts: {
5050
build: 'buildtools build bundle .',
5151
lint: 'buildtools lint .',
52+
serve: 'yarn buildtools serve',
53+
test: 'buildtools test --project .',
5254
tsc: 'tsc --project ./tsconfig.json',
5355
},
5456
exports: {

lib/buildtools/src/templates/tab.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ export async function addNew(bundlesDir: string, tabsDir: string, rl: Interface)
7070
scripts: {
7171
build: 'buildtools build tab .',
7272
lint: 'buildtools lint .',
73-
tsc: 'tsc --project ./tsconfig.json'
73+
test: 'buildtools test --project .',
74+
tsc: 'buildtools tsc .',
75+
serve: 'yarn buildtools serve'
7476
}
7577
};
7678

lib/lintplugin/src/rules/__tests__/noBarrelImports.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ describe('Test noBarrelImports', () => {
1616
code: "import type { memoize } from 'lodash';",
1717
options: [['lodash']]
1818
},
19+
{
20+
code: "import type * as _ from 'lodash';",
21+
options: [['lodash']]
22+
},
1923
{
2024
code: "import memoize from 'lodash/memoize'\nimport cloneDeep from 'lodash/cloneDeep'",
2125
options: [['lodash']]

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
"./devserver",
103103
"./docs",
104104
"./lib/*",
105-
"./src/bundles",
106-
"./src/tabs"
105+
"./src/bundles/*",
106+
"./src/tabs/*"
107107
],
108108
"resolutions": {
109109
"vite": "npm:vite@^6.3.5"

src/bundles/package.json

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

src/tabs/Curve/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"@types/react-dom": "^18.3.1",
1717
"@vitest/browser": "^3.2.3",
1818
"@vitest/coverage-v8": "^3.2.3",
19+
"playwright": "^1.54.1",
1920
"vitest": "^3.2.3",
20-
"vitest-browser-react": "^1.0.0",
21-
"playwright": "^1.54.1"
21+
"vitest-browser-react": "^1.0.0"
2222
},
2323
"scripts": {
2424
"build": "buildtools build tab .",

src/tabs/package.json

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

yarn.lock

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3553,14 +3553,6 @@ __metadata:
35533553
languageName: unknown
35543554
linkType: soft
35553555

3556-
"@sourceacademy/bundles@workspace:src/bundles":
3557-
version: 0.0.0-use.local
3558-
resolution: "@sourceacademy/bundles@workspace:src/bundles"
3559-
dependencies:
3560-
"@sourceacademy/modules-buildtools": "workspace:^"
3561-
languageName: unknown
3562-
linkType: soft
3563-
35643556
"@sourceacademy/lint-plugin@workspace:^, @sourceacademy/lint-plugin@workspace:lib/lintplugin":
35653557
version: 0.0.0-use.local
35663558
resolution: "@sourceacademy/lint-plugin@workspace:lib/lintplugin"
@@ -3869,6 +3861,7 @@ __metadata:
38693861
"@types/react-dom": "npm:^18.3.1"
38703862
"@vitest/browser": "npm:^3.2.3"
38713863
"@vitest/coverage-v8": "npm:^3.2.3"
3864+
playwright: "npm:^1.54.1"
38723865
react: "npm:^18.3.1"
38733866
react-dom: "npm:^18.3.1"
38743867
vitest: "npm:^3.2.3"
@@ -4097,18 +4090,6 @@ __metadata:
40974090
languageName: unknown
40984091
linkType: soft
40994092

4100-
"@sourceacademy/tabs@workspace:src/tabs":
4101-
version: 0.0.0-use.local
4102-
resolution: "@sourceacademy/tabs@workspace:src/tabs"
4103-
dependencies:
4104-
"@sourceacademy/modules-buildtools": "workspace:^"
4105-
"@types/react": "npm:^18.3.1"
4106-
"@types/react-dom": "npm:^18.3.1"
4107-
react: "npm:^18.3.1"
4108-
react-dom: "npm:^18.3.1"
4109-
languageName: unknown
4110-
linkType: soft
4111-
41124093
"@stylistic/eslint-plugin@npm:^4.4.1":
41134094
version: 4.4.1
41144095
resolution: "@stylistic/eslint-plugin@npm:4.4.1"

0 commit comments

Comments
 (0)