Skip to content

Commit 4750dc3

Browse files
author
Ale Ornelas
committed
ci: build with ts-node
1 parent ad41047 commit 4750dc3

File tree

5 files changed

+122
-950
lines changed

5 files changed

+122
-950
lines changed

assets/build.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import esbuild from 'esbuild'
2-
import { sassPlugin } from 'esbuild-sass-plugin'
3-
import path from 'path'
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
import type { PluginBuild, Plugin, LogLevel } from 'esbuild'
3+
4+
const esbuild = require('esbuild') as PluginBuild['esbuild']
5+
const { sassPlugin } = require('esbuild-sass-plugin')
6+
const path = require('path')
47

58
const bundle = true
6-
const logLevel = (process.env.ESBUILD_LOG_LEVEL ?? 'silent') as esbuild.LogLevel
9+
const logLevel = (process.env.ESBUILD_LOG_LEVEL ?? 'silent') as LogLevel
710
const watch = typeof process.env.ESBUILD_WATCH === 'string'
811

9-
const plugins: esbuild.Plugin[] = [
12+
const plugins: Plugin[] = [
1013
sassPlugin({
1114
includePaths: [path.resolve(__dirname, 'node_modules')]
12-
}) as unknown as esbuild.Plugin
15+
}) as unknown as Plugin
1316
]
1417

1518
const promise = esbuild.build({

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ defmodule Librecov.Mixfile do
114114
"ecto.setup": ["ecto.create", "ecto.migrate"],
115115
"ecto.reset": ["ecto.drop", "ecto.setup"],
116116
"assets.deploy": [
117-
"cmd --cd assets node build.ts",
117+
"cmd --cd assets ts-node build.ts",
118118
"phx.digest"
119119
],
120120
sentry_recompile: ["compile", "deps.compile sentry --force"]

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,30 @@
1616
],
1717
"license": "MIT",
1818
"devDependencies": {
19+
"@eslint/eslintrc": "^1.0.4",
1920
"@types/node": "^16.7.8",
2021
"@types/phoenix": "^1.5.2",
2122
"@types/phoenix_live_view": "^0.15.1",
23+
"@typescript-eslint/eslint-plugin": "^5.5.0",
24+
"@typescript-eslint/parser": "^5.5.0",
2225
"cz-conventional-changelog": "3.3.0",
2326
"esbuild": "^0.14.0",
2427
"esbuild-sass-plugin": "^1.5.2",
25-
"@eslint/eslintrc": "^1.0.4",
2628
"eslint": "^8.3.0",
2729
"eslint-config-prettier": "^8.3.0",
2830
"eslint-config-standard-with-typescript": "^21.0.1",
2931
"eslint-formatter-rdjson": "^1.0.5",
3032
"eslint-plugin-import": "^2.25.3",
3133
"eslint-plugin-node": "^11.1.0",
3234
"eslint-plugin-promise": "^6.0.0",
33-
"@typescript-eslint/eslint-plugin": "^5.5.0",
34-
"@typescript-eslint/parser": "^5.5.0",
3535
"husky": ">=6",
3636
"less": "^4.1.1",
3737
"lint-staged": ">=10",
3838
"popper.js": "^1.16.1",
3939
"prettier": "^2.3.2",
4040
"prettier-config-standard": "^4.0.0",
41-
"sass": "^1.38.1"
41+
"sass": "^1.38.1",
42+
"ts-node": "^10.4.0"
4243
},
4344
"prettier": "prettier-config-standard",
4445
"dependencies": {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"sourceMap": true,
55
"outDir": "./dist/",
66
"noImplicitAny": true,
7-
"module": "es6",
7+
"module": "commonjs",
88
"target": "es5",
99
"jsx": "react",
1010
"allowJs": true,

0 commit comments

Comments
 (0)