Skip to content

Commit

Permalink
Infra: Bump TypeScript, add main exports (#472)
Browse files Browse the repository at this point in the history
* feat: bump typscript, add main exports

* feat: use yarn registry

* feat: export style paths

* feat: comment mixins to test

* feat: export sass files

* feat: export react components

* feat: expose utils styles

* feat: sort out exports and file extensions

* feat: remove dupe export

* feat: use pattern to export styles

* feat: explicitly export pharos.scss

* chore: add changeset
  • Loading branch information
Christopher Brown committed Jan 20, 2023
1 parent 6daf2ca commit eaa514f
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 9 deletions.
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';

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": {
".": "./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

0 comments on commit eaa514f

Please sign in to comment.