Reference lang source code directly from components
This commit is contained in:
parent
e836520b9f
commit
543dde9144
42
.github/workflows/ci.yaml
vendored
42
.github/workflows/ci.yaml
vendored
|
@ -32,37 +32,28 @@ jobs:
|
||||||
name: Language build and test
|
name: Language build and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: pre_check
|
needs: pre_check
|
||||||
if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' || needs.pre_check.outputs.should_skip_components != 'true' }}
|
if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: packages/squiggle-lang
|
working-directory: packages/squiggle-lang
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
# - name: Install packages from monorepo level
|
- name: Install dependencies from monorepo level
|
||||||
# run: cd ../../ && yarn
|
run: cd ../../ && yarn
|
||||||
- name: Install packages
|
# - name: Install dependencies
|
||||||
run: yarn
|
# run: yarn
|
||||||
- name: Build rescript codebase
|
- name: Build rescript codebase
|
||||||
run: yarn build
|
run: yarn build
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: yarn test
|
run: yarn test
|
||||||
- name: Run tsc and webpack
|
- name: Run tsc and webpack
|
||||||
run: yarn bundle
|
run: yarn bundle
|
||||||
- name: Cache lang build and bundle outputs
|
|
||||||
uses: actions/cache@v3
|
|
||||||
id: lang-outputs
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
lib
|
|
||||||
dist
|
|
||||||
node_modules
|
|
||||||
key: ${{ github.sha }}
|
|
||||||
|
|
||||||
components-build-test:
|
components-build-test:
|
||||||
name: Components build and test
|
name: Components build and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [pre_check, lang-build-test]
|
needs: [pre_check]
|
||||||
if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }}
|
if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
@ -70,19 +61,12 @@ jobs:
|
||||||
working-directory: packages/components
|
working-directory: packages/components
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Gain lang build and bundle outputs from cache
|
- name: Build rescript in squiggle-lang
|
||||||
uses: actions/cache@v3
|
run: cd ../squiggle-lang && yarn build
|
||||||
id: lang-outputs
|
- name: Install dependencies from monorepo level
|
||||||
with:
|
run: cd ../../ && yarn
|
||||||
path: |
|
# - name: Install dependencies for components package
|
||||||
lib
|
# run: yarn
|
||||||
dist
|
|
||||||
node_modules
|
|
||||||
key: ${{ github.sha }}
|
|
||||||
# - name: Install packages from monorepo level
|
|
||||||
# run: cd ../../ && yarn
|
|
||||||
- name: Install packages for components package
|
|
||||||
run: yarn
|
|
||||||
- name: Run tsc and webpack # I'm uncertain if bundle comes before build, it was jotted down in a readme that way but it may have been erroneous.
|
- name: Run tsc and webpack # I'm uncertain if bundle comes before build, it was jotted down in a readme that way but it may have been erroneous.
|
||||||
run: yarn bundle
|
run: yarn bundle
|
||||||
- name: Build storybook
|
- name: Build storybook
|
||||||
|
@ -99,7 +83,7 @@ jobs:
|
||||||
working-directory: packages/website
|
working-directory: packages/website
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install packages
|
- name: Install dependencies
|
||||||
run: yarn
|
run: yarn
|
||||||
- name: Build website assets
|
- name: Build website assets
|
||||||
run: yarn build
|
run: yarn build
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cross-env REACT_APP_FAST_REFRESH=false && start-storybook -p 6006 -s public",
|
"start": "cross-env REACT_APP_FAST_REFRESH=false && start-storybook -p 6006 -s public",
|
||||||
"build": "build-storybook -s public",
|
"build": "build-storybook -s public",
|
||||||
"bundle": "tsc && webpack",
|
"bundle": "webpack",
|
||||||
"all": "yarn bundle && yarn build"
|
"all": "yarn bundle && yarn build"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
@ -80,7 +80,6 @@
|
||||||
"@types/react": "17.0.39"
|
"@types/react": "17.0.39"
|
||||||
},
|
},
|
||||||
"source": "./src/index.ts",
|
"source": "./src/index.ts",
|
||||||
"module": "dist/index.js",
|
|
||||||
"main": "dist/bundle.js",
|
"main": "dist/bundle.js",
|
||||||
"types": "dist/index.d.ts"
|
"types": "dist/src/index.d.ts"
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import type {
|
||||||
} from "@quri/squiggle-lang";
|
} from "@quri/squiggle-lang";
|
||||||
import { createClassFromSpec } from "react-vega";
|
import { createClassFromSpec } from "react-vega";
|
||||||
import * as chartSpecification from "./spec-distributions.json";
|
import * as chartSpecification from "./spec-distributions.json";
|
||||||
import * as percentilesSpec from "./spec-pertentiles.json";
|
import * as percentilesSpec from "./spec-percentiles.json";
|
||||||
|
|
||||||
let SquiggleVegaChart = createClassFromSpec({
|
let SquiggleVegaChart = createClassFromSpec({
|
||||||
spec: chartSpecification as Spec,
|
spec: chartSpecification as Spec,
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"paths": {
|
||||||
|
"@quri/squiggle-lang": ["../squiggle-lang/src/js"]
|
||||||
|
},
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
@ -7,12 +10,19 @@
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
|
"composite": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"declarationDir": "./dist",
|
"declarationDir": "./dist",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
},
|
},
|
||||||
|
"files": ["src/spec-distributions.json","src/spec-percentiles.json"],
|
||||||
"target": "ES6",
|
"target": "ES6",
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*", "src/*"],
|
||||||
"exclude": ["node_modules", "**/*.spec.ts"]
|
"exclude": ["node_modules", "**/*.spec.ts"],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "../squiggle-lang"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,17 @@ module.exports = {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.tsx?$/,
|
test: /\.tsx?$/,
|
||||||
use: "ts-loader",
|
loader: "ts-loader",
|
||||||
|
options: { projectReferences: true },
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".js", ".tsx", ".ts"],
|
extensions: [".js", ".tsx", ".ts"],
|
||||||
|
alias: {
|
||||||
|
"@quri/squiggle-lang": path.resolve(__dirname, '../squiggle-lang/src/js')
|
||||||
|
},
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
filename: "bundle.js",
|
filename: "bundle.js",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"homepage": "https://squiggle-language.com",
|
"homepage": "https://squiggle-language.com",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rescript build -with-deps",
|
"build": "rescript build -with-deps",
|
||||||
"bundle": "tsc && webpack",
|
"bundle": "webpack",
|
||||||
"start": "rescript build -w -with-deps",
|
"start": "rescript build -w -with-deps",
|
||||||
"clean": "rescript clean",
|
"clean": "rescript clean",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"declarationDir": "./dist",
|
"declarationDir": "./dist",
|
||||||
"declaration": true
|
"declaration": true,
|
||||||
|
"composite": true
|
||||||
},
|
},
|
||||||
"target": "ES6",
|
"target": "ES6",
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user