Skip to content

fix: improves the packaging #303

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

Merged
merged 1 commit into from
Oct 12, 2022
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
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
"postCreateCommand": "npm ci",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
Expand Down
21 changes: 15 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
**/tsconfig.json
**/webpack.config.js
node_modules
src
stories
example
lib
lib-esm
_bundles
tsdx.config.js
generators
public
src
build.mjs
coverage
dangerfile.lite.ts
dangerfile.ts
jest.config.js
jest.patch-cssom.js
sonar-project.properties
spellcheck.json
test-report.xml
tsconfig.build.json
tsconfig.json
tsconfig.storybook.json
8 changes: 4 additions & 4 deletions build.js → build.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const { build } = require('esbuild')
const { peerDependencies } = require('./package.json')
import { build } from 'esbuild'
import { nodeExternalsPlugin } from 'esbuild-node-externals'

const entryFile = 'src/index.ts'
const outFolder = 'dist'

const shared = {
bundle: true,
entryPoints: [entryFile],
external: Object.keys(peerDependencies),
logLevel: 'info',
minify: true,
sourcemap: true,
target: ['esnext', 'node12.22.0'],
target: ['esnext'],
plugins: [nodeExternalsPlugin()],
}

build({
Expand Down
19 changes: 6 additions & 13 deletions generators/Component.test.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import React from 'react'
import { renderLight, renderDark } from 'test-utils'
import { Default } from './{{ name }}.stories'

it('renders light without error', () => {
const { asFragment } = renderLight(<Default />)
expect(asFragment()).toBeDefined()
})

it('renders dark without error', () => {
const { asFragment } = renderDark(<Default />)
expect(asFragment()).toBeDefined()
})
import React from 'react' import { renderLight, renderDark } from '../../test'
import { Default } from './{{name}}.stories' it('renders light without error',
() => { const { asFragment } = renderLight(<Default />)
expect(asFragment()).toBeDefined() }) it('renders dark without error', () => {
const { asFragment } = renderDark(<Default />)
expect(asFragment()).toBeDefined() })
Loading