Skip to content

Commit

Permalink
build commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dsod committed Feb 7, 2024
1 parent 7ddda08 commit c33d42a
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 76 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ jobs:
- uses: pnpm/action-setup@v2
with:
version: 8

# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

# Run CI
- run: pnpm i --frozen-lockfile
- uses: nrwl/nx-set-shas@v4

- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build
- uses: nrwl/nx-set-shas@v4
- run: pnpm biome check --changed --since=${{ env.NX_BASE }} --files-ignore-unknown=true
- run: pnpm nx affected -t lint test build
9 changes: 1 addition & 8 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@
"libsDir": "packages"
},
"nxCloudAccessToken": "MTEwOTM4NjctMWQ0Yy00ODliLWE5ODctZDhkMGI4ZDVkMDNifHJlYWQtd3JpdGU=",
"plugins": [
{
"plugin": "@nx/eslint/plugin",
"options": {
"targetName": "lint"
}
}
]
"plugins": []
}
1 change: 1 addition & 0 deletions packages/css/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"prepare-build": {
"executor": "nx:run-commands",
"options": {
"cwd": "packages/css",
"command": "pnpm panda codegen"
}
}
Expand Down
16 changes: 1 addition & 15 deletions packages/qwik/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
{
"type": "module",
"scripts": {
"build": "qwik build",
"build.lib": "vite build --mode lib",
"build.types": "tsc --emitDeclarationOnly",
"dev": "vite --mode ssr",
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
"fmt": "prettier --write .",
"fmt.check": "prettier --check .",
"lint": "eslint \"src/**/*.ts*\"",
"release": "np",
"start": "vite --open --mode ssr",
"test": "echo \"No test specified\" && exit 0",
"qwik": "qwik"
}
"type": "module"
}
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions packages/qwik/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"cwd": "packages/qwik",
"command": "pnpm panda codegen"
}
},
"build": {
"executor": "@nx/vite:build",
"options": {
"outputPath": "dist/qwik"
}
}
},
"tags": []
Expand Down
6 changes: 1 addition & 5 deletions packages/qwik/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/css",
"declaration": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"jsxImportSource": "@builder.io/qwik",
"noEmit": true,
"isolatedModules": true,
"types": ["vite/client"]
},
"include": ["src/**/*.tsx"],
Expand Down
20 changes: 3 additions & 17 deletions packages/qwik/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
import { qwikVite } from "@builder.io/qwik/optimizer";
import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin";
import { defineConfig } from "vite";
import pkg from "./package.json";

type Packages = typeof pkg & {
dependencies: Record<string, string>;
peerDependencies: Record<string, string>;
};
const { dependencies = {}, peerDependencies = {} } = pkg as Packages;
const makeRegex = (dep) => new RegExp(`^${dep}(/.*)?$`);
const excludeAll = (obj) => Object.keys(obj).map(makeRegex);

export default defineConfig(() => {
return {
build: {
target: "es2020",
lib: {
entry: "./src/index.ts",
entry: "./src/index.tsx",
formats: ["es", "cjs"],
fileName: (format) => `index.qwik.${format === "es" ? "mjs" : "cjs"}`,
},
rollupOptions: {
// externalize deps that shouldn't be bundled into the library
external: [/^node:.*/, ...excludeAll(dependencies), ...excludeAll(peerDependencies)],
fileName: (format) => `index.${format === "es" ? "mjs" : "cjs"}`,
},
},
plugins: [qwikVite(), nxViteTsPaths()],
plugins: [nxViteTsPaths()],
};
});
11 changes: 0 additions & 11 deletions packages/react/.eslintrc.cjs

This file was deleted.

8 changes: 1 addition & 7 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
}
"type": "module"
}
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions packages/react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"cwd": "packages/react",
"command": "pnpm panda codegen"
}
},
"build": {
"executor": "@nx/vite:build",
"options": {
"outputPath": "dist/react"
}
}
},
"tags": []
Expand Down
4 changes: 2 additions & 2 deletions packages/react/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"moduleResolution": "bundler",
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx"
"jsx": "react-jsx",
"types": ["vite/client"]
},
"include": ["src/**/*.tsx"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
Expand Down
8 changes: 8 additions & 0 deletions packages/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ import { defineConfig } from "vite";

// https://vitejs.dev/config/
export default defineConfig({
build: {
target: "es2020",
lib: {
entry: "./src/index.tsx",
formats: ["es", "cjs"],
fileName: (format) => `index.${format === "es" ? "mjs" : "cjs"}`,
},
},
plugins: [react(), nxViteTsPaths()],
});
3 changes: 3 additions & 0 deletions packages/solidjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
2 changes: 2 additions & 0 deletions packages/solidjs/panda.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { getDefaultConfig } from "../../panda.base.config.js";
export default getDefaultConfig(__dirname);
2 changes: 2 additions & 0 deletions packages/solidjs/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { getDefaultConfig } from "../../postcss.base.config.js";
export default getDefaultConfig();
6 changes: 6 additions & 0 deletions packages/solidjs/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
"cwd": "packages/solidjs",
"command": "pnpm panda codegen"
}
},
"build": {
"executor": "@nx/vite:build",
"options": {
"outputPath": "dist/solidjs"
}
}
},
"tags": []
Expand Down
4 changes: 1 addition & 3 deletions packages/solidjs/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"noEmit": true,
"isolatedModules": true,
"types": ["vite/client"]
},
"include": ["src/**/*.tsx"],
Expand Down
9 changes: 7 additions & 2 deletions packages/solidjs/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";

export default defineConfig({
plugins: [solidPlugin(), nxViteTsPaths()],
build: {
target: "esnext",
target: "es2020",
lib: {
entry: "./src/index.tsx",
formats: ["es", "cjs"],
fileName: (format) => `index.${format === "es" ? "mjs" : "cjs"}`,
},
},
plugins: [solidPlugin(), nxViteTsPaths()],
});

0 comments on commit c33d42a

Please sign in to comment.