File tree Expand file tree Collapse file tree 13 files changed +121
-45
lines changed
Expand file tree Collapse file tree 13 files changed +121
-45
lines changed Original file line number Diff line number Diff line change 77 release :
88 name : release
99 runs-on : ubuntu-latest
10+ timeout-minutes : 3
1011 steps :
11- - uses : actions/checkout@master
12- - uses : actions/setup-node@v2
12+ - uses : actions/checkout@v3
13+ - uses : actions/setup-node@v3
1314 with :
1415 node-version : " 16"
15- cache : " yarn"
16- - run : yarn install --frozen-lockfile
16+ - run : yarn install
1717 - run : yarn build
1818 - run : yarn release
1919 env :
Original file line number Diff line number Diff line change 1+ name : Check blog
2+ on :
3+ pull_request_target :
4+ types :
5+ - opened
6+ - synchronize
7+ - reopened
8+ branches :
9+ - main
10+ jobs :
11+ build-cli :
12+ name : Package CLI
13+ runs-on : ubuntu-latest
14+ timeout-minutes : 2
15+ steps :
16+ - uses : actions/checkout@v3
17+ with :
18+ ref : ${{ github.event.pull_request.head.sha }}
19+ - uses : actions/setup-node@v3
20+ with :
21+ node-version : " 16"
22+ - run : yarn install
23+ - run : yarn build
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+
3+ import "../dist/index.js" ;
Original file line number Diff line number Diff line change 44 "main" : " dist/index.js" ,
55 "license" : " MIT" ,
66 "author" : " Marc Pomar <marc@faable.com>" ,
7+ "type" : " module" ,
78 "types" : " ./dist/index.d.ts" ,
89 "bugs" : {
910 "url" : " https://github.com/faablecloud/faable/issues"
3233 "@types/yargs" : " ^17.0.17" ,
3334 "rimraf" : " ^3.0.2" ,
3435 "rollup" : " ^3.7.5" ,
36+ "rollup-plugin-auto-external" : " ^2.0.0" ,
3537 "semantic-release" : " ^19.0.5" ,
36- "ts-node" : " ^10.5.0 " ,
38+ "ts-node" : " ^10.9.1 " ,
3739 "typescript" : " ^4.5.5"
3840 },
3941 "scripts" : {
40- "cli" : " ts-node src/index.ts" ,
42+ "cli" : " ts-node --esm --experimental-specifier-resolution=node src/index.ts" ,
4143 "build" : " rimraf pkg && rollup --config rollup.config.mjs" ,
4244 "release" : " yarn build && semantic-release"
4345 },
Original file line number Diff line number Diff line change @@ -4,25 +4,28 @@ import commonjs from "@rollup/plugin-commonjs";
44import { nodeResolve } from "@rollup/plugin-node-resolve" ;
55import copy from "rollup-plugin-copy" ;
66import generatePackageJson from "rollup-plugin-generate-package-json" ;
7+ import autoExternal from "rollup-plugin-auto-external" ;
78
89export default {
910 input : "src/index.ts" ,
1011 output : {
11- file : "pkg/dist/faable.js " ,
12- format : "cjs " ,
12+ dir : "pkg/dist" ,
13+ format : "esm " ,
1314 exports : "named" ,
14- preserveModules : false ,
15+ preserveModules : true ,
1516 preserveModulesRoot : "src" ,
1617 } ,
1718 plugins : [
19+ autoExternal ( ) ,
1820 json ( ) ,
1921 typescript ( ) ,
20- commonjs ( ) ,
21- nodeResolve ( ) ,
22+ // commonjs(),
23+ // nodeResolve(),
2224 copy ( {
2325 targets : [
2426 { src : "README.md" , dest : "pkg" } ,
2527 { src : "bin/*" , dest : "pkg/bin" } ,
28+ { src : "templates/**/*" , dest : "pkg/templates" } ,
2629 ] ,
2730 } ) ,
2831 generatePackageJson ( {
@@ -32,8 +35,9 @@ export default {
3235 main : pkg . main ,
3336 dependencies : pkg . dependencies ,
3437 bin : {
35- faable : "bin/faable" ,
38+ faable : "bin/faable.js " ,
3639 } ,
40+ type : "module" ,
3741 license : "MIT" ,
3842 author : "Marc Pomar <marc@faable.com>" ,
3943 types : "./dist/index.d.ts" ,
File renamed without changes.
Original file line number Diff line number Diff line change 1- import * as fs from "fs-extra" ;
1+ import fs from "fs-extra" ;
22import Handlebars from "handlebars" ;
33import * as path from "path" ;
44import { log } from "../../log" ;
5+ import { fileURLToPath } from "url" ;
56
6- const templates_dir = path . join ( __dirname , "./templates" ) ;
7+ const __filename = fileURLToPath ( import . meta. url ) ;
8+ const __dirname = path . dirname ( __filename ) ;
9+
10+ const templates_dir = path . join ( __dirname , "../../../templates" ) ;
711const dockerfile = fs . readFileSync ( `${ templates_dir } /Dockerfile` ) . toString ( ) ;
812
913// Docker template file
Original file line number Diff line number Diff line change 11import yargs from "yargs" ;
22import { hideBin } from "yargs/helpers" ;
3- import { deploy } from "./commands/deploy" ;
3+ import { deploy } from "./commands/deploy/deploy " ;
44
55yargs ( hideBin ( process . argv ) )
66 . scriptName ( "faable" )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments