Skip to content

Commit 3de2fdd

Browse files
authored
Shared configs/workflows/default (#147)
* add default export * install the released version. * bump minimum version * update cache * [email protected] * [email protected] * [email protected] * update tests
1 parent 99c94de commit 3de2fdd

File tree

12 files changed

+1293
-198
lines changed

12 files changed

+1293
-198
lines changed

.github/workflows/deploy-apps.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,9 @@ jobs:
5454
if: steps.changes.outputs.skip_steps != 'true'
5555
uses: pnpm/[email protected]
5656

57-
# ✅ NEW: configure pnpm to use registry packages, not workspace links
58-
- name: Configure pnpm for registry install
59-
if: steps.changes.outputs.skip_steps != 'true'
60-
run: |
61-
echo "link-workspace-packages=false" >> .npmrc
62-
echo "prefer-workspace-packages=false" >> .npmrc
63-
echo "auto-install-peers=true" >> .npmrc
64-
6557
- name: Install dependencies
6658
if: steps.changes.outputs.skip_steps != 'true'
67-
run: pnpm install --config.prefer-workspace-packages=false --link-workspace-packages=false
68-
59+
run: pnpm i
6960
- name: Build
7061
if: steps.changes.outputs.skip_steps != 'true'
7162
run: pnpm build apps

.github/workflows/nutritionfacts-auto-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
shell: bash
5050
run: |
5151
set -euo pipefail
52-
pnpm -F nutritionfacts up @instructure.ai/aiinfo@latest
52+
pnpm -F nutritionfacts add pnpm -F nutritionfacts add "@instructure.ai/aiinfo@^${TAG#*@}"
5353
5454
- name: Commit changes (if any)
5555
id: commit

apps/nutritionfacts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
"update-cache": "vite-node ./scripts/updateCache.mts"
2929
},
3030
"type": "module",
31-
"version": "1.5.3"
31+
"version": "1.6.0"
3232
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { describe, it, expect } from "vitest";
2+
import type { PageLayout } from "../types";
3+
import { DefaultLayout } from "./Layout";
4+
5+
import { Layout } from "./Layout";
6+
7+
describe("Layout", () => {
8+
it("should correctly assign all true properties", () => {
9+
const input: PageLayout = {
10+
copyright: true,
11+
disclaimer: true,
12+
revision: true,
13+
};
14+
const layout = new Layout(input);
15+
expect(layout.copyright).toBe(true);
16+
expect(layout.disclaimer).toBe(true);
17+
expect(layout.revision).toBe(true);
18+
});
19+
20+
it("should correctly assign all false properties", () => {
21+
const input: PageLayout = {
22+
copyright: false,
23+
disclaimer: false,
24+
revision: false,
25+
};
26+
const layout = new Layout(input);
27+
expect(layout.copyright).toBe(false);
28+
expect(layout.disclaimer).toBe(false);
29+
expect(layout.revision).toBe(false);
30+
});
31+
32+
it("should correctly assign mixed property values", () => {
33+
const input: PageLayout = {
34+
copyright: true,
35+
disclaimer: false,
36+
revision: true,
37+
};
38+
const layout = new Layout(input);
39+
expect(layout.copyright).toBe(true);
40+
expect(layout.disclaimer).toBe(false);
41+
expect(layout.revision).toBe(true);
42+
});
43+
44+
it("DefaultLayout should have all properties true", () => {
45+
expect(DefaultLayout.copyright).toBe(true);
46+
expect(DefaultLayout.disclaimer).toBe(true);
47+
expect(DefaultLayout.revision).toBe(true);
48+
});
49+
});

apps/nutritionfacts/src/assets/Layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ const DefaultLayout = new Layout({
1818
revision: true,
1919
} as PageLayout);
2020

21-
export { DefaultLayout };
21+
export { DefaultLayout, Layout };

coverage/coverage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
coverage:
22
totals:
3-
statements: 2.15%
4-
branches: 0.84%
3+
statements: 2.12%
4+
branches: 0.83%
55
functions: 3.03%
6-
lines: 2.26%
7-
total: 2.07%
6+
lines: 2.23%
7+
total: 2.05%
88
plugins:
99
totals:
1010
statements: 33.33%
@@ -80,7 +80,7 @@ coverage:
8080
branches: 0%
8181
functions: 0%
8282
lines: 0%
83-
uncovered_line_numbers: "14-200"
83+
uncovered_line_numbers: "14-218"
8484
"test.mts":
8585
statements: 0%
8686
branches: 0%

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"vitest": "^3.2.4",
2424
"yaml": "^2.8.1"
2525
},
26-
"version": "1.5.1",
26+
"version": "1.6.0",
2727
"name": "@instructure.ai/shared-configs",
2828
"packageManager": "[email protected]",
2929
"private": true,

0 commit comments

Comments
 (0)