Skip to content

Commit

Permalink
fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Nov 11, 2024
1 parent 1b892eb commit db40e1c
Show file tree
Hide file tree
Showing 18 changed files with 6,092 additions and 1,600 deletions.
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
.output
.vinxi
node_modules
2 changes: 1 addition & 1 deletion packages/app/public/github-workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -1719,4 +1719,4 @@
},
"required": ["on", "jobs"],
"type": "object"
}
}
8 changes: 4 additions & 4 deletions packages/app/public/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ name: Node.js CI

on:
push:
branches: [ $default-branch ]
branches: [$default-branch]
pull_request:
branches: [ $default-branch ]
branches: [$default-branch]

jobs:
build:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x, 20.x, 22.x ]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
Expand All @@ -25,4 +25,4 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run build --if-present
4 changes: 2 additions & 2 deletions packages/app/src/components/Counter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSignal } from "solid-js";
import "./Counter.css";
import {createSignal} from 'solid-js';
import './Counter.css';

export default function Counter() {
const [count, setCount] = createSignal(0);
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/entry-client.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @refresh reload
import { mount, StartClient } from "@solidjs/start/client";
import {mount, StartClient} from '@solidjs/start/client';

mount(() => <StartClient />, document.getElementById("app")!);
mount(() => <StartClient />, document.getElementById('app')!);
36 changes: 14 additions & 22 deletions packages/app/src/mocks/data/codeimage-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Main

on:
pull_request:
types: [ opened, synchronize, reopened, edited, assigned ]
types: [opened, synchronize, reopened, edited, assigned]
pull_request_target:
types: [ opened, synchronize, reopened, edited, assigned ]
types: [opened, synchronize, reopened, edited, assigned]
branches:
- changeset-release/main


env:
IS_MAIN_BRANCH: ${{ github.head_ref == 'main' }}
IS_NEXT_BRANCH: ${{ github.head_ref == 'next' }}
Expand Down Expand Up @@ -74,7 +73,7 @@ jobs:

build-packages:
name: Build packages
needs: [ install ]
needs: [install]
runs-on: ubuntu-latest
steps:
- name: Checkout PR
Expand Down Expand Up @@ -103,7 +102,7 @@ jobs:
typecheck-packages:
if: ${{ needs.install.outputs.libs-change == 'true' }}
name: Type-checking
needs: [ install, build-packages ]
needs: [install, build-packages]
runs-on: ubuntu-latest
steps:
- name: Checkout PR
Expand Down Expand Up @@ -137,7 +136,7 @@ jobs:
build-app-dev:
name: Build App and Preview (Dev)
environment: Preview
needs: [ build-packages ]
needs: [build-packages]
if: ${{ github.head_ref != 'next' }}
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -180,11 +179,10 @@ jobs:
alias-domains: | #Optional
codeimage-app-pr-{{PR_NUMBER}}.vercel.app
build-app-next:
name: Build App and Preview (Next)
environment: Next
needs: [ build-packages ]
needs: [build-packages]
if: ${{ github.head_ref == 'next' }}
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -231,7 +229,7 @@ jobs:
build-highlight-dev:
name: '@codeimage/highlight dev and Preview'
environment: Preview
needs: [ build-packages ]
needs: [build-packages]
if: (${{ needs.install.outputs.app-change == 'true' }} || ${{ needs.install.outputs.libs-change == 'true' }})
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -268,7 +266,7 @@ jobs:
build-website-dev:
name: '@codeimage/website dev and Preview'
environment: Preview
needs: [ build-packages ]
needs: [build-packages]
if: (${{ needs.install.outputs.app-change == 'true' }} || ${{ needs.install.outputs.libs-change == 'true' }})
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -314,7 +312,7 @@ jobs:

website-lhci:
name: Lighthouse
needs: [ build-website-dev ]
needs: [build-website-dev]
runs-on: ubuntu-latest
steps:
- name: Checkout PR
Expand All @@ -339,7 +337,7 @@ jobs:

build-api:
name: Build Api
needs: [ install, build-packages ]
needs: [install, build-packages]
runs-on: ubuntu-latest

steps:
Expand All @@ -350,7 +348,7 @@ jobs:
- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: "[API] Generate Prisma Migration"
- name: '[API] Generate Prisma Migration'
run: |
pnpm --filter=@codeimage/api exec prisma generate
pnpm --filter=@codeimage/prisma-models build
Expand All @@ -371,7 +369,7 @@ jobs:
be-test:
if: ${{ needs.install.outputs.backend-change == 'true' }}
name: Api test
needs: [ install ]
needs: [install]
runs-on: ubuntu-latest

services:
Expand Down Expand Up @@ -433,13 +431,7 @@ jobs:
if: ${{ github.head_ref == 'next' }}
environment: Next
name: Deploy next
needs: [
lint,
build-packages,
build-api,
be-test,
build-app-next
]
needs: [lint, build-packages, build-api, be-test, build-app-next]
runs-on: ubuntu-latest
steps:
- name: Checkout PR
Expand Down Expand Up @@ -480,4 +472,4 @@ jobs:

concurrency:
group: main-${{ github.head_ref }}
cancel-in-progress: true
cancel-in-progress: true
2 changes: 1 addition & 1 deletion packages/app/src/mocks/data/codeimage-prod-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,4 @@ jobs:
pnpm exec netlify deploy --prod --dir=dist/public
env:
NETLIFY_SITE_ID: ${{ secrets.WEBSITE_NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.WEBSITE_NETLIFY_AUTH_TOKEN }}
NETLIFY_AUTH_TOKEN: ${{ secrets.WEBSITE_NETLIFY_AUTH_TOKEN }}
8 changes: 4 additions & 4 deletions packages/app/src/routes/[...404].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Title } from "@solidjs/meta";
import { HttpStatusCode } from "@solidjs/start";
import {Title} from '@solidjs/meta';
import {HttpStatusCode} from '@solidjs/start';

