Skip to content

Commit a0d2f25

Browse files
authored
Merge pull request #3 from donaldfilimon/main
...
2 parents 7c89570 + d52a9a2 commit a0d2f25

445 files changed

Lines changed: 8945 additions & 78185 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1 @@
1-
# These are supported funding model platforms
2-
31
github: [donaldfilimon]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12-
polar: # Replace with a single Polar username
13-
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14-
thanks_dev: # Replace with a single thanks.dev username
15-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
build-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Zig
16+
uses: goto-bus-stop/setup-zig@v2
17+
with:
18+
zig-version: master
19+
20+
- name: Show Zig version
21+
run: zig version
22+
23+
- name: Format check
24+
run: zig fmt --check .
25+
26+
- name: Build
27+
run: zig build
28+
29+
- name: Run tests
30+
run: zig build test
31+
32+
- name: Run check aggregate
33+
run: zig build check

.github/workflows/deploy_docs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Deploy to GitHub Pages
13+
uses: peaceiris/actions-gh-pages@v3
14+
with:
15+
github_token: ${{ secrets.GITHUB_TOKEN }}
16+
publish_dir: ./docs

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,7 @@ dist/
8383
release/
8484
*.tar.gz
8585
*.zip
86+
87+
.nx/installation
88+
.nx/cache
89+
.nx/workspace-data

.nx/nxw.js

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
"use strict";
2+
// This file should be committed to your repository! It wraps Nx and ensures
3+
// that your local installation matches nx.json.
4+
// See: https://nx.dev/recipes/installation/install-non-javascript for more info.
5+
6+
7+
8+
9+
Object.defineProperty(exports, "__esModule", { value: true });
10+
const fs = require('fs');
11+
const path = require('path');
12+
const cp = require('child_process');
13+
const installationPath = path.join(__dirname, 'installation', 'package.json');
14+
function matchesCurrentNxInstall(currentInstallation, nxJsonInstallation) {
15+
if (!currentInstallation.devDependencies ||
16+
!Object.keys(currentInstallation.devDependencies).length) {
17+
return false;
18+
}
19+
try {
20+
if (currentInstallation.devDependencies['nx'] !==
21+
nxJsonInstallation.version ||
22+
require(path.join(path.dirname(installationPath), 'node_modules', 'nx', 'package.json')).version !== nxJsonInstallation.version) {
23+
return false;
24+
}
25+
for (const [plugin, desiredVersion] of Object.entries(nxJsonInstallation.plugins || {})) {
26+
if (currentInstallation.devDependencies[plugin] !== desiredVersion) {
27+
return false;
28+
}
29+
}
30+
return true;
31+
}
32+
catch {
33+
return false;
34+
}
35+
}
36+
function ensureDir(p) {
37+
if (!fs.existsSync(p)) {
38+
fs.mkdirSync(p, { recursive: true });
39+
}
40+
}
41+
function getCurrentInstallation() {
42+
try {
43+
return require(installationPath);
44+
}
45+
catch {
46+
return {
47+
name: 'nx-installation',
48+
version: '0.0.0',
49+
devDependencies: {},
50+
};
51+
}
52+
}
53+
function performInstallation(currentInstallation, nxJson) {
54+
fs.writeFileSync(installationPath, JSON.stringify({
55+
name: 'nx-installation',
56+
devDependencies: {
57+
nx: nxJson.installation.version,
58+
...nxJson.installation.plugins,
59+
},
60+
}));
61+
try {
62+
cp.execSync('npm i', {
63+
cwd: path.dirname(installationPath),
64+
stdio: 'inherit',
65+
windowsHide: false,
66+
});
67+
}
68+
catch (e) {
69+
// revert possible changes to the current installation
70+
fs.writeFileSync(installationPath, JSON.stringify(currentInstallation));
71+
// rethrow
72+
throw e;
73+
}
74+
}
75+
function ensureUpToDateInstallation() {
76+
const nxJsonPath = path.join(__dirname, '..', 'nx.json');
77+
let nxJson;
78+
try {
79+
nxJson = require(nxJsonPath);
80+
if (!nxJson.installation) {
81+
console.error('[NX]: The "installation" entry in the "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript');
82+
process.exit(1);
83+
}
84+
}
85+
catch {
86+
console.error('[NX]: The "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript');
87+
process.exit(1);
88+
}
89+
try {
90+
ensureDir(path.join(__dirname, 'installation'));
91+
const currentInstallation = getCurrentInstallation();
92+
if (!matchesCurrentNxInstall(currentInstallation, nxJson.installation)) {
93+
performInstallation(currentInstallation, nxJson);
94+
}
95+
}
96+
catch (e) {
97+
const messageLines = [
98+
'[NX]: Nx wrapper failed to synchronize installation.',
99+
];
100+
if (e instanceof Error) {
101+
messageLines.push('');
102+
messageLines.push(e.message);
103+
messageLines.push(e.stack);
104+
}
105+
else {
106+
messageLines.push(e.toString());
107+
}
108+
console.error(messageLines.join('\n'));
109+
process.exit(1);
110+
}
111+
}
112+
if (!process.env.NX_WRAPPER_SKIP_INSTALL) {
113+
ensureUpToDateInstallation();
114+
}
115+
116+
require('./installation/node_modules/nx/bin/nx');

.zigversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16.0-dev.457+f90510b08
1+
0.16.0-dev.1225+bf9082518

0 commit comments

Comments
 (0)