Skip to content

Commit

Permalink
Merge pull request #89 from stone-lyl/main
Browse files Browse the repository at this point in the history
build: optimize the build issues with core and ui
  • Loading branch information
stone-lyl authored Dec 19, 2023
2 parents eb52371 + c6be626 commit a04efa8
Show file tree
Hide file tree
Showing 23 changed files with 301 additions and 1,345 deletions.
10 changes: 8 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Ignore all files in the 'dist' directory
dist/*

**/dist/**/*

# Ignore all '.min.js' files
*.min.js

# Temporary measure while migrating nodes
holding/**/*
holding/**/*
.github
.husky
.turbo
.yarn

1 change: 0 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default defineConfig({
},

e2e: {

baseUrl: 'http://localhost:3000',
setupNodeEvents(on, config) {
// implement node event listeners here
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
import '../../packages/ui/output.css';
import '@data-story/ui/data-story.css';

import { mount } from 'cypress/react18'

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
"husky": "^8.0.0",
"kill-port": "^2.0.1",
"lint-staged": "^15.0.2",
"postcss-cli": "^11.0.0",
"release-it": "^17.0.0",
"start-server-and-test": "^2.0.3",
"turbo": "^1.10.12",
"vitest": "^0.29.2"
"vitest": "^0.29.2",
"webpack-bundle-analyzer": "^4.10.1"
}
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"tinker": "npx ts-node ./src/tinker.ts",
"test": "yarn run -T vitest run",
"watch:test": "yarn run -T vitest",
"build": "tsc",
"build": "tsc -p tsconfig.build.json",
"release": "yarn run -T release-it"
},
"release-it": {
Expand Down
42 changes: 42 additions & 0 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"compilerOptions": {
"target": "ES6",
"lib": [
"esnext"
],
"allowJs": true,
"checkJs": false,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"outDir": "dist",
"esModuleInterop": true,
"module": "commonjs",
"sourceMap": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"noImplicitAny": true,
"types": [
"vitest/globals"
],
"declaration": true
},
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
},
"include": [
"./src/**/*.ts",
"global.d.ts"
],
"exclude": [
"./node_modules",
"./src/**/*.spec.ts",
"./src/**/*.test.ts",
"./src/**/*.cy.ts",
"./src/**/*.d.ts",
]
}
1 change: 0 additions & 1 deletion packages/docs/components/Playground.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DataStory } from '@data-story/ui'
import '@data-story/ui/dist/data-story.css';
import { coreNodeProvider, Application, DiagramBuilder } from '@data-story/core';

export default ({ mode}: { mode?: 'js' | 'node' }) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/docs/components/demos/DocsFlow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DataStory } from '@data-story/ui'
import '@data-story/ui/dist/data-story.css';
import {
Application,
DiagramBuilder,
Expand Down Expand Up @@ -46,4 +45,4 @@ export default () => {
/>
</div>
);
};
};
3 changes: 1 addition & 2 deletions packages/docs/components/demos/HeroFlow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DataStory } from '@data-story/ui'
import '@data-story/ui/dist/data-story.css';
import {
Application,
DiagramBuilder,
Expand Down Expand Up @@ -66,4 +65,4 @@ export default () => {
/>
</div>
);
};
};
3 changes: 1 addition & 2 deletions packages/docs/components/demos/NodeDemo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DataStory, DataStoryNodeComponent } from '@data-story/ui'
import '@data-story/ui/dist/data-story.css';
import { Application, DiagramBuilder, nodes, coreNodeProvider } from '@data-story/core';

export default ({ nodeName }: { nodeName: string}) => {
Expand All @@ -24,4 +23,4 @@ export default ({ nodeName }: { nodeName: string}) => {
</div>
</div>
);
};
};
3 changes: 1 addition & 2 deletions packages/docs/components/pitchdeck/1.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DataStory } from '@data-story/ui'
import '@data-story/ui/dist/data-story.css';
import { coreNodeProvider, Application, DiagramBuilder, multiline } from '@data-story/core';
import { ConsoleLog, Map, Signal, Fake, Comment } from '@data-story/core/dist/computers';

Expand Down Expand Up @@ -62,4 +61,4 @@ export default () => {
/>
</div>
);
};
};
3 changes: 1 addition & 2 deletions packages/docs/components/pitchdeck/2.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DataStory } from '@data-story/ui'
import '@data-story/ui/dist/data-story.css';
import { coreNodeProvider, Application, DiagramBuilder, multiline } from '@data-story/core';
import { ConsoleLog, Map, Signal, Fake, Comment } from '@data-story/core/dist/computers';

Expand Down Expand Up @@ -56,4 +55,4 @@ export default () => {
/>
</div>
);
};
};
4 changes: 3 additions & 1 deletion packages/docs/globals.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '@data-story/ui/data-story.css';

@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;
2 changes: 1 addition & 1 deletion packages/docs/pages/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn add @data-story/ui

```js copy
import { DataStory } from '@data-story/ui'
import '@data-story/ui/dist/data-story.css';
import '@data-story/ui/data-story.css';

export default function Home() {
return (
Expand Down
3 changes: 1 addition & 2 deletions packages/docs/pages/local.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { DataStory } from '@data-story/ui';
import '@data-story/ui/dist/data-story.css';

export default function Home() {
return <div className="w-full" style={{ height: '100vh' }}>
<DataStory server={{type: 'SOCKET', url: 'http://localhost:3000'}} />
</div>
}
}
6 changes: 1 addition & 5 deletions packages/ui/cypress-webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ const config: webpack.Configuration = {
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource'
},
}
],
},
resolve: {
Expand Down
Loading

0 comments on commit a04efa8

Please sign in to comment.