Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infra: Bump TypeScript, add main exports #472

Merged
merged 12 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/sweet-singers-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@ithaka/pharos': major
'@ithaka/pharos-site': major
---

individual file exports are no longer supported, import files based on the exports defined in the package.json
2 changes: 1 addition & 1 deletion .storybook/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
PharosColorMarbleGray50,
PharosColorMarbleGray20,
PharosFontFamilyBody,
} from '../packages/pharos/lib/styles/variables.js';
} from '../packages/pharos/lib/styles/variables';
import '../packages/pharos/lib/styles/fonts.css';
Comment on lines -9 to 10
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried to standardize the exports.
what i have so far is .js should always drop the extension and anything else should always include the extension


export default create({
Expand Down
2 changes: 1 addition & 1 deletion packages/pharos-site/initComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const pharos = typeof window !== `undefined` ? require('@ithaka/pharos/lib/index') : null;
const pharos = typeof window !== `undefined` ? require('@ithaka/pharos') : null;
const registerComponents =
typeof window !== `undefined` ? require('@ithaka/pharos/lib/utils/registerComponents') : null;

Expand Down
5 changes: 4 additions & 1 deletion packages/pharos-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@
"type": "git",
"url": "git+https://github.com/ithaka/pharos.git",
"directory": "site"
},
"exports": {
"./lib/utils/scss/mixins.scss": "./lib/utils/scss/mixins.scss"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC, CSSProperties } from 'react';
import { colorBox } from './ColorCombos.module.css';
import tokens from '@ithaka/pharos/lib/styles/tokens.js';
import tokens from '@ithaka/pharos/lib/styles/tokens';
import CrossOut from '../CrossOut';
import { toTitleCase } from '../../../utils/textConvert';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import type { FC, ReactElement } from 'react';
import tokens from '@ithaka/pharos/lib/styles/tokens.js';
import tokens from '@ithaka/pharos/lib/styles/tokens';
import { colorGradient, gradientLabel, gradientContainer } from './ColorGradients.module.css';

interface Gradient {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import type { FC, ReactElement, CSSProperties } from 'react';
import tokens from '@ithaka/pharos/lib/styles/tokens.js';
import tokens from '@ithaka/pharos/lib/styles/tokens';
import {
figure,
colorSwatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC, CSSProperties } from 'react';
import { container, container_text } from './ColorTextSquares.module.css';
import tokens from '@ithaka/pharos/lib/styles/tokens.js';
import tokens from '@ithaka/pharos/lib/styles/tokens';
import { toTitleCase } from '../../../utils/textConvert';

interface ColorTextSquaresProps {
Expand Down
19 changes: 17 additions & 2 deletions packages/pharos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,22 @@
"sinon": "^12.0.1",
"style-dictionary": "^3.0.1",
"ts-lit-plugin": "^1.2.1",
"typescript": "^4.5.2"
"typescript": "^4.9.4"
},
"customElements": "custom-elements.json"
"customElements": "custom-elements.json",
"exports": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think you'll want to add a changeset and designate it as a breaking change since individual component imports will be invalid.

".": "./lib/index.js",
"./lib": "./lib/index.js",
"./lib/index": "./lib/index.js",
"./lib/react-components": "./lib/react-components/index.js",
"./lib/styles/*": "./lib/styles/*.js",
"./lib/styles/*.css": "./lib/styles/*.css",
"./lib/styles/*.scss": "./lib/styles/*.scss",
"./lib/styles/pharos": "./lib/styles/pharos.scss",
"./lib/utils/scss/mixins": "./lib/utils/scss/_mixins.scss",
"./lib/utils/registerComponents": "./lib/utils/registerComponents.js",
"./lib/utils/PharosContext": "./lib/utils/PharosContext.js",
"./package.json": "./package.json",
"./custom-elements.json": "./custom-elements.json"
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20174,6 +20174,11 @@ typescript@^4.4.3, typescript@^4.5.2:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==

typescript@^4.9.4:
version "4.9.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==

typescript@~4.3.2:
version "4.3.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
Expand Down