Skip to content

Commit db97020

Browse files
committed
check in prod dependencies
1 parent 68aaacc commit db97020

File tree

39,879 files changed

+3934067
-2
lines changed

Some content is hidden

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

39,879 files changed

+3934067
-2
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
__tests__/runner/*
22

33
# comment out in distribution branches
4-
node_modules/
5-
lib/
4+
# node_modules/
5+
# lib/
66

77
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
88
# Logs

lib/action.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"use strict";
2+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4+
return new (P || (P = Promise))(function (resolve, reject) {
5+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8+
step((generator = generator.apply(thisArg, _arguments || [])).next());
9+
});
10+
};
11+
var __importStar = (this && this.__importStar) || function (mod) {
12+
if (mod && mod.__esModule) return mod;
13+
var result = {};
14+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
15+
result["default"] = mod;
16+
return result;
17+
};
18+
Object.defineProperty(exports, "__esModule", { value: true });
19+
const core = __importStar(require("@actions/core"));
20+
const fs = __importStar(require("fs-extra"));
21+
const path = __importStar(require("path"));
22+
const child_process_1 = require("child_process");
23+
function run() {
24+
return __awaiter(this, void 0, void 0, function* () {
25+
try {
26+
const pathPrefix = core.getInput("path_prefix") || "";
27+
const version = core.getInput("version") || "";
28+
const baseURL = core.getInput("base_url") || "";
29+
const outputFolder = path.join(process.cwd(), core.getInput("output_folder"));
30+
const workspace_path = path.join(process.cwd(), core.getInput("workspace_path") || "");
31+
fs.mkdirSync(outputFolder, { recursive: true });
32+
yield new Promise((resolve, reject) => {
33+
child_process_1.exec("./node_modules/gatsby-cli/lib/index.js build --prefix-paths", {
34+
cwd: path.dirname(__dirname),
35+
env: {
36+
PATH: process.env.PATH,
37+
GATSBY_PATH_PREFIX: pathPrefix,
38+
GATSBY_WORKSPACE_PATH: workspace_path,
39+
GATSBY_VERSION: version,
40+
GATSBY_BASE_URL: baseURL,
41+
GATSBY_GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY
42+
}
43+
}, (error, stdout, stderr) => {
44+
core.debug(stdout);
45+
core.debug(stderr);
46+
if (!error) {
47+
resolve();
48+
return;
49+
}
50+
else {
51+
reject(error);
52+
}
53+
});
54+
});
55+
yield fs.copy(path.join(path.dirname(__dirname), "public"), outputFolder);
56+
}
57+
catch (error) {
58+
core.setFailed(error.message);
59+
}
60+
});
61+
}
62+
run();

lib/createPages.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
"use strict";
2+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4+
return new (P || (P = Promise))(function (resolve, reject) {
5+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8+
step((generator = generator.apply(thisArg, _arguments || [])).next());
9+
});
10+
};
11+
var __importDefault = (this && this.__importDefault) || function (mod) {
12+
return (mod && mod.__esModule) ? mod : { "default": mod };
13+
};
14+
Object.defineProperty(exports, "__esModule", { value: true });
15+
const path_1 = __importDefault(require("path"));
16+
function createPages({ actions, graphql, getNodeAndSavePathDependency }, pluginOptions) {
17+
return __awaiter(this, void 0, void 0, function* () {
18+
const { createPage } = actions;
19+
const baseURL = (pluginOptions === null || pluginOptions === void 0 ? void 0 : pluginOptions.baseURL) || process.env.GATSBY_BASE_URL;
20+
const githubRepo = (pluginOptions === null || pluginOptions === void 0 ? void 0 : pluginOptions.githubRepo) || process.env.GATSBY_GITHUB_REPOSITORY;
21+
createPage({
22+
path: "lona-design-artifacts",
23+
component: path_1.default.join(__dirname, "../src/templates/lona-design-artifacts.tsx"),
24+
context: {
25+
baseURL,
26+
githubRepo
27+
}
28+
});
29+
const result = yield graphql(`
30+
{
31+
allLonaDocumentPage {
32+
nodes {
33+
id
34+
inputPath
35+
childMdx {
36+
body
37+
}
38+
}
39+
}
40+
}
41+
`);
42+
if (result.errors) {
43+
throw result.errors[0];
44+
}
45+
if (!result.data) {
46+
return;
47+
}
48+
const { allLonaDocumentPage } = result.data;
49+
allLonaDocumentPage.nodes.forEach(n => {
50+
const pagePath = `/${n.inputPath
51+
.replace(/README\.md$/g, "")
52+
.replace(/\.md$/g, "")}`;
53+
createPage({
54+
path: pagePath,
55+
component: path_1.default.join(__dirname, "../src/templates/mdx.tsx"),
56+
context: {
57+
mdx: n.childMdx.body
58+
}
59+
});
60+
getNodeAndSavePathDependency(n.id, pagePath);
61+
});
62+
});
63+
}
64+
exports.createPages = createPages;

lib/onPostBuild.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
"use strict";
2+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4+
return new (P || (P = Promise))(function (resolve, reject) {
5+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8+
step((generator = generator.apply(thisArg, _arguments || [])).next());
9+
});
10+
};
11+
var __importDefault = (this && this.__importDefault) || function (mod) {
12+
return (mod && mod.__esModule) ? mod : { "default": mod };
13+
};
14+
Object.defineProperty(exports, "__esModule", { value: true });
15+
const path_1 = __importDefault(require("path"));
16+
const fs_1 = __importDefault(require("fs"));
17+
const rfc822_date_1 = __importDefault(require("rfc822-date"));
18+
const sketchLibRSSOutputPath = `./public/sketch-library.xml`;
19+
/**
20+
* Output the flat-tokens file
21+
*/
22+
function onPostBuild({ reporter, graphql, pathPrefix }, pluginOptions) {
23+
var _a;
24+
return __awaiter(this, void 0, void 0, function* () {
25+
const workspacePath = (pluginOptions === null || pluginOptions === void 0 ? void 0 : pluginOptions.workspacePath) || process.env.GATSBY_WORKSPACE_PATH;
26+
const version = (pluginOptions === null || pluginOptions === void 0 ? void 0 : pluginOptions.version) || process.env.GATSBY_VERSION;
27+
const baseURL = (pluginOptions === null || pluginOptions === void 0 ? void 0 : pluginOptions.baseURL) || process.env.GATSBY_BASE_URL;
28+
// Validate that the path exists.
29+
if (!workspacePath || !fs_1.default.existsSync(workspacePath)) {
30+
reporter.panic(`
31+
The path passed to gatsby-lona-docs-theme does not exist on your file system:
32+
${workspacePath}
33+
Please pick a path to an existing directory.
34+
See docs here - https://github.com/Lona/lona-docs-github-action
35+
`);
36+
return;
37+
}
38+
const result = yield graphql(`
39+
{
40+
allLonaConfig {
41+
nodes {
42+
config {
43+
workspaceName
44+
workspacePath
45+
workspaceIcon
46+
workspaceDescription
47+
workspaceKeywords
48+
}
49+
}
50+
}
51+
}
52+
`);
53+
if (result.errors) {
54+
throw result.errors[0];
55+
}
56+
if (!result.data) {
57+
return;
58+
}
59+
const { allLonaConfig } = result.data;
60+
const config = (_a = allLonaConfig.nodes[0]) === null || _a === void 0 ? void 0 : _a.config;
61+
const title = config.workspaceName || config.workspacePath
62+
? path_1.default.basename(config.workspacePath)
63+
: "" || `Design System`;
64+
fs_1.default.writeFileSync(sketchLibRSSOutputPath, `<?xml version="1.0" encoding="UTF-8"?>
65+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle">
66+
<channel>
67+
<title>${title}</title>
68+
<description>${title}</description>
69+
<image>
70+
<url></url>
71+
<title>${title}</title>
72+
</image>
73+
<generator>Lona</generator>
74+
<item>
75+
<title>${title}</title>
76+
<pubDate>${rfc822_date_1.default(new Date())}</pubDate>
77+
<enclosure url="${baseURL}${pathPrefix}/library.sketch" type="application/octet-stream" sparkle:version="${version}"/>
78+
</item>
79+
</channel>
80+
</rss>`);
81+
});
82+
}
83+
exports.onPostBuild = onPostBuild;

0 commit comments

Comments
 (0)