-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add init command #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
e25d2a3
4745e5a
bfb0e6e
1fb0a22
da39e3a
0fdc681
815ebd3
77bcff1
de848cd
2720b01
1ac1df2
789e2b8
30d0fe9
cf4b994
9aedc44
344a875
5f3f513
2b5471a
21a91f6
2f074fa
be9202a
efab2cb
16d15b6
b9b5565
82a991a
759d9e2
9ce867b
87d7ee6
a7107cd
cf63e35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { assert, describe, it } from "vitest"; | ||
|
||
describe("", () => { | ||
it("", () => { | ||
assert.equal(1, 1); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { assert, describe, it } from "vitest"; | ||
|
||
describe("", () => { | ||
it("", () => { | ||
assert.equal(1, 1); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Command } from "@commander-js/extra-typings"; | ||
|
||
export const generateCommand = new Command("generate") | ||
.description("Generate the project scaffold") | ||
.argument("<name>", "Type the project name") | ||
.action((str, options) => { | ||
Check failure on line 6 in packages/ferric/src/generate.ts
|
||
|
||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
export function cargoTomlTemplate(projectName: string) { | ||
dougg0k marked this conversation as resolved.
Show resolved
Hide resolved
dougg0k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return ` | ||
[package] | ||
name = ${projectName} | ||
version = "1.0.0" | ||
edition = "2021" | ||
license = "MIT" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies.napi] | ||
version = "3.1" | ||
default-features = false | ||
# see https://nodejs.org/api/n-api.html#node-api-version-matrix | ||
features = ["napi4"] | ||
|
||
[dependencies.napi-derive] | ||
version = "3.1" | ||
features = ["type-def"] | ||
|
||
[build-dependencies] | ||
napi-build = "2" | ||
|
||
[profile.release] | ||
lto = true | ||
codegen-units = 1 | ||
strip = "symbols" | ||
opt-level = "z" | ||
panic = "abort" | ||
dougg0k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`; | ||
} | ||
|
||
export const GIT_IGNORE_TEMPLATE = ` | ||
target | ||
Cargo.lock | ||
|
||
*.xcframework/ | ||
*.apple.node/ | ||
*.android.node/ | ||
|
||
dist | ||
`; | ||
|
||
export const BUILD_RS_TEMPLATE = ` | ||
fn main() { | ||
napi_build::setup(); | ||
} | ||
`; | ||
|
||
export const LIB_RS_TEMPLATE = ` | ||
use napi_derive::napi; | ||
|
||
#[napi] | ||
pub fn sum(a: i32, b: i32) -> i32 { | ||
a + b | ||
} | ||
dougg0k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`; |
Uh oh!
There was an error while loading. Please reload this page.