export default function NotFound() {
return (
Expand All @@ -8,10 +8,10 @@ export default function NotFound() {
<HttpStatusCode code={404} />
<h1>Page Not Found</h1>
<p>
Visit{" "}
Visit{' '}
<a href="https://start.solidjs.com" target="_blank">
start.solidjs.com
</a>{" "}
</a>{' '}
to learn how to build SolidStart apps.
</p>
</main>
Expand Down
24 changes: 12 additions & 12 deletions packages/workflow-languageserver/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"include": ["src", "workflow-parser/node.ts"],
"compilerOptions": {
"module": "esnext",
"target": "ES2022",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "node",
"resolveJsonModule": true
},
}
"include": ["src", "workflow-parser/node.ts"],
"compilerOptions": {
"module": "esnext",
"target": "ES2022",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "node",
"resolveJsonModule": true
}
}
26 changes: 13 additions & 13 deletions packages/workflow-languageserver/tsup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { defineConfig } from "tsup";
import {defineConfig} from 'tsup';

export default defineConfig({
entry: ['src/index.ts'],
format: 'esm',
target: 'es2022',
keepNames: true,
treeshake: false,
platform: 'browser',
noExternal: [/@actions/],
dts: true,
esbuildOptions(options, context) {
(options.alias ??= {}).global = 'globalThis';
},
})
entry: ['src/index.ts'],
format: 'esm',
target: 'es2022',
keepNames: true,
treeshake: false,
platform: 'browser',
noExternal: [/@actions/],
dts: true,
esbuildOptions(options, context) {
(options.alias ??= {}).global = 'globalThis';
},
});
2 changes: 1 addition & 1 deletion packages/workflow-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ workflows. Main issues are also related to the exported format, which seems to h
## Development

This package contains a `snapshot` folder which is a snapshot of @actions/workflow-parser@0.3.13.
In order to apply patch to the package, develop on it, then call the `patch-parser` command.
In order to apply patch to the package, develop on it, then call the `patch-parser` command.
11 changes: 7 additions & 4 deletions packages/workflow-parser/snapshot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,25 @@ var trace: TraceWriter;

const result = parseWorkflow(
{
name: "test.yaml",
name: 'test.yaml',
content: `on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo 'hello'`
- run: echo 'hello'`,
},
trace
trace,
);
```

`convertWorkflowTemplate` then takes that intermediate representation and converts it to a [`WorkflowTemplate`](./src/model/workflow-template.ts) object, which is a more convenient representation for working with workflows.

```typescript
const workflowTemplate = await convertWorkflowTemplate(result.context, result.value);
const workflowTemplate = await convertWorkflowTemplate(
result.context,
result.value,
);

// workflowTemplate.jobs[0].id === "build"
// workflowTemplate.jobs[0].steps[0].run === "echo 'hello'"
Expand Down
16 changes: 4 additions & 12 deletions packages/workflow-parser/test/data/generated.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"events": {
"push": {
"branches": [
"$default-branch"
]
"branches": ["$default-branch"]
},
"pull_request": {
"branches": [
"$default-branch"
]
"branches": ["$default-branch"]
}
},
"jobs": [
Expand Down Expand Up @@ -88,11 +84,7 @@
"Key": "node-version",
"Value": {
"type": 1,
"seq": [
"18.x",
"20.x",
"22.x"
]
"seq": ["18.x", "20.x", "22.x"]
}
}
]
Expand Down Expand Up @@ -141,4 +133,4 @@
]
}
]
}
}
8 changes: 4 additions & 4 deletions packages/workflow-parser/test/data/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ name: Node.js CI

on:
push:
branches: [ $default-branch ]
branches: [$default-branch]
pull_request:
branches: [ $default-branch ]
branches: [$default-branch]

jobs:
build:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x, 20.x, 22.x ]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
Expand All @@ -25,4 +25,4 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run build --if-present
9 changes: 2 additions & 7 deletions packages/workflow-parser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"include": [
"src",
"scripts",
"test",
"workflow-parser/node.ts"
],
"include": ["src", "scripts", "test", "workflow-parser/node.ts"],
"compilerOptions": {
"module": "esnext",
"target": "ES2022",
Expand All @@ -17,4 +12,4 @@
"isolatedModules": true,
"preserveSymlinks": true
}
}
}
Loading

0 comments on commit db40e1c

Please sign in to comment.