Skip to content

Commit

Permalink
Build: Export typescript internally.
Browse files Browse the repository at this point in the history
This gets replaced by `clean-package`.
  • Loading branch information
filiphsps committed Nov 20, 2023
1 parent 55f6bc8 commit b98011e
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 76 deletions.
11 changes: 11 additions & 0 deletions .changeset/rotten-sheep-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@nordcom/nordstar-heading': patch
'@nordcom/nordstar-card': patch
'@nordcom/nordstar-view': patch
'@nordcom/nordstar': patch
'@nordcom/nordstar-system': patch
---

Use typescript codebase directly during development internally.

The `exports` get automatically replaced during packaging as a part of running `clean-package` in the `prepack` and `postpack` script(s).
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@
"editor.wordWrap": "off",
"workbench.editor.restoreViewState": false
},
"cSpell.words": ["Brandly", "Filiph", "Nordcom", "nordstar", "Sandström", "Siitam", "typecheck"],
"cSpell.words": [
"Brandly",
"Filiph",
"Nordcom",
"nordstar",
"postbuild",
"postpack",
"Sandström",
"Siitam",
"typecheck"
],
"markdown.extension.list.indentationSize": "inherit",
"markdown.extension.toc.levels": "2..6",
"markdown.extension.toc.omittedFromToc": {
Expand Down
4 changes: 2 additions & 2 deletions clean-package.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./package.json": "./package.json"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"prettier": "@nordcom/prettier",
"scripts": {
"dev": "next dev --turbo",
"dev": "next dev",
"build": "next build",
"start": "next start -p $PORT",
"lint": "concurrently npm:lint:*",
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"name": "nordstar",
"type": "module",
"private": true,
"description": "Nordcom Group Inc.'s component library, a modern, accessible, beautiful, and flexible design system for building human user interfaces.",
"main": "index.js",
"prettier": "@nordcom/prettier",
"workspaces": [
Expand All @@ -18,9 +17,9 @@
},
"scripts": {
"prepare": "husky install",
"dev": "concurrently -i --raw npm:dev:*",
"dev": "concurrently -i --raw npm:dev:",
"dev:docs": "turbo dev --filter=@nordcom/nordstar-docs",
"dev:packages": "turbo dev --filter=!@nordcom/nordstar-docs --filter=!@nordcom/nordstar-storybook",
"dev:packages": "",
"dev:storybook": "turbo dev --filter=@nordcom/nordstar-storybook",
"build": "turbo build",
"build:docs": "turbo build --filter=@nordcom/nordstar-docs",
Expand Down
18 changes: 8 additions & 10 deletions packages/components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
"type": "module",
"version": "0.0.10",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./card": {
"import": "./dist/card.js",
"types": "./dist/card.d.ts"
"import": "./src/index.ts",
"types": "./src/index.ts"
}
},
"sideEffects": false,
Expand All @@ -28,7 +24,9 @@
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
"postpack": "clean-package restore",
"prebuild": "npm run prepack",
"postbuild": "npm run postpack"
},
"keywords": [
"nordstar",
Expand Down
18 changes: 8 additions & 10 deletions packages/components/heading/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
"type": "module",
"version": "0.0.10",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./heading": {
"import": "./dist/heading.js",
"types": "./dist/heading.d.ts"
"import": "./src/index.ts",
"types": "./src/index.ts"
}
},
"sideEffects": false,
Expand All @@ -28,7 +24,9 @@
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
"postpack": "clean-package restore",
"prebuild": "npm run prepack",
"postbuild": "npm run postpack"
},
"keywords": [
"nordstar",
Expand Down
1 change: 1 addition & 0 deletions packages/components/heading/src/heading.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Meta } from '@storybook/react';
import React from 'react';
import type { HeadingProps } from '../src';
import { Heading } from '../src';

Expand Down
18 changes: 8 additions & 10 deletions packages/components/view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
"type": "module",
"version": "0.0.10",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./view": {
"import": "./dist/view.js",
"types": "./dist/view.d.ts"
"import": "./src/index.ts",
"types": "./src/index.ts"
}
},
"sideEffects": false,
Expand All @@ -28,7 +24,9 @@
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
"postpack": "clean-package restore",
"prebuild": "npm run prepack",
"postbuild": "npm run postpack"
},
"keywords": [
"nordstar",
Expand Down
3 changes: 2 additions & 1 deletion packages/components/view/src/view.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Meta } from '@storybook/react';
import React from 'react';
import type { ViewProps } from '../src';
import { View } from '../src';

Expand All @@ -10,7 +11,7 @@ const story: Meta<typeof View> = {

const Template = (args: ViewProps) => <View {...args}>You view&apos;s content goes here!</View>;

export const Standard = {
export const Default = {
render: Template,
args: {}
};
Expand Down
14 changes: 8 additions & 6 deletions packages/core/nordstar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"type": "module",
"version": "0.0.10",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"import": "./src/index.ts",
"types": "./src/index.ts"
}
},
"sideEffects": false,
Expand Down Expand Up @@ -52,7 +52,9 @@
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
"postpack": "clean-package restore",
"prebuild": "npm run prepack",
"postbuild": "npm run postpack"
},
"peerDependencies": {
"react": ">=18",
Expand Down
22 changes: 8 additions & 14 deletions packages/core/system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@
"type": "module",
"version": "0.0.10",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./nordstar-provider": {
"import": "./dist/nordstar-provider.js",
"types": "./dist/nordstar-provider.d.ts"
},
"./utils": {
"import": "./dist/utils.js",
"types": "./dist/utils.d.ts"
"import": "./src/index.ts",
"types": "./src/index.ts"
}
},
"sideEffects": false,
Expand Down Expand Up @@ -60,7 +52,9 @@
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
"postpack": "clean-package restore",
"prebuild": "npm run prepack",
"postbuild": "npm run postpack"
},
"peerDependencies": {
"react": ">=18",
Expand Down
14 changes: 5 additions & 9 deletions plop/component/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
"type": "module",
"version": "0.0.0",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./{{componentName}}": {
"import": "./dist/{{componentName}}.js",
"types": "./dist/{{componentName}}.d.ts"
"import": "./src/index.ts",
"types": "./src/index.ts"
}
},
"sideEffects": false,
Expand Down
14 changes: 5 additions & 9 deletions plop/package/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
"type": "module",
"version": "0.0.0",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"module": "./src/index.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./{{packageName}}": {
"import": "./dist/{{packageName}}.js",
"types": "./dist/{{packageName}}.d.ts"
"import": "./src/index.ts",
"types": "./src/index.ts"
}
},
"sideEffects": false,
Expand Down

1 comment on commit b98011e

@vercel
Copy link

@vercel vercel bot commented on b98011e Nov 20, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

nordstar – ./docs

nordstar-git-master-nordcom.vercel.app
nordstar-nordcom.vercel.app
nordstar.nordcom.io
nordstar.vercel.app

Please sign in to comment.