@sequenceholdings/artifact-studio 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build.js CHANGED
@@ -1,18 +1,16 @@
1
1
  import { mkdir, writeFile } from 'node:fs/promises';
2
2
  import { createRequire } from 'node:module';
3
3
  import { dirname, resolve } from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
4
  import { build as viteBuild } from 'vite';
6
5
  import { sha256Hex } from './hash.js';
7
6
  import { readArtifactStudioSource } from './project.js';
8
7
  const cliRequire = createRequire(import.meta.url);
9
- const cliDir = dirname(fileURLToPath(import.meta.url));
10
8
  const reactDir = dirname(cliRequire.resolve('react/package.json'));
11
9
  const reactDomDir = dirname(cliRequire.resolve('react-dom/package.json'));
12
10
  const atlasUiDir = dirname(cliRequire.resolve('@sequenceholdings/atlas-ui/package.json'));
13
11
  const atlasUiDist = resolve(atlasUiDir, 'dist');
14
12
  const tailwindCssPath = resolve(dirname(cliRequire.resolve('tailwindcss/package.json')), 'index.css');
15
- const twAnimateCssPath = resolve(cliDir, '..', 'node_modules', 'tw-animate-css', 'dist', 'tw-animate.css');
13
+ const twAnimateCssPath = resolve(dirname(cliRequire.resolve('tw-animate-css/package.json')), 'dist', 'tw-animate.css');
16
14
  function isAssetOutput(value) {
17
15
  return value.type === 'asset';
18
16
  }
package/dist/cli.js CHANGED
@@ -94,22 +94,19 @@ async function initCommand(args) {
94
94
  await replaceInFile(join(dir, 'artifact.bundle.yml'), /\{\{slug\}\}/g, slug);
95
95
  await replaceInFile(join(dir, 'artifact.bundle.yml'), /\{\{title\}\}/g, titleize(slug));
96
96
  await replaceInFile(join(dir, 'package.json'), /\{\{slug\}\}/g, slug);
97
- // TODO(npm-publish): switch back to ^semver from the registry once both
98
- // @sequenceholdings/atlas-ui and @sequenceholdings/artifact-studio are published to npm.
99
97
  const pkgJson = join(dir, 'package.json');
100
- await replaceInFile(pkgJson, /"@sequenceholdings\/atlas-ui": "workspace:\*"/, `"@sequenceholdings/atlas-ui": ${JSON.stringify(`link:${resolveAtlasUiLocalPath()}`)}`);
101
- await replaceInFile(pkgJson, /"@sequenceholdings\/artifact-studio": "workspace:\*"/, `"@sequenceholdings/artifact-studio": ${JSON.stringify(`link:${resolveArtifactStudioLocalPath()}`)}`);
98
+ const atlasUiVersion = readPackageVersion('@sequenceholdings/atlas-ui');
99
+ const artifactStudioVersion = readPackageVersion('@sequenceholdings/artifact-studio');
100
+ await replaceInFile(pkgJson, /"@sequenceholdings\/atlas-ui": "workspace:\*"/, `"@sequenceholdings/atlas-ui": "^${atlasUiVersion}"`);
101
+ await replaceInFile(pkgJson, /"@sequenceholdings\/artifact-studio": "workspace:\*"/, `"@sequenceholdings/artifact-studio": "^${artifactStudioVersion}"`);
102
102
  console.log(`[artifact-studio] initialized ${dir}`);
103
103
  const relativeDir = relative(process.cwd(), dir) || '.';
104
104
  console.log(`Next: cd ${relativeDir} && pnpm install && artifact-studio login && artifact-studio dev --env staging`);
105
105
  return 0;
106
106
  }
107
- function resolveAtlasUiLocalPath() {
107
+ function readPackageVersion(packageName) {
108
108
  const req = createRequire(import.meta.url);
109
- return dirname(req.resolve('@sequenceholdings/atlas-ui/package.json'));
110
- }
111
- function resolveArtifactStudioLocalPath() {
112
- return resolve(dirname(fileURLToPath(import.meta.url)), '..');
109
+ return req(`${packageName}/package.json`).version;
113
110
  }
114
111
  async function loginCommand(args) {
115
112
  const token = typeof args.flags.token === 'string' ? args.flags.token : undefined;
@@ -1,3 +1,4 @@
1
1
  @import "tailwindcss";
2
2
  @import "tw-animate-css";
3
3
  @import "@sequenceholdings/atlas-ui/tokens.css";
4
+ @source "../node_modules/@sequenceholdings/atlas-ui/dist/**/*.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/artifact-studio",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "CLI and SDK types for building Artifact Studio apps",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,8 @@
14
14
  "./cli": {
15
15
  "types": "./dist/cli.d.ts",
16
16
  "default": "./dist/cli.js"
17
- }
17
+ },
18
+ "./package.json": "./package.json"
18
19
  },
19
20
  "files": [
20
21
  "dist",
@@ -34,7 +35,7 @@
34
35
  "tw-animate-css": "^1.4.0",
35
36
  "vite": "8.0.8",
36
37
  "zod": "^4.1.13",
37
- "@sequenceholdings/atlas-ui": "0.1.0"
38
+ "@sequenceholdings/atlas-ui": "0.1.1"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@types/js-yaml": "^4.0.9",
@@ -1,3 +1,4 @@
1
1
  @import "tailwindcss";
2
2
  @import "tw-animate-css";
3
3
  @import "@sequenceholdings/atlas-ui/tokens.css";
4
+ @source "../node_modules/@sequenceholdings/atlas-ui/dist/**/*.mjs";